Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds Execution Delegation Framework (EDF / LIP-37) support to the exit-request verification flow, allowing an oracle member to be a DelegationContract whose delegate key submits reports via execute(), while keeping the allowlist keyed by the contract address.
Changes:
- Extend the exit-logs verifier to recognize and unwrap
DelegationContract.execute()calls and verify the signer againstgetDelegate()at the report block. - Add a Hardhat mainnet-fork e2e test suite covering EOA vs delegation members, allowlist behavior, delegate rotation, and a permissive-contract negative case.
- Update CI/runtime scaffolding (Hardhat config/helper, Node 22 in Docker/CI, and e2e workflow job).
Reviewed changes
Copilot reviewed 14 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Adds Hardhat and transitive dependencies needed for fork-based e2e tests. |
| src/test/hardhat-server.ts | Introduces a helper to compile contracts and run a local Hardhat fork node for e2e tests. |
| src/test/fixtures/delegation-contract.bytecode.json | Adds DelegationContract bytecode fixture pinned to an upstream commit for e2e deployment. |
| src/test/fixtures/delegation-contract.abi.json | Adds DelegationContract ABI fixture for interacting with the deployed fixture in tests. |
| src/test/contracts/PermissiveDelegation.sol | Adds a test-double contract used to validate the signer-vs-delegate check. |
| src/services/exit-logs/verifier.ts | Implements EDF-aware decoding/unwrapping, delegate resolution at a historical block, and tx-body integrity checks. |
| src/services/exit-logs/verifier.edf.e2e-spec.ts | New Hardhat fork e2e suite covering EDF behavior and regression cases (including rotation). |
| src/services/exit-logs/exit-logs.e2e-spec.ts | Adjusts env var fallback semantics and updates an expectation/comment for a known baseline behavior. |
| src/services/exit-logs/dto.ts | Extends transaction DTO to include blockNumber for historical delegate resolution. |
| src/services/consensus-api/cl.e2e-spec.ts | Makes CL e2e assertions stable over time by using finalized and range-based expectations. |
| package.json | Adds hardhat as a dev dependency to support new fork-based e2e tests. |
| hardhat.config.cjs | Adds minimal Hardhat configuration for compiling test contracts and forking from EXECUTION_NODE. |
| Dockerfile | Updates build/runtime base images to Node 22. |
| .gitignore | Ignores Hardhat artifacts and cache directories generated by e2e fork runs. |
| .github/workflows/tests_and_checks.yml | Updates Node version to 22 and adds a dedicated e2e job running yarn test:e2e. |
| .github/workflows/test.yml | Updates Node version to 22 for the existing workflow. |
Suppressed comments (1)
src/services/exit-logs/verifier.ts:289
verifyTransactionIntegrity()recomputes the tx hash using only a subset of fields (gas,to,value, fees, nonce, type, chainId+ signature). For typed transactions that include additional fields (e.g., EIP-2930/EIP-1559accessList`, or newer tx types with extra payload), this can produce a hash mismatch and cause false negatives (rejecting valid reports) once such tx shapes appear in the wild.
const verifyTransactionIntegrity = (
tx: ReturnType<typeof txDTO>['result'],
expectedHash: string
) => {
const signature = {
v: Number(tx.v),
r: tx.r,
s: tx.s,
}
const txData = prepareTransactionData(tx)
const serialized = ethers.utils.serializeTransaction(txData, signature)
const computedHash = ethers.utils.keccak256(serialized)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
34
to
37
| result: obj(json.result, (result) => ({ | ||
| from: str(result.from), | ||
| blockNumber: optional(() => str(result.blockNumber)), | ||
| gas: str(result.gas), |
Comment on lines
+4
to
+6
| const require = createRequire(import.meta.url) | ||
| const HARDHAT_CLI_PATH = require.resolve('hardhat/internal/cli/bootstrap') | ||
| const DEFAULT_START_TIMEOUT_MS = 120_000 |
| throw new Error('Transaction is not signed by a trusted Oracle') | ||
| } | ||
|
|
||
| const delegate = await getDelegate(delegationContract, originTx.blockNumber) |
F4ever
reviewed
Aug 7, 2026
F4ever
approved these changes
Aug 11, 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
Adds EDF (LIP-37) support to exit-request verification. An oracle member can
now be a DelegationContract instead of an EOA. The member's delegate hot key
submits reports through
DelegationContract.execute(). The allowlist entryis the contract address, so a hot-key rotation needs no configuration change
from node operators, and reports from before the rotation stay valid.
Main changes
consensus report transaction. A direct
submitReportcall keeps theexisting EOA path unchanged. An
execute()wrapper marks an EDF member.execute()target isthe consensus contract, the wrapped call is
submitReport, the contractis in
ORACLE_ADDRESSES_ALLOWLIST, and the transaction signer equals thecontract's
getDelegate()at the report block. Resolving at the reportblock keeps pre-rotation reports valid after a rotation.
it through
execute(); the target must be the Exit Bus.transaction and checks it against the hash taken from the
ConsensusReachedlog, so the transaction body is authenticated.getDelegate()is read at the report block and fails with an actionableerror when the node cannot serve that state. EDF verification needs an
archive-capable
EXECUTION_NODE; there is no silent fallback.error.
Test coverage
verifier.edf.e2e-spec.tsruns on a Hardhat fork ofmainnet against the real Locator, Exit Bus, and HashConsensus. It swaps
the consensus membership through an impersonated admin and runs the full
report lifecycle:
submitReport,ConsensusReached,submitReportData,ValidatorExitRequest.member accepted and rejected by the allowlist; rotation — the new
delegate verifies with the same allowlist entry, the pre-rotation report
stays valid, the revoked delegate can no longer submit; and a report
through a deliberately permissive contract
(
src/test/contracts/PermissiveDelegation.sol, a test double whoseexecute()does not gate the sender) is rejected by thesigner-vs-delegate check.
tsc --buildclean.latestfails exactly the rotation test; deleting the signer-vs-delegate
comparison fails exactly the permissive-contract test.
hardhat2.26.3 as a dev dependency,hardhat.config.cjs(fork URL fromEXECUTION_NODE), and aHardhatServerhelper that compiles the test contracts and runs the forknode.
PR notes
ORACLE_ADDRESSES_ALLOWLISTmust hold theDelegationContract address, not the hot key.
EXECUTION_NODEmust be archive-capable and trusted.TRUST_MODE=truestill disables all report verification.exit-logs.e2e-spec.tshas one failing teston clean
develop("expected 22 to be 62", multiple-operators case). Itfails without this change too; it is not caused by this branch.