mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +00:00
feat(consensus): introduce cache for the payloads (#380)
Co-authored-by: David <david@taiko.xyz>
This commit is contained in:
parent
3792f9356b
commit
36430eb4f5
1 changed files with 5 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue