eth/catalyst, miner: deduplicate work + show payload id (#26115)

This PR now also includes a fix to the problem of mult-routines building blocks on the same input. This PR works as before with regards to stopping the work, but it just will not spin up a second routine if one is already building. So if the CL does N calls to FCU+buildblock, and N calls to GetPayload, only the first of each will do something, the other calls will be mostly no-ops.

This PR also adds printout of the payload id into the logs.
This commit is contained in:
Martin Holst Swende
2022-11-07 15:30:54 +01:00
committed by GitHub
parent 111ed1af1b
commit ca948b8579
4 changed files with 53 additions and 21 deletions
+6 -1
View File
@@ -184,7 +184,12 @@ func TestEth2PrepareAndGetPayload(t *testing.T) {
}
// give the payload some time to be built
time.Sleep(100 * time.Millisecond)
payloadID := computePayloadId(fcState.HeadBlockHash, &blockParams)
payloadID := (&miner.BuildPayloadArgs{
Parent: fcState.HeadBlockHash,
Timestamp: blockParams.Timestamp,
FeeRecipient: blockParams.SuggestedFeeRecipient,
Random: blockParams.Random,
}).Id()
execData, err := api.GetPayloadV1(payloadID)
if err != nil {
t.Fatalf("error getting payload, err=%v", err)