From 24a46de5b27bea4ff1dbb6580bbe02c122a68c27 Mon Sep 17 00:00:00 2001 From: Nicolas Gotchac Date: Wed, 4 Sep 2024 10:22:07 +0200 Subject: [PATCH 1/2] eth: Add sidecars when available to broadcasted current block (#2675) --- eth/sync.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eth/sync.go b/eth/sync.go index 3b04d09920..3768422566 100644 --- a/eth/sync.go +++ b/eth/sync.go @@ -248,6 +248,9 @@ func (h *handler) doSync(op *chainSyncOp) error { // degenerate connectivity, but it should be healthy for the mainnet too to // more reliably update peers or the local TD state. if block := h.chain.GetBlock(head.Hash(), head.Number.Uint64()); block != nil { + if h.chain.Config().IsCancun(block.Number(), block.Time()) { + block = block.WithSidecars(h.chain.GetSidecarsByHash(block.Hash())) + } h.BroadcastBlock(block, false) } } From 03069a7703c6a7330647cab31802ac576fce24fa Mon Sep 17 00:00:00 2001 From: Nicolas Gotchac Date: Wed, 4 Sep 2024 11:29:17 +0200 Subject: [PATCH 2/2] fetcher: Sleep after marking block as done when requeuing Otherwise the node will be waiting for 500ms before the block fetcher keeps processing. --- eth/fetcher/block_fetcher.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eth/fetcher/block_fetcher.go b/eth/fetcher/block_fetcher.go index fa5a324984..19f8c1ffb8 100644 --- a/eth/fetcher/block_fetcher.go +++ b/eth/fetcher/block_fetcher.go @@ -868,9 +868,9 @@ func (f *BlockFetcher) importHeaders(op *blockOrHeaderInject) { parent := f.getHeader(header.ParentHash) if parent == nil { log.Debug("Unknown parent of propagated header", "peer", peer, "number", header.Number, "hash", hash, "parent", header.ParentHash) - time.Sleep(reQueueBlockTimeout) // forget block first, then re-queue f.done <- hash + time.Sleep(reQueueBlockTimeout) f.requeue <- op return } @@ -909,9 +909,9 @@ func (f *BlockFetcher) importBlocks(op *blockOrHeaderInject) { parent := f.getBlock(block.ParentHash()) if parent == nil { log.Debug("Unknown parent of propagated block", "peer", peer, "number", block.Number(), "hash", hash, "parent", block.ParentHash()) - time.Sleep(reQueueBlockTimeout) // forget block first, then re-queue f.done <- hash + time.Sleep(reQueueBlockTimeout) f.requeue <- op return }