Skip to content

feat(evm): activate Osaka and Sei's Amsterdam subset at v6.9 - #4562

Open
shemnon wants to merge 11 commits into
shemnon/con-512-upgrade-sei-chain-to-the-sei-go-ethereum-fork-of-v1177from
shemnon/con-528-activate-osaka-sei-amsterdam
Open

shemnon wants to merge 11 commits into
shemnon/con-512-upgrade-sei-chain-to-the-sei-go-ethereum-fork-of-v1177from
shemnon/con-528-activate-osaka-sei-amsterdam

Conversation

@shemnon

@shemnon shemnon commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Stacked on #4505 (go-ethereum v1.17.7), so this diff shows only the fork activation; it retargets to main once #4505 merges. v6.9 ships Osaka plus the four Amsterdam EIPs agreed in CON-528 (7708 transfer logs, 7954 64 KiB code / 128 KiB initcode, 8024 DUPN/SWAPN/EXCHANGE, 8246 SELFDESTRUCT without burn), using the IsSeiAmsterdam flag from sei-protocol/go-ethereum#106. AmsterdamTime stays unset, so BAL, state gas, SLOTNUM and the rest of Amsterdam stay off.

Activation follows the Pectra pattern: OsakaTime and SeiAmsterdamTime are constants in the binary, and types.EthereumRules(blockTime) derives fork rules from go-ethereum rather than duplicating them. CheckTx and the ante handler, plus evm-only admission, reject transactions over the EIP-7825 gas cap and initcode over the new limit, so nothing admitted pre-fork lands in a block that refuses it. Under EIP-8246 a self-destructed account keeps its balance, and the Sei address association is no longer deleted on SELFDESTRUCT, so that balance stays reachable.

This is consensus-breaking at the upgrade height and adds osaka_time and sei_amsterdam_time to the ChainConfig proto. Review most closely the StateDB self-destruct paths in x/evm/state and its giga twin, and the updated tests that previously pinned burns, log indexes and the 24 KiB limit. It is tested separately from #4505 so it can be dropped from v6.9 without affecting the binary upgrade. Validated with the x/evm, evmrpc, app, giga, precompiles and evmonlyapp suites, including new behavior tests for 7708, 7939, 8024, 7954 and the gas cap.

The v6.9 binary turns on Osaka and the Sei Amsterdam EIPs agreed in
CON-528, using the fork's IsSeiAmsterdam flag. Activation follows the
Pectra pattern: fork times are constants in the binary.

- OsakaTime and SeiAmsterdamTime in x/evm, giga xevm and evm-only configs
- CheckTx/ante: EIP-7825 gas cap and the 96 KiB initcode limit
- Sei StateDB keeps a self-destructed account's balance (EIP-8246)
- Behavior tests for EIP-7708, 7939, 8024, 7954 and the gas cap; tests
  pinning burns, log indexes and the 24 KiB limit updated
EIP-8246 keeps a self-destructed account's balance, so deleting its
Sei address association would strand that balance at a Sei address the
EVM no longer resolves.

- Under IsSeiAmsterdam, SelfDestruct leaves the association in place
- Applies only to contracts created in the same tx (EIP-6780)
…ethereum

Tracks the fork's switch to the upstream EIP-7954 limits (64 KiB code,
128 KiB initcode) and drops sei-chain's copies of its fork logic.

- types.EthereumRules(blockTime) replaces IsOsaka/IsSeiAmsterdam
- Initcode checks in ante and CallEVM use vm.CheckMaxInitCodeSize
- osaka_time and sei_amsterdam_time added to the ChainConfig proto
- evm-only config sets SeiAmsterdamTime from OsakaTime
- Tests and CHANGELOG moved to the 64/128 KiB limits
…sion

The executor refuses a transaction above params.MaxTxGas under Osaka,
so CheckTx now refuses it too instead of letting it into a block.

- Applies once Osaka is scheduled, so pre-fork admissions cannot land
  in a post-fork block
