From de0b8ae82ce35f77c2883c8d74445b354643b019 Mon Sep 17 00:00:00 2001 From: maskpp Date: Mon, 10 Feb 2025 22:49:54 +0800 Subject: [PATCH] avoid building repeat payload --- eth/catalyst/api.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/eth/catalyst/api.go b/eth/catalyst/api.go index ad66671b6dcc..79b0f2a42854 100644 --- a/eth/catalyst/api.go +++ b/eth/catalyst/api.go @@ -474,6 +474,11 @@ func (api *ConsensusAPI) forkchoiceUpdated(update engine.ForkchoiceStateV1, payl TxListHash: &txListHash, } id := args.Id() + // If we already are busy generating this work, then we do not need + // to start a second process. + if api.localBlocks.has(id) { + return valid(&id), nil + } payload, err := api.eth.Miner().BuildPayload(args, false) if err != nil { log.Error("Failed to build payload", "err", err)