Skip to content

Chore/frontier upstream sync - #173

Merged
nol4lej merged 10 commits into
mainfrom
chore/frontier-upstream-sync
Oct 18, 2026
Merged

nol4lej merged 10 commits into
mainfrom
chore/frontier-upstream-sync

Conversation

@nol4lej

@nol4lej nol4lej commented Oct 18, 2026

Copy link
Copy Markdown
Member

Summary

Ports upstream Frontier (polkadot-evm/frontier) changes made after #1790 that the node did not have yet. Frontier is vendored in-tree, so each upstream change is applied as its own commit with a (cherry picked from commit …) trailer, plus the adaptations the node needs. Everything lands in spec 20, which is not released yet.

Neither polkadot-evm/frontier nor Moonbeam's fork has a branch past stable2603, and the node is already on 2606. Moonbeam's fork also pulls polkadot-sdk, evm and ethereum from its own git forks, which conflicts with the crates.io SDK that ISMP requires. polkadot-evm/frontier stays the reference, and fixes are taken commit by commit.

Runtime (spec 20)

  • Unprotected transactions (#1815): the runtime refuses legacy transactions without an EIP-155 chain id (AllowUnprotectedTxs = false). Only the RPC refused them before, so an extrinsic submitted directly could replay a transaction signed for another chain. The RPC half was already in the node.
  • Transaction gas cap (#1799, b2088f29): at most 2^24 gas per transaction (EIP-7825), configurable through pallet_evm::Config::TransactionGasLimit. The runtime uses Some(MAX_TRANSACTION_GAS_LIMIT). shield costs about 41k gas and private_transfer about 92k, far below the cap.
  • Modexp 0x05 (#1804, #1801): inputs over 1024 bytes now consume all gas (EIP-7823); pricing follows EIP-7883.
  • Failed weight conversion (#1813): the transaction ends as OutOfGas and charges its gas limit, instead of failing the dispatch.
  • Digest check (#1809): pallet_ethereum::on_finalize panics on more than one Frontier pre-runtime log, so the block is invalid. Before, it treated that block as having no log.

Client

  • LRU cache size is no longer inflated when a key is replaced (#1833).

Tests

Documentation

  • RUNTIME_VERSIONS.md: spec 20 lists the five runtime changes.

Testing

  • cargo test --lib:
    • fp-evm (40), pallet-ethereum (72), pallet-evm (48)
    • pallet-evm-precompile-modexp (18), -balances (5), -shielded-pool (13), -dispatch (40)
    • orbinum-runtime (54)
  • LRU cache tests (2, including the new test_replace_same_key_does_not_inflate_size) run in a standalone crate that compiles only lru_cache.rs. The fc-rpc test target does not build because of the git-only substrate-test-runtime-client dev-dependency.
  • The intermediate state after the EIP-7825 commit builds and passes the fp-evm and pallet-ethereum tests.
  • ts-tests against a release build: 188 passing, 4 pending (existing it.skip), 0 failing, including the new test-precompile-modexp.ts.
  • make fmt-check, cargo clippy --all --all-targets --features=runtime-benchmarks,skip-proof-verification,try-runtime -D warnings.

Orbinum: the RPC half (rpc_allow_unprotected_txs) was already in the node, so only
the runtime check lands here. AllowUnprotectedTxs = ConstBool<false> in
template/runtime/src/configs/evm.rs; the EIP-7702 validation tests gain the new field.

(cherry picked from commit 9f94a1538b2f0a7314ffffe959115ea7e50f0e59)
(cherry picked from commit 50ae25ab41285c918fffe14ed069d10c5feab193)
(cherry picked from commit 8e48b1253ba27b99f40856d2bcb538f22ffd080b)
(cherry picked from commit f25b014e7abd19622825086f3d4d0c3f0d57fdf4)
(cherry picked from commit 87347e1d7c92b97bd31579ba977559659157760f)
(cherry picked from commit 3e40adcf53d1fb53b12b17245c48745299ab83b0)
Orbinum: the EIP-7825 validation tests gain the allow_unprotected_txs field from #1815.
MAX_TRANSACTION_GAS_LIMIT was already in fp-evm.

(cherry picked from commit f9adbbfa39ee156b2daf0a6f354d0eaacb65440e)
Orbinum: TransactionGasLimit = Some(MAX_TRANSACTION_GAS_LIMIT) in
template/runtime/src/configs/evm.rs (2^24 gas; shield costs ~41k, private_transfer ~92k).
The balances and shielded-pool precompile mocks, which implement pallet_evm::Config in
full, take TransactionGasLimit = ().

(cherry picked from commit b2088f29b9b95d190f46e4618825fec09853b579)
…ot empty code

Since #171 every Orbinum precompile stores PUSH1 0 PUSH1 0 REVERT so Solidity high-level
calls pass their code-size check. eth_getCode(0x0801) returns that stub.
…hain-id check, EIP-7825 gas cap, modexp EIP-7823/7883, OutOfGas on failed weight conversion, multiple pre-log digests invalid)
@nol4lej
nol4lej merged commit 70d1ffd into main Oct 18, 2026
5 checks passed
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