Skip to content

[monad] Reserve balance precompile fallback cost#2109

Open
dhil wants to merge 1 commit intomainfrom
dhil/rb-fallback-cost
Open

[monad] Reserve balance precompile fallback cost#2109
dhil wants to merge 1 commit intomainfrom
dhil/rb-fallback-cost

Conversation

@dhil
Copy link
Contributor

@dhil dhil commented Feb 27, 2026

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.

Copilot AI review requested due to automatic review settings February 27, 2026 16:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_COST constant 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 fallback and dippedIntoReserve methods

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.
@dhil dhil force-pushed the dhil/rb-fallback-cost branch from 74367e7 to f6423fc Compare February 27, 2026 20:21
@bhuan bhuan requested a review from a team February 27, 2026 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants