Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log to addr when looping blocklist #28

Merged
merged 1 commit into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

13 changes: 13 additions & 0 deletions core/txpool/immutable/accesscontrol/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,19 @@ func TestImmutableAccessControl_Controller_IsAllowed(t *testing.T) {
addressToCheck: common.HexToAddress("0xabcdefabcdefabcdefabcdefabcdefabcdefabcdefab"),
expectedAllowed: true,
},
{
name: "AddressIsEmpty",
isAnAllowList: false,
providers: map[string]AddressProvider{
"list": &MockAddressProvider{
addresses: map[common.Address]struct{}{
common.HexToAddress("0x1234567890123456789012345678901234567890"): {},
},
},
},
addressToCheck: common.Address{},
expectedAllowed: true,
},
{
name: "AddressInAllowedAddresses",
isAnAllowList: true,
Expand Down
3 changes: 2 additions & 1 deletion core/txpool/legacypool/legacypool.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,8 @@ func (pool *LegacyPool) FilterWithError(tx *types.Transaction) error {
// Check for every access controllers that this transaction is allowed to go through
for _, accessControl := range pool.accessControllers {
if !accessControl.IsAllowed(from, tx) {
log.Warn("Transaction is not allowed by access control", "from", from, "tx", tx.Hash(), "isBlockList", accessControl.IsBlocklist())
log.Warn("Transaction is not allowed by access control",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you 🙇

"from", from, "to", tx.To(), "tx", tx.Hash(), "isBlockList", accessControl.IsBlocklist())
// If any access control doesn't allow
return txpool.ErrTxIsUnauthorized
}
Expand Down