Skip to content

Commit 36430eb

Browse files
feat(consensus): introduce cache for the payloads (#380)
Co-authored-by: David <[email protected]>
1 parent 3792f93 commit 36430eb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

eth/catalyst/api.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,11 @@ func (api *ConsensusAPI) forkchoiceUpdated(update engine.ForkchoiceStateV1, payl
474474
TxListHash: &txListHash,
475475
}
476476
id := args.Id()
477+
// If we already are busy generating this work, then we do not need
478+
// to start a second process.
479+
if api.localBlocks.has(id) {
480+
return valid(&id), nil
481+
}
477482
payload, err := api.eth.Miner().BuildPayload(args, false)
478483
if err != nil {
479484
log.Error("Failed to build payload", "err", err)

0 commit comments

Comments
 (0)