feat: test(exit-certificate): add E2E harness, bridge/status scripts and CI workflow#1655
feat: test(exit-certificate): add E2E harness, bridge/status scripts and CI workflow#1655joanestebanr wants to merge 11 commits into
Conversation
… workflow Add the exit-certificate E2E test harness under test/e2e-exit_certificate/ that spins up a Kurtosis CDK network, prepares a settled certificate and runs the exit_certificate tool. Add supporting scripts (L2->L1 bridge, agglayer certificate status, kurtosis env export, agglayer_status helper) and a CI workflow that runs the E2E test on PRs touching tools/exit_certificate/**. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Claude finished @joanestebanr's task in 2m 32s —— View job 🔍 PR Review CompletePR #1655: E2E test harness for exit-certificate tool 🚀 What's NewThis PR introduces a comprehensive E2E test harness for the exit-certificate tool that:
🐛 Bug FixesNone. 📋 Config UpdatesNone.
|
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0e5274301b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // No open pending certificate: whatever was submitted has settled. | ||
| fmt.Printf("No pending certificate — latest is settled. (%s elapsed)\n", elapsed) | ||
| printStatus(ctx, client, netID) | ||
| return nil |
There was a problem hiding this comment.
Wait for the first certificate before stopping aggsender
When prepare_network.sh calls this helper immediately after the L2→L1 bridge, there is a window before aggsender has submitted any pending certificate. In that state GetNetworkInfo can return LatestPendingStatus == nil and no settled height/LER yet, but this branch still returns success; the next step stops aggkit-001, leaving the E2E with no settled certificate and causing the exit tool to build against a zero previous LER or fail the LER check. Keep polling until a certificate is actually observed as settled, e.g. require a settled height/LER or first observe a pending certificate before treating “no pending” as success.
Useful? React with 👍 / 👎.
…yer_status Drop the GetNetworkInfo summary helper and its call sites; the certificate header is the primary output and the settled/pending summary was redundant. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Cover latestHeader, printStatus, waitForSettled (polling, settled, in-error, timeout, RPC failure) and the formatting helpers using the existing AgglayerClientMock. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
run_network.sh stop now uses `kurtosis clean --all` instead of removing a single named enclave. bridge_l1_to_l2.sh dumps the full `cast run` execution trace before filtering for the revert reason. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
cast 1.7 prints the receipt status field as the raw bool "true"/"false"
instead of "1 (success)"/"0 (failed)" as in <=1.5. The bridge scripts only
matched the substring "success", so a perfectly healthy bridgeAsset tx was
misreported as REVERTED under the CI foundry version, aborting the E2E.
Accept every success spelling ("success", "true", "1", "0x1") in both
bridge_l1_to_l2.sh and bridge_l2_to_l1.sh.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Address the lint failures in agglayer_status/main.go: - mnd: extract the -interval/-timeout defaults into named constants (defaultPollInterval, defaultWaitTimeout). - gocritic/exitAfterDefer: move the body into run() error so os.Exit only runs in main after deferred stop() has executed. - errcheck: return the printStatus error from waitForSettled instead of discarding it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
SonarCloud hotspot githubactions:S7637: pin the third-party foundry-rs/foundry-toolchain action to its full commit SHA (v1 -> c7450ba673e133f5ee30098b3b54f444d3a2ca2d) instead of the mutable v1 tag, so the workflow only ever runs reviewed action code. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
SonarCloud new-code coverage gate failed at 64.4% (<80%) because run() (flag parsing, client creation, dispatch) was untested. Make run() testable by taking the args slice and an injectable client factory and using a local FlagSet instead of the global one, then add TestRun covering the missing URL, invalid flag, factory error, status, env-network and wait paths. Package coverage rises to 96.8% (only main(), which calls os.Exit, is left). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add stop_sequencer.sh (halts the L2 OP stack to simulate a deprecated network) and claim_exit_certificate_funds.sh (builds/runs the claimer and claims pending bridge exits on L1), and wire both into run_e2e_test.sh. Add a -s/--skip-run-network flag to run_e2e_test.sh to skip the network restart step. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…in e2e The e2e claim step failed with "step-wait-result.json: no such file or directory". run_exit_tool ran the exit_certificate pipeline in `all` mode, which stops at SIGN and excludes SUBMIT/WAIT by design, so the certificate was never submitted to agglayer nor settled on L1 — and the claimer anchors the claim to that settlement record. Run `--step submit,wait` after the pipeline so the signed exit certificate is submitted and its L1 settlement (step-submit-result.json / step-wait-result.json) is produced, while agglayer and L1 are still fully operational and before the L2 network is stopped. Also stop halting the aggsender in prepare_network.sh. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|



🔄 Changes Summary
test/e2e-exit_certificate/: spins up a Kurtosis CDK network (run_network.sh), prepares a settled certificate (prepare_network.sh), and runs theexit_certificatetool (run_exit_tool.sh), orchestrated byrun_e2e_test.sh(+helper.sh,single_op_pessimistic_args.json,README.md).tools/exit_certificate/scripts/:bridge_l2_to_l1.sh— L2→L1 bridge to produce a certificate.agglayer_certificate_status.sh— poll/wait for certificate settlement.export_kurtosis_env.sh— export Kurtosis env vars for the scripts.agglayer_status/main.go— agglayer status helper.bridge_l1_to_l2.sh..github/workflows/test-e2e-exit_cenrtificate_tool.ymlthat runs the E2E test on PRs touchingtools/exit_certificate/**(alsoworkflow_dispatch).📋 Config Updates
✅ Testing
test/e2e-exit_certificate/run_e2e_test.shon PRs that modifytools/exit_certificate/**(Kurtosis CDK network → settled certificate → exit_certificate tool)../test/e2e-exit_certificate/run_e2e_test.shlocally (requires Docker, Kurtosis CLI, Foundrycast, Go).🐞 Issues
🔗 Related PRs
📝 Notes
aggkitenclave; the workflow stops the enclave on completion.