Skip to content

test: proxy: cover finality after a bridge re-inclusion and a tracked tx reorged out for good (#1972) - #1995

Open
joanestebanr wants to merge 1 commit into
developfrom
test/445-proxy-reorg-test-coverage
Open

joanestebanr wants to merge 1 commit into
developfrom
test/445-proxy-reorg-test-coverage

Conversation

@joanestebanr

Copy link
Copy Markdown
Collaborator

🔄 Changes Summary

Test-only PR. It is the result of auditing how the reorg behaviour of the aggkit-proxy (#1986) is covered for four scenarios, in unit tests and in e2e. All four were already covered; this PR fills the three places where the coverage was partial.

  • Unit, tracker: TestEngineOriginReorgedOutNeverReincluded (bridgetracker/engine_reorg_test.go). A tracked tx removed by a reorg and never mined again goes back to registered with a fresh UnresolvedTimeout (counted from the reorg, not from when the tx was first tracked), and ends in the terminal error once it elapses, with bridge_status / all_steps gone. The existing tests stopped at registered or at the re-inclusion.
  • Unit, activity: TestActivityReorg_BridgeReincludedBecomesFinal (bridgetracker/db/sqlite_activity_reorg_test.go, in-memory and SQLite stores). A bridge re-included in another block is not final while its new block is not, becomes final with it as a single entry, and that step does not change the revision.
  • E2E: scenario A2 of TestProxyReorgActivity now also mines until the block the bridge was re-included in is final and requires the activity endpoint to list the same single entry with finalized=true and the same revision.
  • test/e2e/README.md: A2 description updated.

Coverage after this PR:

Scenario Unit E2E
Activity: bridge reorged out, not re-included TestBridgesFrom_BridgeRemoved, TestBridgesFrom_NewestBridgeRemoved, TestActivityReorg_BridgeRemoved A1, A4, A5
Activity: bridge re-included in another block TestBridgesFrom_BridgeReincludedInAnotherBlock, TestActivityReorg_BridgeReincludedInAnotherBlock, TestActivityReorg_BridgeReincludedBecomesFinal A2 (now up to final)
Activity and tracker: claim reorged out TestActivityReorg_ClaimReorgedOut, TestReverifyStepsClaimGoneBackToReadyToClaim, TestEngineReorgMovesBackwardsAndNotifies B1, B2 (activity), D2 (tracker, REST and WebSocket)
Tracker: tracked tx reorged out TestCheckOrigin, TestEngineOriginReorgedOut, TestEngineOriginReorgedOutSQLite, TestEngineOriginReorgedOutNeverReincluded D1

⚠️ Breaking Changes

  • None.

📋 Config Updates

  • None.

🔌 API Updates

🔌 Bridge service API

  • No changes.

🔌 Proxy API

  • No changes.

🔌 Others API

  • No changes.

✅ Testing

  • 🤖 Automatic: run locally: go test -count=1 -race ./bridgetracker/... (pass), go vet ./test/e2e/... ./bridgetracker/..., go test -c ./test/e2e (compiles), make lint (0 issues).
  • The e2e change (A2) was not run locally: it runs in this PR's CI, group proxy-reorg-activity of test-go-e2e.yml.

🐞 Issues

🔗 Related PRs

📝 Notes

🤖 Generated with Claude Code

@joanestebanr

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T09:07:00.223632Z d91dd44 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: d91dd440f3

ℹ️ 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".

@joanestebanr joanestebanr self-assigned this Nov 19, 2026
@joanestebanr
joanestebanr marked this pull request as ready for review November 20, 2026 09:06
… tx reorged out for good (#1972)

Audit of the reorg scenarios of the aggkit-proxy (agglayer/pm#445). The four
scenarios were already covered in unit and e2e tests; this fills what was partial:

- unit: TestEngineOriginReorgedOutNeverReincluded, a tracked tx removed by a
  reorg and never mined again gets a fresh UnresolvedTimeout and then ends in
  the terminal error, with nothing left of the resolved bridge.
- unit: TestActivityReorg_BridgeReincludedBecomesFinal (memory and SQLite), a
  bridge re-included in another block becomes final with its new block, as a
  single entry and without changing the revision.
- e2e: scenario A2 also waits for the re-included bridge to become final.

Refs agglayer/pm#445

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@joanestebanr
joanestebanr force-pushed the test/445-proxy-reorg-test-coverage branch from d91dd44 to 5d62b65 Compare November 20, 2026 09:13

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant