-
Notifications
You must be signed in to change notification settings - Fork 688
[MEL] - Implement delayed message accumulation in native mode #3389
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
Open
Conversation
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
rauljordan
reviewed
Jul 14, 2025
rauljordan
reviewed
Jul 14, 2025
rauljordan
reviewed
Jul 14, 2025
rauljordan
reviewed
Jul 14, 2025
rauljordan
reviewed
Jul 14, 2025
rauljordan
reviewed
Jul 14, 2025
rauljordan
reviewed
Jul 14, 2025
rauljordan
reviewed
Jul 14, 2025
rauljordan
reviewed
Jul 14, 2025
rauljordan
reviewed
Jul 14, 2025
rauljordan
reviewed
Jul 15, 2025
rauljordan
previously approved these changes
Jul 15, 2025
❌ 2 Tests Failed:
View the top 2 failed tests by shortest run time
📣 Thoughts on this report? Let Codecov know! | Powered by Codecov |
amsanghi
previously approved these changes
Dec 12, 2025
eljobe
requested changes
Dec 12, 2025
arbnode/mel/runner/backlog.go
Outdated
|
|
||
| // InitializeDelayedMessageBacklog is to be only called by the Start fsm step of MEL. This function fills the backlog based on the seen and read count from the given mel state | ||
| func InitializeDelayedMessageBacklog(ctx context.Context, d *mel.DelayedMessageBacklog, db *Database, state *mel.State, finalizedAndReadIndexFetcher func(context.Context) (uint64, error)) error { | ||
| if state.DelayedMessagesSeen == 0 && state.DelayedMessagesRead == 0 { // this is the first mel state so no need to initialize backlog even if the state isnt finalized yet |
Member
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.
Nit: Typo "isn't"
eljobe
approved these changes
Dec 15, 2025
Any commits made after this event will not be merged.
github-merge-queue bot
pushed a commit
that referenced
this pull request
Dec 15, 2025
* [MEL] - Implement delayed message accumulation in native mode * address PR comments * add documentation for checkAgainstAccumulator and a minor fix * undo changes to addressed review comments from other PRs * dont make L2msg rlp optional * make meldb take a KeyValueStore * handle reorg in start step- reducing code diff * Message extraction function works with logs instead of receipts * only keep delayed message accumulation changes * cleanup non related code * address PR comments --------- Co-authored-by: Raul Jordan <[email protected]> Co-authored-by: Pepper Lebeck-Jobe <[email protected]>
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.
This PR implements delayed message accumulation logic for native mode of MEL. We introduce a new data structure
DelayedMessageBacklogto enable validation of seen but not-yet-read delayed messages against the current merkle root formed by accumulating all the delayed messages seen by MEL up until now.For optimization, future messages that are prefetched for generating the merkle root are also pre-validated (or pre-read) i.e we don't re-validate them again when we read them in the future, instead we check that the pre-validated message's hash matches the hash of delayed message we fetch from the DB using the same delayed message index.
This PR is based off of #3297 and adding its description below-
We introduce the delayed messages accumulation logic and its verification using
MerkleAccumulator. MEL state has been updated to storeDelayedMessageMerklePartialsinstead of a single head merkle root as that can anyway be calculated using partials.Testing
Added multiple unit tests to check the working of delayed message accumulation and the handling of intermediary merkle roots (of messages that are seen but not read) in conditions like reorgs and advancing of finalized block.
Design