Repository navigation
Sec-107: Enforce inbound OPP envelope chaining - #499
Merged
Merged
Conversation
apply_consensus verified the per-outpost envelope chain but STAGED the empty-previous-hash case (accepted + logged, because not every outpost chained yet) and carried an INTERIM SVM cross-stream fallback that bridged the pre-SEC-114 Solana outpost. Both outposts now self-chain per stream -- EVM via OPP.prevEpochHash, SVM via previous_outbound_epoch_hash (wire-solana #364) -- so once a chain tip is recorded for an outpost, an empty or non-continuing previous_envelope_hash is a chain break: the envelope is dropped before dispatch, consensus record, or cleanup, exactly as a non-matching hash already was. An empty prev-hash remains valid only at genesis (before any tip), and an outpost's first accepted envelope still bootstraps. to_checksum256_exact already rejects any non-32-byte field, so wrong-length and all-zero values are breaks too, matching the outposts' canonical-form enforcement. Both the staged empty-accept branch and the SVM cross-stream fallback are removed, collapsing the check to a single "must equal the recorded tip." Recompiles sysio.msgch.wasm; ABI unchanged.
huangminghuang
approved these changes
Jul 9, 2026
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.
Summary
Completes SEC-107 by flipping the depot's inbound envelope-chain verification from staged to enforced, now that both outposts self-chain per stream (wire-ethereum #128/#132 and wire-solana #364, all merged).
sysio.msgch::apply_consensusrecords each accepted envelope's canonical epoch digest as the per-outpost chain tip and verifies continuity, but it previously:previous_envelope_hash(accepted + logged) because not every outpost chained yet, andBoth are removed. Once a tip is recorded for an outpost,
previous_envelope_hashmust be exactly the 32-byte tip; an empty (non-genesis), wrong-length, all-zero, or non-matching value is a chain break and the envelope is dropped before dispatch, consensus record, or cleanup (delivery rows stay for audit/dispute), per the never-throw convention.to_checksum256_exactalready rejects any non-32-byte field, so wrong-length and all-zero values are breaks too, matching the outposts' canonical-form enforcement. An empty prev is valid only at genesis (no tip yet), and an outpost's first accepted envelope still bootstraps.Validation
sysio_msgch_chain_tests(7),sysio_dispatch_tests(39),sysio_dispute_tests(19) pass under sys-vm. The chain suite's staged-empty-accept case flips to a rejection and the SVM cross-stream-accept case flips to a rejection (both now drop, tip unmoved).DROP envelope chain break. SOL->WIRE and ETH->WIRE both verified chaining per stream (genesis-empty, then keccak256 of the prior emit).ABI unchanged; no reference-data regen (msgch is not in the deep-mind/snapshot reference chains).
Follow-ups
finalizeEpochgating (ETH legacy path) remains open.