-
Notifications
You must be signed in to change notification settings - Fork 97
fix(evm): Bump cosmos evm to 0.41 and add eth signer extractor for the priority nonce mempool #1430
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
Merged
Changes from 6 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
6759a4d
fix: add eth signer extractor for the priority nonce mempool
Vvaradinov 4b304c3
Merge branch 'main' into Vvaradinov/signer-extractor-mempool
Vvaradinov bc692b1
fix: bump cosmos evm and fix precompiles
Vvaradinov 1d0c859
Merge branch 'main' into Vvaradinov/signer-extractor-mempool
Vvaradinov 80405f1
fix: bump cosmos evm to 0.41
Vvaradinov 1b242d7
CHANGELOG
Vvaradinov 71d496b
fix: imports
Vvaradinov e836dd7
fix: set signer extractor adapter for prepare proposal handler
Vvaradinov c6682be
Merge branch 'main' into Vvaradinov/signer-extractor-mempool
Vvaradinov 342c92b
fix: circular import of signer
Vvaradinov 8428156
fix: add signer to types
Vvaradinov 41da6ad
fix: testnet command and babylon default config
Vvaradinov 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
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,44 @@ | ||
| package app | ||
|
|
||
| import ( | ||
| sdk "github.com/cosmos/cosmos-sdk/types" | ||
| mempool "github.com/cosmos/cosmos-sdk/types/mempool" | ||
| authante "github.com/cosmos/cosmos-sdk/x/auth/ante" | ||
| evmtypes "github.com/cosmos/evm/x/vm/types" | ||
| //evmtypes "github.com/cosmos/evm/x/vm/types" | ||
Vvaradinov marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ) | ||
|
|
||
| var _ mempool.SignerExtractionAdapter = EthSignerExtractionAdapter{} | ||
|
|
||
| // EthSignerExtractionAdapter is the default implementation of SignerExtractionAdapter. It extracts the signers | ||
| // from a cosmos-sdk tx via GetSignaturesV2. | ||
| type EthSignerExtractionAdapter struct { | ||
| fallback mempool.SignerExtractionAdapter | ||
| } | ||
|
|
||
| // NewEthSignerExtractionAdapter constructs a new EthSignerExtractionAdapter instance | ||
| func NewEthSignerExtractionAdapter(fallback mempool.SignerExtractionAdapter) EthSignerExtractionAdapter { | ||
| return EthSignerExtractionAdapter{fallback} | ||
| } | ||
|
|
||
| // GetSigners implements the Adapter interface | ||
| // NOTE: only the first item is used by the mempool | ||
| func (s EthSignerExtractionAdapter) GetSigners(tx sdk.Tx) ([]mempool.SignerData, error) { | ||
| if txWithExtensions, ok := tx.(authante.HasExtensionOptionsTx); ok { | ||
| opts := txWithExtensions.GetExtensionOptions() | ||
| if len(opts) > 0 && opts[0].GetTypeUrl() == "/cosmos.evm.vm.v1.ExtensionOptionsEthereumTx" { | ||
| for _, msg := range tx.GetMsgs() { | ||
| if ethMsg, ok := msg.(*evmtypes.MsgEthereumTx); ok { | ||
| return []mempool.SignerData{ | ||
| mempool.NewSignerData( | ||
| ethMsg.GetFrom(), | ||
| ethMsg.AsTransaction().Nonce(), | ||
| ), | ||
| }, nil | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| return s.fallback.GetSigners(tx) | ||
| } | ||
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
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.