Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the gas cost for the reserve balance precompile's fallback method from 40,000 to 100, aligning it with the cost of the dippedIntoReserve method as specified by Monad Foundation. The previous value of 40,000 was a placeholder modeled after the staking contract.
Changes:
- Updated
FALLBACK_COSTconstant from 40,000 to 100 to match the specification - Restructured and enhanced test coverage to validate the new gas cost with both sufficient and insufficient gas scenarios
- Added explicit out-of-gas (OOG) test cases for both
fallbackanddippedIntoReservemethods
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| category/execution/monad/reserve_balance/reserve_balance_contract.cpp | Updated FALLBACK_COST constant from 40,000 to 100 |
| category/execution/monad/reserve_balance/reserve_balance_contract_test.cpp | Restructured fallback test with proper gas amounts (100 and 99); added OOG test for dippedIntoReserve method; corrected gas values in all related tests |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Monad Foundation has specified the cost of the `fallback` method on the reserve balance precompile should be a `100` (which is same as the `dippedIntoReserve` method). Previously, the cost was set to `40'000` (modelled after the staking contract's fallback method) as a placeholder value.
74367e7 to
f6423fc
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Monad Foundation has specified the cost of the
fallbackmethod on the reserve balance precompile should be a100(which is same as thedippedIntoReservemethod). Previously, the cost was set to40'000(modelled after the staking contract's fallback method) as a placeholder value.