Conversation
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.
Problem
Enso's
delegateroutes contain a Weiroll command program, but executing that program through Enso's VM gives up the gas advantage of MulticallScripter. Passing the API response straight to another executor would also trust third-party targets, approvals, recipients, ETH values, and format upgrades without an application-level authorization boundary.This PR decodes the supported Weiroll subset into direct Scripter calls and adds fail-closed checks before a batch can be signed. It is stacked on #3 (
release/multicall-hardening).What changed
inspectEnsoDelegateRoutefor non-authorizing inspection andbuildEnsoDelegateBatchfor policy-checked construction.9002501, and the exact deployed Enso EIP-7702 implementation code hash. Unknown chains or changed bytecode fail until reviewed.ENSO_API_KEYis configured; no key or API response is committed.Validation
cd js && bun test: 80 passed, including 1,024 generated fan-out programs and 8,274 assertions.cd rust && cargo test && cargo clippy --all-targets -- -D warnings: 21 passed; Clippy clean.forge test --summary: 126 passed; the two RPC-dependent swap tests skipped there and passed in the fork rehearsal.forge snapshot --fuzz-seed 0x51c7 --check --tolerance 5 ...: 109 gas checks passed with no contract gas regression.uv run script/check-memory-bounds.py: all four scoped bounds queries were unsatisfiable.SKIP_ENSO_LIVE=1 bash script/rehearse.shat Ethereum block 25,920,099: deployment, protocol, rollback, EIP-7702, bytecode-integrity, and six Solidity fork checks passed.Review notes
The adapter deliberately rejects delegatecall, computed ETH values, runtime-sized returned values, state replacement, composite Weiroll indices, permit and Permit2 authorization, and non-Ethereum routes. Address-presence checks are tripwires rather than proof of arbitrary calldata semantics, so an independent target registry and exact fork simulation remain required. This code has extensive internal and differential testing but has not received an independent security audit; keep the PR in draft until another reviewer examines the final decoder and policy boundary.