-
Notifications
You must be signed in to change notification settings - Fork 19
feat: index and handle forwardLET event
#1404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feat/index-backward-let
Are you sure you want to change the base?
Conversation
forwardLET event
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements the indexing and processing of ForwardLET (Forward Local Exit Tree) events in the bridgesync component. ForwardLET events restore previously archived bridges to the exit tree after they were removed by BackwardLET events, enabling the protocol to recover from LocalExitTree state mismatches between the Agglayer and L2.
Key changes:
- Added ForwardLET event handling infrastructure with database table, event parsing, and processing logic
- Implemented ABI encoding/decoding utilities for processing Solidity struct arrays from ForwardLET events
- Enhanced bridge tracking by adding a source column to distinguish regular bridges from BackwardLET and ForwardLET restorations
- Updated backfill transaction sender logic to exclude BackwardLET and ForwardLET sources from processing
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| bridgesync/processor.go | Adds ForwardLET event handling, sanity check for local exit roots, and block position tracking for sequential event processing |
| bridgesync/processor_forward_let_test.go | Comprehensive test coverage for ForwardLET event processing with 8 test scenarios including archived bridge matching |
| bridgesync/downloader.go | Adds ForwardLET event signature and handler registration for event parsing |
| bridgesync/abi.go | Implements LeafData struct and ABI decoding logic for ForwardLET event leaves |
| bridgesync/abi_test.go | Tests for LeafData ABI decoding with various data scenarios |
| bridgesync/backfill_tx_sender.go | Updates queries to exclude BackwardLET and ForwardLET sources from transaction sender backfill |
| bridgesync/backfill_tx_sender_test.go | Tests verifying BackwardLET and ForwardLET exclusion in backfill queries |
| bridgesync/migrations/bridgesync0012.sql | Creates forward_let table schema with necessary fields and constraints |
| abi/abi_builder.go | Generic ABI field builder using reflection and struct tags |
| abi/abi_builder_test.go | Tests for ABI field building with various type scenarios |
| abi/abi_encode.go | Generic ABI struct array encoder |
| abi/abi_encode_test.go | Tests for ABI struct array encoding |
| abi/abi_decode.go | Generic ABI struct array decoder with converter pattern |
2e09385 to
72fa419
Compare
9a11387 to
d45406a
Compare
d45406a to
26c5435
Compare
|



🔄 Changes Summary
This PR implements indexing and processing of
ForwardLETevents in thebridgesynccomponent.ForwardLETevents restore previously archived bridges back into the exit tree after they were removed byBackwardLETevents. This is part of the broaderBackwardLET/ForwardLETfeature that enables the protocol to revert and replay exit tree state changes if a missmatch ofLocalExitTreestate happens between theAgglayerandL2.Key changes:
forward_lettable to store ForwardLET events with encoded leaf datahandleForwardLETEvent()to decode leaves, query archived bridges, and reinsert them into the exit treebridge.sourcecolumn) to distinguish between regular bridges, BackwardLET restorations, and ForwardLET restorationsNA
📋 Config Updates
NA
✅ Testing
aggkitCI🐞 Issues
ForwardLETevent in bridge syncer #1360🔗 Related PRs
#1379