Set your own reserve balance

10 MON

The reserve every account has today, and the default if it configures nothing.

0 to 2²⁵⁶ − 1 wei

Any amount is valid. Zero is a real setting.

3 blocks

A change takes effect K blocks after the block that makes it.

MIP-23 is a Draft and is not active on any network. It adds three methods to the reserve balance precompile at 0x1001 so an account can choose its own reserve.

The information on this page should not be quoted. Please refer to MIP-23 for the authoritative spec.

A change waits three blocks

An unconfigured account calls setReserveBalance in block 100. Move the block to see what execution applies and what the precompile returns.

New reserve

Active reserve

10 MON

The old value still applies. A setter call never changes the threshold in its own block.

getReserveBalance

(10, 100, 103)

(activeReserve, pendingReserve, validFrom). After activation it returns the active value twice and 0.

Call it again here

succeeds

Same block: the pending value is replaced and validFrom stays 103.

Amounts are in MON for readability; the precompile works in wei. The outputs follow test cases R1 to R7 in the spec.

Three new methods

They extend the precompile from MIP-4. Each must be reached with an ordinary CALL.

  • getK() · 100 gas

    Returns K, the consensus-execution delay. It is 3.

  • getReserveBalance(address) · 25,000 gas

    Returns the active reserve, any pending value and the block it activates. Anyone can query any address.

  • setReserveBalance(uint256) · 150,000 gas

    Schedules a new reserve for the immediate caller. It never picks the account from tx.origin or from calldata.

  • STATICCALL, DELEGATECALL, CALLCODE

    Fail, and so do calls that send value.

The three gas charges are draft values that still need benchmarking.

Reductions apply on time, increases wait longer

Consensus budgets an account's gas from a state K blocks old. These rules stop a pending change from creating budget that isn't protected.

  • Scheduled reduction

    The remaining budget is capped at the lower value from the block where it activates.

  • Scheduled increase

    Does not top up the budget by itself. It counts once consensus uses a snapshot at or after activation, ordinarily 2K blocks after the call.

  • Execution check

    The protected amount is the smaller of the balance before the transaction and the active reserve. The end-of-transaction check is otherwise unchanged.

  • Ordinary contracts

    Can record a configuration, but stay exempt from the reserve restriction.

From the spec's test cases: Bob's reserve drops from 100 to 10 MON at block 103. A 30 MON fee in block 102 is accepted. A 20 MON fee in block 103 is not.

Who this affects

Sponsored and delegated accounts

A zero reserve

An account that only operates through sponsorship can set 0 and move its whole balance. A delegated account at zero generally can't pay for its own transaction to raise the reserve again.

High-volume senders

A larger reserve

The reserve caps the gas fees of transactions that consensus has accepted and execution hasn't reached. A sender with many in flight can raise it.

Wallets

Authenticate configuration calls

The precompile trusts the immediate caller. A delegated wallet that lets any module call it can have its reserve set to 0 or very high. Changing delegation doesn't reset the record.

The three gas charges need benchmarking and the activation fork is specified separately. The spec also notes that the reserve check now reads one more storage page, so the account-warming cost or CALL prices may need to change.

Continue the discussion on Monad Forum

Questions, feedback, or a better idea? Weigh in on the forum thread.

Open forum thread