-
Notifications
You must be signed in to change notification settings - Fork 294
feat(ante): wire ethermint NewEVMSigPreVerifier for lock-free admission #2120
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
Merged
JayT106
merged 21 commits into
crypto-org-chain:main
from
JayT106:jt/refactor-evm-sig-preverifier
Jul 2, 2026
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
dae1917
feat(ante): wire ethermint NewEVMSigPreVerifier for lock-free admission
JayT106 17f5bde
chore: update CHANGELOG for #2120
JayT106 70c502f
fix(lint): sort ethante import before ante/cache
JayT106 604a3f0
chore(deps): update gomod2nix for ethermint 3247d33
JayT106 5c4abe4
test(mempool): add pre-verify rejection + non-EVM fall-through tests
JayT106 1fa8c4d
refactor(test): concise test comments
JayT106 b3e5689
fix(ante): wire SetPreVerify before InsertTxHandler snapshot; no Log …
JayT106 8ab07e4
test(integration): pass hex block number to eth_getBlockReceipts
JayT106 1dfb182
chore(deps): bump ethermint to 122de00
JayT106 df50c2d
refactor(mempool): drop EVM-specific comment, remove snapshot comment
JayT106 49f7030
refactor(mempool): trim InsertTxHandler comments
JayT106 678eed1
refactor(ante): source EVM sig pre-verifier from appmempool
JayT106 1a02a63
chore(deps): bump ethermint to c761415
JayT106 33403ea
Merge branch 'main' into jt/refactor-evm-sig-preverifier
JayT106 fd06832
refactor(mempool): own the pre-verifier registry in the app layer
JayT106 b94ed2c
chore(deps): bump ethermint to ff87a62f (registry removed)
JayT106 2d496fc
simplify comment
JayT106 d06e6d7
Merge branch 'main' into jt/refactor-evm-sig-preverifier
JayT106 481b23c
chore: apply review suggestions; repin ethermint to dadacd149b92 (dev…
JayT106 4dc1485
refactor(mempool): inline a.preVerify in InsertTxHandler closure
JayT106 418e095
chore(deps): repin ethermint to a639532d (develop HEAD)
JayT106 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| package mempool | ||
|
|
||
| // PreVerifierRegistry collects lock-free admission pre-verifiers contributed by | ||
| // modules. The app composes them and hands Verify to the mempool manager, which | ||
| // runs it before the admission mutex (mempool.type=app). First rejection wins; a | ||
| // nil result defers to the locked admission path. | ||
| type PreVerifierRegistry struct { | ||
| verifiers []func([]byte) error | ||
| } | ||
|
|
||
| // Register adds a pre-verifier; nil is ignored. | ||
| func (r *PreVerifierRegistry) Register(v func([]byte) error) { | ||
| if v != nil { | ||
| r.verifiers = append(r.verifiers, v) | ||
| } | ||
| } | ||
|
|
||
| // Verify runs the registered pre-verifiers, returning the first rejection or nil. | ||
| func (r *PreVerifierRegistry) Verify(raw []byte) error { | ||
| for _, v := range r.verifiers { | ||
| if err := v(raw); err != nil { | ||
| return err | ||
| } | ||
| } | ||
| return nil | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| package mempool | ||
|
|
||
| import ( | ||
| "errors" | ||
| "testing" | ||
|
|
||
| "github.com/stretchr/testify/require" | ||
| ) | ||
|
|
||
| func TestPreVerifierRegistry(t *testing.T) { | ||
| reject := errors.New("reject") | ||
|
|
||
| t.Run("empty registry defers", func(t *testing.T) { | ||
| var r PreVerifierRegistry | ||
| require.NoError(t, r.Verify(nil)) | ||
| }) | ||
|
|
||
| t.Run("nil verifier ignored", func(t *testing.T) { | ||
| var r PreVerifierRegistry | ||
| r.Register(nil) | ||
| require.NoError(t, r.Verify(nil)) | ||
| }) | ||
|
|
||
| t.Run("first rejection wins, later verifiers not run", func(t *testing.T) { | ||
| var r PreVerifierRegistry | ||
| ran := false | ||
| r.Register(func([]byte) error { return reject }) | ||
| r.Register(func([]byte) error { ran = true; return nil }) | ||
| require.ErrorIs(t, r.Verify(nil), reject) | ||
| require.False(t, ran, "verifier after a rejection must not run") | ||
| }) | ||
|
|
||
| t.Run("all defer", func(t *testing.T) { | ||
| var r PreVerifierRegistry | ||
| count := 0 | ||
| r.Register(func([]byte) error { count++; return nil }) | ||
| r.Register(func([]byte) error { count++; return nil }) | ||
| require.NoError(t, r.Verify(nil)) | ||
| require.Equal(t, 2, count) | ||
| }) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.