Skip to content

feat(op-revm): add Soul Gas Token (SGT) support for OP Stack#1

Open
blockchaindevsh wants to merge 2 commits intoop-esfrom
op-revm-sgt-support
Open

feat(op-revm): add Soul Gas Token (SGT) support for OP Stack#1
blockchaindevsh wants to merge 2 commits intoop-esfrom
op-revm-sgt-support

Conversation

@blockchaindevsh
Copy link
Collaborator

Implements SGT-aware gas payment for OP Stack chains:

  • SGT balance reading from predeploy contract (0x4200...0800)
  • Deduction priority: SGT first, then native balance
  • Refund priority: native first, then SGT (reverse order)
  • Full test coverage with op-acceptance-tests
  • Preserves L1BlockInfo fetch behavior with SGT config

Implements SGT-aware gas payment for OP Stack chains:
- SGT balance reading from predeploy contract (0x4200...0800)
- Deduction priority: SGT first, then native balance
- Refund priority: native first, then SGT (reverse order)
- Full test coverage with op-acceptance-tests
- Preserves L1BlockInfo fetch behavior with SGT config

Co-authored-by: Claude Code <noreply@anthropic.com>
Move sgt_enabled and sgt_is_native_backed from L1BlockInfo to CfgEnv,
accessed via Cfg trait methods (is_sgt_enabled, is_sgt_native_backed).

This eliminates the need to:
- Mutate the EVM after creation (no configure_sgt on Evm trait)
- Preserve/restore SGT flags around L1BlockInfo::try_fetch
- Fork alloy-evm

SGT config now flows through CfgEnv at EVM creation time, matching
how OpSpecId and other hardfork config is passed.

Runtime deduction tracking (sgt_native_deducted, sgt_amount_deducted)
remains on L1BlockInfo as it is per-transaction mutable state.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant