-
Notifications
You must be signed in to change notification settings - Fork 898
imp(evm): Minor improvements in precompiles #2709
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
Conversation
WalkthroughThis update to the Evmos project introduces a minor improvement in the precompiles-related code, enhancing the functionality of the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Evmos
participant EVM
User->>Evmos: Request blocked addresses
Evmos->>EVM: Fetch available precompiles
EVM-->>Evmos: Return available precompiles
Evmos->>Evmos: Update blocked addresses
Evmos-->>User: Return blocked addresses
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- CHANGELOG.md (1 hunks)
- app/app.go (1 hunks)
- precompiles/bank/bank.go (2 hunks)
Files skipped from review due to trivial changes (1)
- CHANGELOG.md
Additional comments not posted (2)
precompiles/bank/bank.go (1)
16-16
: LGTM!The change to use
evmtypes.BankPrecompileAddress
instead of a hardcoded address enhances maintainability and consistency.Also applies to: 68-68
app/app.go (1)
949-949
: LGTM!The change to use
evmtypes.AvailableStaticPrecompiles
instead ofevmtypes.DefaultStaticPrecompiles
allows for greater flexibility and adaptability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- CHANGELOG.md (1 hunks)
- app/app.go (1 hunks)
- precompiles/bank/bank.go (2 hunks)
Files skipped from review due to trivial changes (1)
- CHANGELOG.md
Additional comments not posted (2)
precompiles/bank/bank.go (1)
68-68
: LGTM! Verify the new reference.The code changes are approved.
Ensure that
evmtypes.BankPrecompileAddress
is correctly defined and used consistently across the codebase.Verification successful
The new reference to
evmtypes.BankPrecompileAddress
is correctly defined and used consistently across the codebase.
- Definition:
x/evm/types/precompiles.go
- Usages:
x/evm/types/precompiles.go
x/evm/types/params.go
precompiles/bank/bank.go
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the definition and usage of `BankPrecompileAddress`. # Test: Search for the definition. Expect: Only one occurrence. rg --type go --pattern 'BankPrecompileAddress' --files-with-matches | xargs rg --type go --pattern 'const BankPrecompileAddress' # Test: Search for the usage. Expect: Multiple occurrences. rg --type go --pattern 'BankPrecompileAddress'Length of output: 1411
Script:
#!/bin/bash # Description: Verify the definition and usage of `BankPrecompileAddress`. # Test: Search for the definition. Expect: Only one occurrence. rg --type go 'BankPrecompileAddress' --files-with-matches | xargs rg 'const BankPrecompileAddress' # Test: Search for the usage. Expect: Multiple occurrences. rg --type go 'BankPrecompileAddress'Length of output: 457
app/app.go (1)
949-949
: LGTM! Verify the new reference.The code changes are approved.
Ensure that
evmtypes.AvailableStaticPrecompiles
is correctly defined and used consistently across the codebase.Verification successful
The new reference
evmtypes.AvailableStaticPrecompiles
is correctly defined and used consistently across the codebase.
Definition found in
x/evm/types/precompiles.go
:var AvailableStaticPrecompiles = []string{Usage found in multiple files:
x/evm/types/precompiles.go
x/evm/keeper/static_precompiles.go
app/app.go
app/app_test.go
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the definition and usage of `AvailableStaticPrecompiles`. # Test: Search for the definition. Expect: Only one occurrence. rg --type go --pattern 'AvailableStaticPrecompiles' --files-with-matches | xargs rg --type go --pattern 'var AvailableStaticPrecompiles' # Test: Search for the usage. Expect: Multiple occurrences. rg --type go --pattern 'AvailableStaticPrecompiles'Length of output: 1424
Script:
#!/bin/bash # Description: Verify the definition and usage of `AvailableStaticPrecompiles`. # Test: Search for the definition. Expect: Only one occurrence. rg --type go 'var AvailableStaticPrecompiles' # Test: Search for the usage. Expect: Multiple occurrences. rg --type go 'AvailableStaticPrecompiles'Length of output: 868
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job @MalteHerrmann !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Thanks @MalteHerrmann!!
This PR removes a duplicate definition of the bank precompile address and it switches the blocked address function to use all available and not the default static precompiles, which may or may not change in the future as opposed to the available ones.
Summary by CodeRabbit
New Features
Documentation