Skip to content

feat: backward and forward LET testing + runbook + tool #1502

Merged
arnaubennassar merged 39 commits intodevelopfrom
feat/back-and-for-let
Mar 11, 2026
Merged

feat: backward and forward LET testing + runbook + tool #1502
arnaubennassar merged 39 commits intodevelopfrom
feat/back-and-for-let

Conversation

@arnaubennassar
Copy link
Collaborator

@arnaubennassar arnaubennassar commented Mar 2, 2026

🔄 Changes Summary

  • New backward_forward_let recovery tool (tools/backward_forward_let): CLI tool for diagnosis and recovery of rollup state after Agglayer and/or L1 become inconsistent with L2 state. Comes with full runbook documentation and E2E tests
  • Fix bridgesync/processor.go BackwardLET/ForwardLET bugs that caused the L2BridgeSyncer to halt or produce duplicate bridges during recovery
  • Rename GetLastLocalExitRoot → GetInitialLocalExitRoot
  • bridgesync/processor.go uses GetInitialLocalExitRoot insted of EmptyLER to avoid bugs for networks that have a non default value
  • EmptyLER moved from aggsender/types to bridgesync/types
  • New aggsender_getCertificateBridgeExits RPC on the aggsender JSON-RPC server, with matching client method: returns bridge exits for a given certificate height
  • flow_base.go: for settled certs, re-derives fromBlock using on-chain data via certQuerier instead of trusting the stored ToBlock, preventing divergence with the validator and accepting Agglayer as source of truth

⚠️ Breaking Changes

None

📋 Config Updates

None

✅ Testing

  • 🤖 Automatic:
    • test/e2e/backwardforwardlet_test.go fully test E2E the new feature
    • Unit tests for all new tool packages: diagnosis_test.go, recovery_test.go, helpers_test.go, override_test.go, send_cert_test.go
    • Updated unit tests in bridgesync/processor_test.go, aggsender/rpc/, aggsender/rpcclient/

🐞 Issues

@arnaubennassar arnaubennassar marked this pull request as draft March 2, 2026 10:05
@arnaubennassar arnaubennassar self-assigned this Mar 2, 2026
@arnaubennassar arnaubennassar changed the title Feat/back and for let feat: backward and forward LET testing + runbook + tool Mar 2, 2026
@agglayer agglayer deleted a comment from claude bot Mar 5, 2026
arnaubennassar and others added 8 commits March 5, 2026 17:36
- Add nolint:dogsled for triple blank identifier in ComputeBackwardLETParams test
- Add nolint:dupl for structurally similar test functions in rpcclient and helpers_test
- Fix gci import ordering (stdlib → external/internal sorted)
- Extract repeated address literals into constants to fix goconst
- Add nolint:lll for long interface method signatures in run.go

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@arnaubennassar arnaubennassar marked this pull request as ready for review March 6, 2026 14:45
fromAddrPtr = archivedBridge.FromAddress
} else if len(archivedBridges) > 1 {
p.log.Warnf("multiple archived bridges found that match forward LET leaf %s;"+
case 0:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to evaluate what happens with backfilling process in that case that txnSender and fromAddr are not set

@agglayer agglayer deleted a comment from claude bot Mar 9, 2026
Copy link
Collaborator

@joanestebanr joanestebanr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Review SonarCloud issue
  • Update PR description: the description is pointing to the previous implementation

arnaubennassar and others added 3 commits March 10, 2026 17:55
…rocess

The container was hardcoded to run as root (user: "0:0"), causing
aggsender.sqlite to be created with root ownership. The test process
(CI runner user) could not write to it, producing "attempt to write a
readonly database" in send-cert tool and failing all BackwardForwardLET tests.

newDockerComposeCmd already injects UID/GID env vars; use them in the
compose file so the container runs as the same user as the test process.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sonarqubecloud
Copy link

@arnaubennassar arnaubennassar merged commit 1adf15e into develop Mar 11, 2026
24 of 25 checks passed
@arnaubennassar arnaubennassar deleted the feat/back-and-for-let branch March 11, 2026 11:38
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.

2 participants