Skip to content

Commit cd6a57d

Browse files
authored
fix(l1): yield in-between blocks during batch execution (#3873)
**Motivation** <!-- Why does this pull request exist? What are its goals? --> Recently, while running full sync on sepolia network it has become a common occurrence to suddenly lose all connected peers due to a `Broken Pipe` error. Upon further investigation this seems to be due to block execution being too intensive and leaving p2p unresponsive. A quick fix for this was to add yields in-between block executions when executing blocks in batches. This has solved the problem for sepolia testnet (Over 1 Day without incidents). This could also be improved by further integrating `spawned` into the full sync process. **Description** <!-- A clear and concise general description of the changes this PR introduces --> * Add yields inbetween each block execution when executing blocks in batches <!-- Link to issues: Resolves #111, Resolves #222 --> Closes #issue_number
1 parent e02a846 commit cd6a57d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

crates/blockchain/blockchain.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,7 @@ impl Blockchain {
526526
all_receipts.push((block.hash(), receipts));
527527

528528
log_batch_progress(blocks_len, i);
529+
tokio::task::yield_now().await;
529530
}
530531

531532
let account_updates = vm

0 commit comments

Comments
 (0)