feat: Use log id for interop root indexing#1092
Open
Artemka374 wants to merge 19 commits intomainfrom
Open
Conversation
…index (#974) ## Summary Replaces the composite \`InteropRootsLogIndex\` key with a monotonic \`log_id: u64\` from the \`NewInteropRoot\` L1 event for interop root indexing across storage, mempool, sequencer, and network wire format. Introduces wire format v2 with \`starting_interop_root_id: u64\`; v1 is kept frozen per project policy. No new tests added — behaviour is covered by existing wire format round-trip and interop root flow tests. --------- Co-authored-by: Daniyar Itegulov <ditegulov@gmail.com> Co-authored-by: AntonD3 <antonv.dyadyuk@gmail.com> Co-authored-by: Lech <88630083+Artemka374@users.noreply.github.com> Co-authored-by: perekopskiy <53865202+perekopskiy@users.noreply.github.com> Co-authored-by: Daniyar Itegulov <di@matterlabs.dev> Co-authored-by: Artem <afo@matterlabs.dev> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: afo <afo@matter-labs.io>
# Conflicts: # lib/network/src/wire/replays/impls.rs # lib/network/tests/e2e.rs # lib/sequencer/src/execution/block_context_provider.rs # lib/sequencer/src/execution/execute_block_in_vm.rs # lib/sequencer/src/model/blocks.rs # lib/storage/src/db/replay.rs # lib/storage_api/src/model.rs # local-chains/v31.0/gateway-db.tar.gz # local-chains/v31.0/gateway/config.yaml # local-chains/v31.0/l1-state.json.gz # local-chains/v31.0/multi_chain/chain_506.yaml # local-chains/v31.0/multi_chain/chain_6565.yaml # local-chains/v31.0/multi_chain/chain_6566.yaml # local-chains/v31.0/multi_chain/contracts_506.yaml # local-chains/v31.0/multi_chain/contracts_6565.yaml # local-chains/v31.0/multi_chain/contracts_6566.yaml # local-chains/v31.0/multi_chain/wallets_506.yaml # local-chains/v31.0/multi_chain/wallets_6565.yaml # local-chains/v31.0/multi_chain/wallets_6566.yaml # node/bin/src/lib.rs
Test results251 tests 250 ✅ 20m 46s ⏱️ For more details on these failures, see this check. Results for commit 8cff8f1. |
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
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.
Summary
Replaces the compound
InteropRootsLogIndex(block number + index-in-block) with a plainu64log ID (totalPublishedInteropRootscounter from theIMessageRootcontract) everywhere interop root indexing was used.InteropRootsLogIndexis removed from all live codepaths (mempool, sequencer, storage, block context provider, interop watcher). It is kept only for backward-compat with the v1 and v2 network wire format.MessageRoot.totalPublishedInteropRootsto find the correct starting L1 block, replacing the previous approach of storing the block number directly.SystemTxEnvelope::import_interop_rootsnow takeslog_idas an explicit salt to ensure transaction uniqueness.starting_interop_event_indextostarting_interop_root_id(note: existing DBs will not have this column and will fall back to0).