Skip to content

feat: implement TIP-1010 mainnet gas parameters#2194

Merged
0xKitsune merged 144 commits intomainfrom
tip1010-gas-parameters
Jan 22, 2026
Merged

feat: implement TIP-1010 mainnet gas parameters#2194
0xKitsune merged 144 commits intomainfrom
tip1010-gas-parameters

Conversation

@jenpaff
Copy link
Copy Markdown
Contributor

@jenpaff jenpaff commented Jan 20, 2026

Summary

Implements TIP-1010 Mainnet Gas Parameters specification on top of TIP-1000.

Changes

Gas Parameters (TIP-1010 Spec)

Parameter Value Purpose
Base fee 20 gwei (2×10^10 wei) Target ~0.1 cent per TIP-20 transfer
Total block gas limit 500M gas Shared capacity for all transactions
General gas limit 30M gas/block Cap for non-payment transactions
Transaction gas cap 30M gas Support max-size contract deployments

Code Changes

  • chainspec/spec.rs: Update TEMPO_BASE_FEE from 10 gwei to 20 gwei
  • consensus/lib.rs:
    • Replace TEMPO_GENERAL_GAS_DIVISOR with fixed TEMPO_GENERAL_GAS_LIMIT (30M)
    • Add TEMPO_TRANSACTION_GAS_CAP constant (30M)
    • Update header validation to check fixed general_gas_limit
  • evm/context.rs: Use fixed TEMPO_GENERAL_GAS_LIMIT instead of divisor calculation
  • evm/evm.rs: Use TEMPO_TRANSACTION_GAS_CAP constant for tx gas limit cap
  • payload/builder: Use shared 500M pool for total block capacity check

Shared Gas Pool Model

The payment lane is non-dedicated: general transactions consume from the same 500M total block gas limit, reducing the remaining capacity available for payment transactions. However, general transactions are capped at 30M (TEMPO_GENERAL_GAS_LIMIT), guaranteeing that at least 470M gas remains available for payments even under maximum general transaction load.

Testing

  • All unit tests pass
  • Cargo clippy passes

Related

Remove T1 (Tempo Protocol Version 1) hardfork as it's not needed yet.
Remove TempoGasParams trait and tx_tip1000_auth_account_creation_cost
method as they are no longer needed.
Address PR review comments by reverting changes back to main's logic:
- Revert is_t0() to use matches! macro
- Remove TIP-1000 code block from validate_initial_tx_gas
- Revert validate_initial_tx_gas to main's simpler logic
- Revert calculate_aa_batch_intrinsic_gas to not use gas_params
- Restore calculate_2d_nonce_gas function and 2D nonce gas validation
- Add nonce_2d_gas field back to TempoEvm
- Update tests to match main's behavior
- Remove `nonce_2d_gas` field from `TempoEvm` struct
- Remove `calculate_2d_nonce_gas` function from handler
- Add 2D nonce gas calculation to `validate_aa_initial_tx_gas`
- Simplify execution method to not adjust gas for 2D nonce
- Update tests to verify 2D nonce gas is included in intrinsic gas

Gas logic: if nonce_key != 0 and tx.nonce == 0, charge NEW_NONCE_KEY_GAS,
otherwise charge EXISTING_NONCE_KEY_GAS for non-zero nonce keys.
# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	crates/chainspec/src/hardfork.rs
#	crates/consensus/src/lib.rs
#	crates/evm/src/error.rs
#	crates/precompiles/src/storage/evm.rs
#	crates/primitives/Cargo.toml
#	crates/revm/src/evm.rs
#	crates/revm/src/handler.rs
#	crates/transaction-pool/src/validator.rs
- revm-inspectors: git rev 3020ea8cdc → published 0.34.0
- alloy-evm: git rev 072c2482 → published 0.26.0
- reth: 7e8e1ccd6d → 86c414081a (latest main)
- Update reth from 86c414081a to latest main (5e178f6ac6)
- Update alloy-evm from 0.26.0 to 0.26.3
- Pin vergen to 9.0.4 and vergen-git2 to 1.0.5 for compatibility
- Add missing receipts() method to BlockExecutor impl
Copy link
Copy Markdown
Contributor

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

some style suggestions

Comment thread crates/chainspec/src/spec.rs Outdated
Comment thread crates/consensus/src/lib.rs Outdated
Comment thread crates/node/src/node.rs Outdated
Comment thread generated/genesis.json
Comment thread crates/consensus/src/lib.rs Outdated
Copy link
Copy Markdown
Member

@klkvr klkvr left a comment

Choose a reason for hiding this comment

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

lgtm, only have nits

Comment thread crates/evm/src/context.rs Outdated
Comment thread xtask/src/genesis_args.rs Outdated
Base automatically changed from kit/tip1000 to main January 22, 2026 17:54
@0xKitsune 0xKitsune force-pushed the tip1010-gas-parameters branch from 3de247c to fba0579 Compare January 22, 2026 18:06
@0xKitsune 0xKitsune added this pull request to the merge queue Jan 22, 2026
Merged via the queue into main with commit 250b970 Jan 22, 2026
14 checks passed
@0xKitsune 0xKitsune deleted the tip1010-gas-parameters branch January 22, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants