Repository navigation
fix(l2): import peer blocks through a single node-wide importer - #7429
ManuelBilbao wants to merge 1 commit into
Conversation
Every L2 connection imported the blocks it received on its own actor, so a node with several live connections to the sequencer (duplicate inbound and outbound sessions are not deduplicated) ran several `add_block_pipeline`s at once, on tokio workers. Each merkleization parks 17 jobs on the blockchain's 17-thread merkle pool until its block is done, so concurrent imports split the pool between them and none can finish: the follower deadlocked mid-sync at 0% CPU, and with the imports blocking tokio workers, RPC and logging stopped too. Add `L2BlockImporter`, one per node. Connections submit the blocks they receive to its ordered queue and move on; a duplicate submission is rejected, so only the connection that queued a block re-broadcasts it. A single background task imports queued blocks from the local head on, one at a time, running each import on a blocking thread. This replaces the per-connection queue and import. Co-authored-by: Julian Arce <52429267+JuArce@users.noreply.github.com>
|
🤖 Claude Code ReviewReview: PR 7429, single node-wide L2 block importerThe design is sound. A single serialized importer fixes the merkle-pool deadlock, and running Items to consider, most important first:
No consensus, EVM or RLP changes are involved. Items 1 and 2 are worth addressing before merge. The rest are nits. Automated review by Claude (Anthropic) · sonnet · custom prompt |
🤖 Codex Code ReviewFound one correctness issue in the new shared importer; otherwise the direction looks good.
Overall, centralizing imports to avoid overlapping Automated review by OpenAI Codex · gpt-5.4 · custom prompt |
🤖 Kimi Code ReviewI'll review this PR which introduces a centralized L2 block importer to replace per-connection block queue processing. Let me analyze the changes carefully. Overall AssessmentThe PR addresses a real problem (deadlocks from concurrent block imports, duplicate imports across connections) with a sound architectural change. However, there are several issues ranging from correctness bugs to performance concerns. Critical Issues1. Race Condition in
|
| Priority | Issue | Location | Fix |
|---|---|---|---|
| Critical | Race in submit() |
block_importer.rs:44 |
Use insert return value atomically |
| Critical | Lost wake-up |
Automated review by Kimi (Moonshot AI) · kimi-k2.6 · custom prompt
Lines of code reportTotal lines added: Detailed view |
Depends on #7426.
Motivation
Each L2 connection imports the blocks it receives on its own actor. Duplicate inbound and outbound sessions to the sequencer aren't deduplicated, so a node with several connections runs several
add_block_pipelines at once on tokio workers. Each merkleization parks 17 jobs on the blockchain's 17-thread merkle pool until its block is done, so concurrent imports split the pool between them and none can finish. The follower deadlocks mid-sync at 0% CPU, and because the imports block tokio workers, RPC and logging stop too.Description
L2BlockImporter, one per node, which replaces the per-connection queue and import.p2p_block_importtests to drive the importer, and add tests for duplicate submissions, dropping stale blocks, and importing blocks delivered by several connections.Checklist
STORE_SCHEMA_VERSION(crates/storage/lib.rs) if the PR includes breaking changes to theStorerequiring a re-sync.