Skip to content

Commit

Permalink
Fix bug with sending empty requests list in pectra-devnet-4 (#12588) (#…
Browse files Browse the repository at this point in the history
…12606)

Cherry pick #12588
  • Loading branch information
somnathb1 authored Nov 4, 2024
1 parent aa15dff commit 3505e94
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion eth/stagedsync/stage_mining_finish.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func SpawnMiningFinishStage(s *StageState, tx kv.RwTx, cfg MiningFinishCfg, quit
//}

block := types.NewBlockForAsembling(current.Header, current.Txs, current.Uncles, current.Receipts, current.Withdrawals)
blockWithReceipts := &types.BlockWithReceipts{Block: block, Receipts: current.Receipts}
blockWithReceipts := &types.BlockWithReceipts{Block: block, Receipts: current.Receipts, Requests: current.Requests}
*current = MiningBlock{} // hack to clean global data

//sealHash := engine.SealHash(block.Header())
Expand Down
14 changes: 12 additions & 2 deletions turbo/engineapi/engine_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -486,9 +486,19 @@ func (s *EngineServer) getPayload(ctx context.Context, payloadId uint64, version
return nil, &engine_helpers.UnknownPayloadErr

}

data := resp.Data
executionRequests := make([][]byte, len(data.Requests.Requests))
copy(executionRequests, data.Requests.Requests)
var executionRequests []hexutility.Bytes
if version >= clparams.ElectraVersion {
executionRequests = make([]hexutility.Bytes, len(types.KnownRequestTypes))
for i := 0; i < len(types.KnownRequestTypes); i++ {
if len(data.Requests.Requests) < i+1 || data.Requests.Requests[i] == nil {
executionRequests[i] = make(hexutility.Bytes, 0)
} else {
executionRequests[i] = data.Requests.Requests[i]
}
}
}

ts := data.ExecutionPayload.Timestamp
if (!s.config.IsCancun(ts) && version >= clparams.DenebVersion) ||
Expand Down
10 changes: 5 additions & 5 deletions turbo/engineapi/engine_types/jsonrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ type ForkChoiceUpdatedResponse struct {
}

type GetPayloadResponse struct {
ExecutionPayload *ExecutionPayload `json:"executionPayload" gencodec:"required"`
BlockValue *hexutil.Big `json:"blockValue"`
BlobsBundle *BlobsBundleV1 `json:"blobsBundle"`
ExecutionRequests [][]byte `json:"executionRequests"`
ShouldOverrideBuilder bool `json:"shouldOverrideBuilder"`
ExecutionPayload *ExecutionPayload `json:"executionPayload" gencodec:"required"`
BlockValue *hexutil.Big `json:"blockValue"`
BlobsBundle *BlobsBundleV1 `json:"blobsBundle"`
ExecutionRequests []hexutility.Bytes `json:"executionRequests"`
ShouldOverrideBuilder bool `json:"shouldOverrideBuilder"`
}

type StringifiedError struct{ err error }
Expand Down

0 comments on commit 3505e94

Please sign in to comment.