-
Notifications
You must be signed in to change notification settings - Fork 35
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
fix: Fee market blackberry #277
Conversation
WalkthroughThe changes primarily involve enhancements to transaction handling within the application. This includes the addition of a Changes
Possibly related PRs
Suggested reviewers
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 using PR comments)
Other keywords and placeholders
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 (5)
- app/ante/ante.go (2 hunks)
- app/ante/ante_test.go (4 hunks)
- app/ante/suite.go (4 hunks)
- app/app.go (2 hunks)
- go.mod (1 hunks)
Additional context used
GitHub Check: lint
app/ante/ante_test.go
[failure] 114-114:
too many arguments in call to feemarketante.NewFeeMarketCheckDecoratorapp/ante/ante.go
[failure] 69-69:
too many arguments in call to feemarketante.NewFeeMarketCheckDecorator
[failure] 69-69:
too many arguments in call to feemarketante.NewFeeMarketCheckDecorator
GitHub Check: build
app/ante/ante.go
[failure] 69-69:
too many arguments in call to feemarketante.NewFeeMarketCheckDecorator
GitHub Check: run-tests
app/ante/ante.go
[failure] 69-69:
too many arguments in call to feemarketante.NewFeeMarketCheckDecorator
Additional comments not posted (10)
app/ante/ante_test.go (2)
104-105
: LGTM! The addition of test accounts enhances test robustness.The creation of test accounts using
CreateTestAccounts
ensures valid account data for transaction messages.
51-54
: Verify the function signature forNewFeeMarketCheckDecorator
.The static analysis indicates that there might be too many arguments in the call to
NewFeeMarketCheckDecorator
.Run the following script to verify the function signature:
app/ante/suite.go (3)
49-49
: LGTM! The update tobankKeeper
type aligns with recent architectural changes.The change from
*feeabstestutil.MockBankKeeper
to*feemarketmocks.BankKeeper
suggests an enhancement in the testing framework.
69-69
: LGTM! The new mock setup forbankKeeper
enhances test fidelity.The instantiation of
bankKeeper
usingfeemarketmocks.NewBankKeeper(t)
aligns with recent changes in the fee market's architecture.
103-103
: Verify the usage ofauthKey
inauthkeeper.NewAccountKeeper
.The change from
key
toauthKey
might indicate a change in key management or reference.Run the following script to verify the usage of
authKey
:Verification successful
Verified Usage of
authKey
inauthkeeper.NewAccountKeeper
.The
authKey
is correctly defined and used as a key inauthkeeper.NewAccountKeeper
. It is initialized as aNewKVStoreKey
withauthtypes.StoreKey
, aligning with the expected key management practices.
authKey
is defined asstoretypes.NewKVStoreKey(authtypes.StoreKey)
inapp/ante/suite.go
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of `authKey` in `authkeeper.NewAccountKeeper`. # Test: Search for the function usage. Expect: Correct key management. rg --type go -A 5 $'authkeeper.NewAccountKeeper'Length of output: 850
Script:
#!/bin/bash # Search for the definition and initialization of `authKey` to verify its usage. rg --type go 'authKey'Length of output: 307
app/ante/ante.go (2)
35-35
: LGTM! The addition ofBankKeeper
enhances transaction handling capabilities.The inclusion of
BankKeeper
inHandlerOptions
allows for more comprehensive management of banking-related operations.
67-69
: Verify the function signature forNewFeeMarketCheckDecorator
.The static analysis indicates that there might be too many arguments in the call to
NewFeeMarketCheckDecorator
.Run the following script to verify the function signature:
Tools
GitHub Check: lint
[failure] 69-69:
too many arguments in call to feemarketante.NewFeeMarketCheckDecorator
[failure] 69-69:
too many arguments in call to feemarketante.NewFeeMarketCheckDecoratorGitHub Check: build
[failure] 69-69:
too many arguments in call to feemarketante.NewFeeMarketCheckDecoratorGitHub Check: run-tests
[failure] 69-69:
too many arguments in call to feemarketante.NewFeeMarketCheckDecoratorgo.mod (1)
188-188
: Verify the necessity and security of the new dependency.The addition of
github.com/stretchr/objx v0.5.2
suggests enhanced object manipulation capabilities. Ensure this dependency is essential for the project and doesn't introduce security vulnerabilities.Consider running a security audit on this dependency to ensure it aligns with the project's security standards.
app/app.go (2)
Line range hint
588-597
: Verify the impact of removingFeeGrantKeeper
fromPostHandlerOptions
.The removal of
FeeGrantKeeper
fromPostHandlerOptions
might affect the fee grant functionality. Ensure that this change is intentional and does not break existing functionality.Run the following script to verify the usage of
FeeGrantKeeper
in the codebase:Verification successful
To ensure that the removal of
FeeGrantKeeper
fromPostHandlerOptions
does not affect the functionality, we need to verify its usage within the post-handler logic. Let's search for any references toFeeGrantKeeper
in the post-handler functions.
Removal of
FeeGrantKeeper
fromPostHandlerOptions
is SafeThe
FeeGrantKeeper
is not directly used in the post-handler logic, so its removal fromPostHandlerOptions
does not impact the post-handler functionality. The fee grant functionality is likely managed elsewhere in the application.
- Instances of
FeeGrantKeeper
are found inapp/app.go
, but none are directly related to post-handler logic.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of `FeeGrantKeeper` in the codebase. # Test: Search for `FeeGrantKeeper` usage. Expect: No critical dependencies on post-handler functionality. rg --type go 'FeeGrantKeeper'Length of output: 406
Script:
#!/bin/bash # Description: Verify the usage of `FeeGrantKeeper` in post-handler logic. # Test: Search for `FeeGrantKeeper` usage in post-handler functions. rg --type go 'FeeGrantKeeper' -A 10Length of output: 3248
Line range hint
1022-1034
: Verify the impact of removingFeeGrantKeeper
fromPostHandlerOptions
.The removal of
FeeGrantKeeper
fromPostHandlerOptions
might affect the fee grant functionality. Ensure that this change is intentional and does not break existing functionality.Run the following script to verify the usage of
FeeGrantKeeper
in the codebase:
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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
go.sum
is excluded by!**/*.sum
📒 Files selected for processing (2)
- app/ante/ante_test.go (4 hunks)
- go.mod (4 hunks)
🔇 Additional comments (10)
app/ante/ante_test.go (6)
8-8
: Necessary import added for mocking functionalitiesThe import of
"github.com/stretchr/testify/mock"
is required for setting up mocks in your test cases.
15-15
: Import added for test data utilitiesThe import of
"github.com/cosmos/cosmos-sdk/testutil/testdata"
is necessary for creating test messages used in the tests.
49-52
: Properly mockingSendCoinsFromAccountToModule
in test caseThe mock expectation for
suite.bankKeeper.On("SendCoinsFromAccountToModule", ...)
is correctly set up to ensure that the method is called once during the test execution.
63-64
: Added mock forSendCoinsFromAccountToModule
in IBC fee test caseIncluding the mock expectation for
suite.bankKeeper.SendCoinsFromAccountToModule
ensures that the IBC fee handling is correctly tested.
102-104
: Setting up test accounts and messages in transaction builderBy creating test accounts and setting a message in the transaction builder, you ensure that the transaction is properly constructed before processing.
109-114
: Updated instantiation ofFeeMarketCheckDecorator
with additional dependenciesIncluding
suite.accountKeeper
,suite.bankKeeper
, andsuite.feeGrantKeeper
in the instantiation ofFeeMarketCheckDecorator
ensures that all necessary dependencies are provided, reflecting changes in the decorator's constructor.go.mod (4)
5-5
: Confirm toolchain update to Go 1.23.1The
toolchain
directive has been updated togo1.23.1
. Verify that all development and deployment environments are using this toolchain version to prevent discrepancies.
189-189
: New indirect dependency added:github.com/stretchr/objx
A new indirect dependency
github.com/stretchr/objx v0.5.2
has been added. Confirm that this library is necessary and does not introduce any security vulnerabilities.#!/bin/bash # Description: Determine which package requires `github.com/stretchr/objx`. # Identify dependencies that import `objx`. go mod why github.com/stretchr/objx # Expected: Output shows which direct dependency is pulling in `objx`.
57-57
: Ensure compatibility withfeemarket
v1.1.1The
github.com/skip-mev/feemarket
module has been updated tov1.1.1
. Verify that any API changes are accommodated in the code.#!/bin/bash # Description: Find all usages of the `feemarket` module to check for compatibility issues. # Search for import statements of `feemarket`. rg 'import.*feemarket' --type go # Search for all references to `feemarket` in the codebase. rg 'feemarket\.' --type go # Expected: Review these instances to ensure they align with the updated API.
3-3
: Verify compatibility with Go version 1.22.6The Go version in
go.mod
has been updated to1.22.6
. Ensure that the codebase is compatible with this version and that no deprecated features are used.✅ Verification successful
Compatibility Verified with Go 1.22.6
All checks passed. The codebase is compatible with Go version 1.22.6, and no deprecated features are used.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Search for usage of deprecated Go features. # Example: Check for usage of the deprecated 'io/ioutil' package. rg 'io/ioutil' --type go # Expected: No matches if all usages have been updated to 'io' or 'os' packages.Length of output: 24
Script:
#!/bin/bash # Description: Verify Go version and search for deprecated Go features. # Check the Go version specified in go.mod go_version=$(grep '^go ' go.mod) echo "Go version in go.mod: $go_version" # Search for usage of the deprecated 'io/ioutil' package echo "Searching for 'io/ioutil' usage..." rg 'io/ioutil' --type go # Search for other common deprecated packages (add more patterns as needed) echo "Searching for other deprecated packages..." rg 'golang.org/x/net/context|github.com/golang/net|github.com/gorilla/context' --type goLength of output: 415
@@ -28,7 +28,7 @@ require ( | |||
github.com/stretchr/testify v1.9.0 | |||
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect | |||
google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda // indirect | |||
google.golang.org/grpc v1.64.1 // indirect | |||
google.golang.org/grpc v1.65.0 // indirect |
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.
💡 Codebase verification
Action Required: Investigate feemarket
API Usage Impacting gRPC v1.65.0 Update
- Confirm if
feemarket.NewAppModule
andFeeMarketKeeper
are affected by gRPC v1.65.0 changes.
🔗 Analysis chain
Review gRPC dependency update to v1.65.0
The google.golang.org/grpc
dependency has been updated to v1.65.0
. Check for any breaking changes or deprecations that might affect the codebase.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Identify usage of deprecated gRPC APIs.
# Replace 'DeprecatedAPI' with actual deprecated APIs as per gRPC release notes.
rg 'DeprecatedAPI' --type go
# Expected: No matches if deprecated APIs have been refactored.
Length of output: 132
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
🧹 Outside diff range and nitpick comments (1)
.golangci.yml (1)
Line range hint
63-64
: Consider lowering the maximum issue thresholdsThe
max-issues-per-linter
andmax-same-issues
parameters are set to 10000, which is an extremely high value. This effectively disables the limit on the number of issues a linter can report.max-issues-per-linter: 10000 max-same-issues: 10000While this ensures all issues are reported, it may lead to an overwhelming number of linter messages, potentially obscuring critical issues. Consider lowering these values to a more manageable number (e.g., 50 or 100) to maintain a balance between comprehensive linting and focused issue resolution.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (3)
- .golangci.yml (1 hunks)
- app/ante/ante_test.go (4 hunks)
- app/upgrades.go (0 hunks)
💤 Files with no reviewable changes (1)
- app/upgrades.go
🚧 Files skipped from review as they are similar to previous changes (1)
- app/ante/ante_test.go
🔇 Additional comments (4)
.golangci.yml (4)
12-12
: Approval: Addition ofcopyloopvar
linterThe addition of the
copyloopvar
linter is a good improvement. This linter helps catch subtle bugs related to loop variable scoping in Go, which can be easy to overlook. This change will enhance the overall code quality and reduce the likelihood of related issues.
Line range hint
33-62
: Approval: Addition of specific linter exclusion rulesThe new exclusion rules added to the
issues
section are well-defined and address specific concerns such as deprecated code usage and weak random number generator warnings. These exclusions appear to be intentional and likely necessary for the current state of the project.
Line range hint
84-124
: Approval: Comprehensivegosec
security checksThe expansion of the
gosec
linter settings with a detailed list of included rules is an excellent improvement. This configuration now covers a wide range of security-related checks, including:
- Potential vulnerabilities like SQL injection, command execution, and directory traversal
- Insecure cryptographic practices
- File permission issues
- Potential DoS vulnerabilities
This comprehensive set of security checks will significantly enhance the project's ability to detect and prevent security issues early in the development process.
Line range hint
1-150
: Overall improvement in linting configurationThe changes made to
.golangci.yml
represent a significant improvement in the project's linting configuration:
- The addition of the
copyloopvar
linter will help catch subtle bugs related to loop variable scoping.- The new exclusion rules in the
issues
section address specific concerns while maintaining a high standard of code quality.- The expanded
gosec
settings provide a comprehensive set of security checks, enhancing the project's ability to detect and prevent security vulnerabilities.These changes demonstrate a commitment to code quality and security. The only suggestion for further improvement is to consider lowering the
max-issues-per-linter
andmax-same-issues
thresholds to ensure critical issues are not obscured by an overwhelming number of linter messages.Overall, these modifications to the linter configuration should lead to more robust, secure, and maintainable code.
This is the blackberry fee market fix.
I didn't write this code, just added a commit to #275
Thanks to Skip!
Summary by CodeRabbit
BankKeeper
for better banking operations management.bankKeeper
interactions.FeeGrantKeeper
from post-handler logic, indicating a shift in fee management processes.