Skip to content

feat: Use log id for interop root indexing#1092

Open
Artemka374 wants to merge 19 commits intomainfrom
afo/interop-log-id
Open

feat: Use log id for interop root indexing#1092
Artemka374 wants to merge 19 commits intomainfrom
afo/interop-log-id

Conversation

@Artemka374
Copy link
Copy Markdown
Contributor

@Artemka374 Artemka374 commented Mar 26, 2026

Summary

Replaces the compound InteropRootsLogIndex (block number + index-in-block) with a plain u64 log ID (totalPublishedInteropRoots counter from the IMessageRoot contract) everywhere interop root indexing was used.

  • InteropRootsLogIndex is 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.
  • The interop watcher now uses a binary search over MessageRoot.totalPublishedInteropRoots to find the correct starting L1 block, replacing the previous approach of storing the block number directly.
  • SystemTxEnvelope::import_interop_roots now takes log_id as an explicit salt to ensure transaction uniqueness.
  • The RocksDB WAL column family is renamed from starting_interop_event_index to starting_interop_root_id (note: existing DBs will not have this column and will fall back to 0).

Artemka374-claude and others added 19 commits March 16, 2026 17:58
…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
@Artemka374 Artemka374 changed the title Afo/interop log feat: Use log id for interop root indexing Mar 26, 2026
@github-actions
Copy link
Copy Markdown

Test results

251 tests   250 ✅  20m 46s ⏱️
 21 suites    0 💤
  1 files      1 ❌

For more details on these failures, see this check.

Results for commit 8cff8f1.

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