feat(outpost-eth): chunked WIRE->ETH envelope delivery; platform envelope cap 32K - #566
Merged
Merged
Conversation
heifner
previously approved these changes
Aug 14, 2026
heifner
left a comment
Contributor
There was a problem hiding this comment.
Approved — epochIn changes selector, so this lands together with wire-ethereum #181 and the proxy upgrade; confirmed that is the plan.
Verified the chunk-count math and per-chunk slicing against _checkChunkShape, the resume ladder against receivedChunks, the terminal-chunk guard, and the 32K cap across outpost_client.hpp, the Solana mirror, sysio.msgch, and OPPCommon.sol.
Non-blocking:
envelope_chunk_count_mathpins 49/50/512 as literals derived fromSOLANA_MAX_CHUNK_BYTES = 672; #552 moves that constant to 668, so whichever lands second turns the test red. Deriving the expectations from the constant avoids it.discard_and_restarttreats everyjson_rpc_errorasOPP_ChunkBufferMissingat debug level — insufficient funds, nonce errors, and provider rate limiting land there too, and the next call then takes a shape mismatch with no record of the real cause.- The shared batch-operator timeout comment says an undersized tick converges from the on-chain high-water mark. That holds for Ethereum, but the Solana relay still stages from chunk zero every tick — worth scoping the claim to Ethereum.
abi_uint_outputdocuments failing closed, butstd::stoullstops at the first non-digit, so a0xquantity would read 0. Not reachable with the current decoder; afrom_charsswap would keep it true by construction.
…lope cap 32K
Replace the single-tx OPPInbound.epochIn(bytes) delivery with the compiled
8192-byte chunk loop (Solana pattern): 5-arg epoch_in tx fn, owner-bound
resume via envelopeChunkState at latest (epoch-advanced skip, discard-all
wedge escape), per-chunk deadline, sequential receipt-confirmed submission.
ETHEREUM_MAX_CHUNK_BYTES = 8'192 mirrors wire-ethereum OPPCommon.sol.
Platform cap reduction 65'536 -> 32'768 (EIP-7825 per-tx gas cap):
OPP_MAX_ENVELOPE_BYTES in outpost_client.hpp (both clients + derived
hex/RPC guards), the depot sysio.msgch packing cap (coherence - the depot
sizes the envelopes the outposts now reject above 32K), contract-test
mirrors, and the Solana client chunk math (49/50/512).
- ABI fixture regenerated from the recompiled OPPInbound artifact; new
epochIn selector c3e558bc pinned (5-input assertions).
- batch-delivery-timeout-ms: sizing-rule comment incl. the SHARED-knob
clause (also bounds the depot push_action wait at :818; safe
post-WIRE-331). No behavior change.
- MAX_SCHEDULED_BATCH_OPERATORS sizing rationale restated against 32K
(comment-only; sysio.epoch wasm untouched).
- Only sysio.msgch.{wasm,abi} copied back; abi byte-identical (no ABI
delta, no TS regen).
Gates: full build; unit_test (1517), plugin_test, contracts_unit_test
(635), test_fc, and the three plugin binaries all green. Test additions:
chunk-count math, resume decision table + 8 stub-driven delivery cases
(incl. mid-sequence deadline expiry and oversized storedBytes resume),
EIP-7825 gas_limit_cap_exceeded pin.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Change-Id: I33600e69ed2d9580330ea9761b7ab8ad4fea9283
jglanz
force-pushed
the
feature/ethereum-envelope-chunking
branch
from
August 14, 2026 19:06
09d3059 to
b79e36d
Compare
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
WIRE->ETH envelopes over 8 192 bytes could break the exchange. This PR moves the Ethereum relay to the Solana-style compiled 8 192-byte chunk loop and applies the platform-wide envelope-cap reduction 65 536 → 32 768 (EIP-7825: a cold near-64K outbound emit ≈ 45 M gas, ~2.7× the 16 777 216 per-tx cap).
Companion PRs: wire-ethereum
feature/ethereum-envelope-chunking, wire-solana + wire-tools-tsfix/adjusting-max-envelope-size-to-32k.Changes
outpost_ethereum_client): 5-argepoch_in(epochIn(uint32,uint16,uint16,uint32,bytes), selectorc3e558bc); owner-bound resume viaenvelopeChunkStateeth_call atlatest(adopt only on owner+epoch+shape match; stale-header path-2 retry checksnext_epoch_indexand SKIPS if advanced; current-epoch shape mismatch →discardEnvelopeChunksthen restart; discard revert tolerated as already-clear, logged); per-chunk deadline; sequential receipt-confirmed; NO terminal call, NO crank. Zero libfc changes.OPP_MAX_ENVELOPE_BYTES = 32'768(both clients + derived hex/RPC guards);ETHEREUM_MAX_CHUNK_BYTES = 8'192mirror.sysio.msgchpacking cap → 32 768 (the depot SIZES the envelopes; left at 64 K it would build envelopes the outposts reject → epoch stall). Constant-only, no ABI delta. Copy-back scoped tosysio.msgch.{wasm,abi}; abi byte-identical.--batch-delivery-timeout-ms: sizing-rule comment + SHARED-knob clause (it also bounds the depotpush_actioncompletion wait at:818; safe post-WIRE-331). No behavior change.MAX_SCHEDULED_BATCH_OPERATORSrationale restated against 32 K (comment-only insysio.epoch.hpp; wasm untouched — out-of-table touch, noted deliberately).Verification
Full build;
unit_test(1517),plugin_test,contracts_unit_test(635),test_fc, and all three plugin binaries green. New tests: chunk-count math (4 @ 32K, no +1 terminal), resume decision table + 8 stub-driven delivery cases (in-order, resume, peer-owned ignore, discard-restart, revert-tolerance, epoch-advanced skip, mid-sequence deadline expiry, oversized-storedBytes resume), Solana chunk math 49/50/512, EIP-7825gas_limit_cap_exceededpin. RLP regression vector untouched.Full 14-flow local suite: 14/14 SUCCEEDED against this branch + companions (all four OPP directions circulating; live relay
chunk=N/Mevidence). Live envelopes measured 653 B (3 ops) → 2 766 B (21 ops), ~115 B/op — all single-chunk; multi-chunk is exhaustively proven at the hardhat + stub layers (no practical local roster reaches 8 192 B; documented fallback per plan).Notes for reviewers
sysio.{epoch,opreg,uwrit,chalg,reserv}.wasmrebuild 94–119 B different from their committed copies on master (the PR fix(msgch): rebuild sysio.msgch.wasm from its current source #561 pattern) — deliberately not staged; flagging for a separate refresh.batch-delivery-timeout-msperchunks × (block time + margin)— shared knob, see comment; (2) a depotsetconfigchangingoperators_per_epoch(≠7) needs the OPPInbound upgrade FIRST; (3) every EVM client policy should setmax_gas_limittwo-sided (≥ ~7 M, ≤ 16 777 216) — policy-free clients are unbounded (maximum_policy).🤖 Generated with Claude Code