Forbid transactions without chain ID by default#1815
Merged
Conversation
Member
Author
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
📝 WalkthroughWalkthroughAdds an opt-in flag to allow unprotected (no EIP‑155 chain id) legacy Ethereum transactions and wires it through RPC, runtime/pallet configuration, EVM validation, mocks, and tests. Also adds runtime RPC enforcement helpers and tests for rejecting/accepting unprotected legacy transactions. Changes
Sequence DiagramsequenceDiagram
participant Client
participant RPC_Handler as RPC Handler
participant Validator as EVM Validator
participant Pallet as Ethereum Pallet
participant EVM as EVM Engine
Client->>RPC_Handler: send_raw_transaction(bytes)
RPC_Handler->>RPC_Handler: deserialize & parse tx
RPC_Handler->>RPC_Handler: is_unprotected_legacy_tx?
alt Unprotected & rpc disallowed
RPC_Handler-->>Client: Error (InvalidChainId)
else Allowed or Protected
RPC_Handler->>Validator: validate(tx, allow_unprotected_txs)
Validator->>Validator: match on chain_id (Some/None) and config
alt Validation fails
Validator-->>RPC_Handler: InvalidChainId
RPC_Handler-->>Client: Error
else Validation ok
RPC_Handler->>Pallet: submit transaction
Pallet->>EVM: execute (uses AllowUnprotectedTxs config)
EVM-->>Pallet: execution result
Pallet-->>RPC_Handler: tx hash
RPC_Handler-->>Client: tx hash
end
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Comment |
librelois
added a commit
to moonbeam-foundation/frontier
that referenced
this pull request
Feb 19, 2026
* forbid txs without chain id by default * fix ts-test test-transaction-cost
librelois
added a commit
to moonbeam-foundation/frontier
that referenced
this pull request
Feb 19, 2026
* forbid txs without chain id by default * fix ts-test test-transaction-cost
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
chain_idare now rejected by default in transactional paths.vin{27,28}(no replay protection), includingeth_sendRawTransaction/eth_sendTransactionflows and runtime transaction validation.chain_id.pallet_ethereum::Config::AllowUnprotectedTxs = true.--rpc-allow-unprotected-txs(RPC submission policy only).Goal of the changes
Disallow unprotected legacy Ethereum transactions by default, while providing explicit opt-in switches for chains or nodes that still need compatibility.
What reviewers need to know
Core validation change:
CheckEvmTransactionConfignow includesallow_unprotected_txs.with_chain_id()now rejectschain_id == Nonewhenis_transactional == trueandallow_unprotected_txs == false.Runtime wiring:
pallet_ethereum::ConfiggainsAllowUnprotectedTxs: Get<bool>and threads it into transactional checks.false(secure-by-default).AllowUnprotectedTxstofalse.RPC policy:
--rpc-allow-unprotected-txs(defaultfalse).Coverage:
rustfmt).