-
Notifications
You must be signed in to change notification settings - Fork 188
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(katana): estimate message insufficient fee error #2549
Conversation
WalkthroughOhayo, sensei! This pull request introduces modifications to the Changes
Possibly related PRs
🪧 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
Documentation and Community
|
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 (2)
crates/katana/rpc/rpc-types/src/message.rs (1)
16-20
: Ohayo, sensei! LGTM with a small suggestion.The addition of
paid_fee_on_l1
and the accompanying comments are well-explained and address the specific requirement in theblockifier
crate. Great job on providing context!Consider adding a link to the relevant documentation or discussion about fee estimation to provide even more context for future developers.
crates/katana/rpc/rpc/tests/messaging.rs (1)
306-351
: Ohayo, sensei! The new function looks promising, but let's make it even better!The
estimate_message_fee
function is well-structured and covers the necessary steps to test the fee estimation. However, I have a few suggestions to enhance its effectiveness:
- Consider using the deployed contract address directly instead of computing it again.
- The assertion on line 348 only checks if the result is OK. It would be more valuable to assert something about the actual fee value, such as ensuring it's greater than zero or within an expected range.
- Think about adding some cleanup or tear-down of the test environment to ensure a clean state for subsequent tests.
Here's a suggested improvement for the assertion:
- assert!(result.is_ok()); + let fee = result.expect("Fee estimation failed"); + assert!(fee.gas_price > 0, "Estimated gas price should be greater than zero"); + assert!(fee.gas_consumed > 0, "Estimated gas consumed should be greater than zero");What do you think about these suggestions, sensei? Would you like me to propose more detailed changes?
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (3)
- crates/katana/rpc/rpc-types/src/message.rs (2 hunks)
- crates/katana/rpc/rpc/tests/messaging.rs (3 hunks)
- crates/katana/rpc/rpc/tests/starknet.rs (0 hunks)
💤 Files with no reviewable changes (1)
- crates/katana/rpc/rpc/tests/starknet.rs
🧰 Additional context used
🔇 Additional comments (3)
crates/katana/rpc/rpc-types/src/message.rs (2)
34-36
: Ohayo again, sensei! This change looks good.The repositioning of the
calldata
field in the struct initialization is a nice touch. It doesn't affect functionality but might improve readability by grouping related fields together.
Line range hint
1-41
: Ohayo one last time, sensei! Overall, these changes look solid.The modifications to the
MsgFromL1
struct and itsinto_tx_with_chain_id
method effectively address the requirements mentioned in the PR objectives. The addition ofpaid_fee_on_l1
and the repositioning of thecalldata
field are well-implemented and documented.Great work on improving this part of the codebase!
crates/katana/rpc/rpc/tests/messaging.rs (1)
8-8
: Ohayo, sensei! The import changes look good!The new imports are necessary for the added functionality and there are no unused imports. Great job keeping the imports clean and relevant!
Also applies to: 15-15, 24-25
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2549 +/- ##
==========================================
+ Coverage 69.44% 69.54% +0.10%
==========================================
Files 388 388
Lines 49953 49959 +6
==========================================
+ Hits 34688 34745 +57
+ Misses 15265 15214 -51 ☔ View full report in Codecov by Sentry. |
resolves #2546
Summary by CodeRabbit
New Features
Bug Fixes
Tests