Under Osaka, gas estimation is capped at the EIP-7825 limit, so the
infinite loop runs out of gas before the shrunk timeout fires.
Points the replace at sei-protocol/go-ethereum d7e986033 (#106).
@cursor

cursor Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

PR Summary

High Risk
Consensus-breaking fork activation changes EVM semantics (gas cap, code/initcode limits, transfer logs, SELFDESTRUCT balance handling) and bumps the execution client; mis-tuned StateDB or admission paths could diverge from geth or strand funds.

Overview
Activates Osaka and Sei’s Amsterdam subset (v6.9, app-hash breaking) by wiring osaka_time / sei_amsterdam_time into ChainConfig, bumping sei-protocol/go-ethereum, and deriving fork rules via types.EthereumRules. CheckTx, ante, and evm-only admission now share ValidateTxLimits for EIP-7825’s per-tx gas cap and Amsterdam initcode limits so rejected txs never slip into post-fork blocks.

EIP-8246 changes self-destruct handling in x/evm/state (and giga): balances are retained, Sei↔EVM associations are not cleared, and post-destruct “burn to coinbase” cleanup is skipped under IsSeiAmsterdam. EIP-7708 adds value-transfer logs, which shifts receipt log indexes in RPC tests.

eth_sendRawTransaction surfaces the mempool CheckTx log (e.g. gas-cap failures) instead of opaque : unknown / codespace-only errors. Tests and integration specs are updated for new limits (64 KiB code), opcodes (CLZ, DUPN), and geth parity on rejections.

Reviewed by Cursor Bugbot for commit 1126e99. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedOct 19, 2026, 9:20 PM

@seidroid seidroid Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This change turns on Osaka and Sei's Amsterdam subset (EIP-7708, 7954, 8024, 8246) using binary-constant fork times, applies the EIP-7825 gas cap and the new initcode limit in CheckTx, DeliverTx ante and evm-only admission, and keeps the balance and address association of a self-destructed account. Nothing blocks: the gates read the same DefaultChainConfig that every executor uses, the fee-charged CosmWasm→EVM path correctly skips the cap, and the x/evm and giga StateDB twins match; codex's reading reported nothing, and the one point here that it did not raise is the go-ethereum pin, kept as a suggestion.

Non-blocking

1 finding on the changed lines, as inline comments.

  • The new keeper behavior tests cover 7708, 7939, 8024 and 7954, but nothing in this repo exercises P256VERIFY at 0x100 or the EIP-7823/7883 MODEXP bounds and repricing through Sei's EVM, which adds custom precompiles of its own. A small call test for each would catch a regression in how the custom precompile set merges with geth's Osaka set.

seidroid review · decision approve · session c125127f1b4c4509a5662202d7c0364a · turn resp_claude_8621557e08b2a665059da849e941914f · item 1e7d7775aa1c5011b54904e0dea2a7c1

Findings: 0 blocking | 2 non-blocking | 1 posted inline

Comment thread go.mod
github.com/btcsuite/btcd => github.com/btcsuite/btcd v0.23.2
github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0
github.com/ethereum/go-ethereum => github.com/sei-protocol/go-ethereum v1.15.8-wip.0.20261013200537-44a0f43a0911
github.com/ethereum/go-ethereum => github.com/sei-protocol/go-ethereum v1.15.8-wip.0.20261016212634-d7e986033e5a

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion — This pins consensus-critical EVM code (IsSeiAmsterdam, the EIP-8246 SELFDESTRUCT path, the 7708 logs) to d7e986033e5a. That commit is the head of sei-protocol/go-ethereum#106, which is still open and unmerged. If that branch is squashed or rebased, this pin points at a commit the fork no longer has, and the code that ships in v6.9 is not the code that was reviewed. Merge #106 and repin to the merged commit before this lands.

CheckTx reported the initcode and EIP-7825 rejections as code 1 with no
codespace, so RPC clients saw ": unknown".

- Initcode over the limit wraps ErrTxTooLarge
- Gas over the EIP-7825 cap wraps ErrOutOfGas, like the block max gas check
- The go-ethereum reason is kept as the wrap text
A rejected broadcast was rebuilt from its code alone under the sdk
codespace, dropping the reason and misreading codes from other
codespaces.

- Return CheckTx's log when present, else the registered error for its
  real codespace and code
- TestSendRawTransaction no longer expects the misread "invalid sequence"
- eth_getBlockByNumber spec: Sei now reports "intrinsic gas too low" like geth
Value moved by the payable Sei precompiles now produces Transfer logs, matching
the value-carrying frames in the trace.

- TransferWithoutEvents runs core.Transfer with Cosmos events suppressed, so the
  payment to bank, staking, gov and wasmd is logged
- the payment refund logs inside its synthetic CALL frame; HandlePaymentUsei and
  HandlePaymentUseiWei take the EVM instead of its depth
- bank sendNative logs the caller-to-receiver transfer

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1847aeb. Configure here.

Comment thread precompiles/wasmd/wasmd.go Outdated
if value != nil && !useiAmt.IsZero() {
useiAmtAsWei := useiAmt.Mul(state.SdkUseiToSweiMultiplier).BigInt()
coin, err := pcommon.HandlePaymentUsei(ctx, p.evmKeeper.GetSeiAddressOrDefault(ctx, p.address), creatorAddr, useiAmtAsWei, p.bankKeeper, p.evmKeeper, hooks, evm.GetDepth())
coin, err := pcommon.HandlePaymentUsei(ctx, p.evmKeeper.GetSeiAddressOrDefault(ctx, p.address), creatorAddr, useiAmtAsWei, p.bankKeeper, p.evmKeeper, hooks, evm)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Wasmd omits actual transfer logs

Medium Severity

instantiate and execute now emit EIP-7708 payment and refund logs via HandlePaymentUsei, but never log the native usei that wasmdKeeper then sends to the CosmWasm contract. Indexers see a round-trip that nets to zero while the contract actually receives the funds, unlike sendNative which logs that third transfer. Receipt logs are consensus-relevant, so this gap would be frozen at v6.9.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1847aeb. Configure here.

Reverts 1847aeb. Value sent to the bank, staking, gov and wasmd precompiles
stays unlogged; giga's precompile conversions will add the transfer logs.

- CHANGELOG notes the precompile exception under EIP-7708
A creation tx over the initcode limit passed CheckTx, then the executor
rejected it and no receipt was stored, so the hash never resolved.

- parseTx checks initcode size against the last committed block's rules
- CHANGELOG notes eth_sendRawTransaction now returns the CheckTx log

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant