Skip to content

Commit ed5f644

Browse files
fjlhowjmay
authored andcommitted
beacon/blsync: fix requests encoding in engine_newPayloadV4 (ethereum#31775)
This fixes an issue where blocks containing CL requests triggered an error in the engine API. The encoding of requests used base64 instead of hex.
1 parent 6347d13 commit ed5f644

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

beacon/blsync/engineclient.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
"github.com/ethereum/go-ethereum/beacon/params"
2727
"github.com/ethereum/go-ethereum/beacon/types"
2828
"github.com/ethereum/go-ethereum/common"
29+
"github.com/ethereum/go-ethereum/common/hexutil"
2930
ctypes "github.com/ethereum/go-ethereum/core/types"
3031
"github.com/ethereum/go-ethereum/log"
3132
"github.com/ethereum/go-ethereum/rpc"
@@ -104,7 +105,11 @@ func (ec *engineClient) callNewPayload(fork string, event types.ChainHeadEvent)
104105
method = "engine_newPayloadV4"
105106
parentBeaconRoot := event.BeaconHead.ParentRoot
106107
blobHashes := collectBlobHashes(event.Block)
107-
params = append(params, blobHashes, parentBeaconRoot, event.ExecRequests)
108+
hexRequests := make([]hexutil.Bytes, len(event.ExecRequests))
109+
for i := range event.ExecRequests {
110+
hexRequests[i] = hexutil.Bytes(event.ExecRequests[i])
111+
}
112+
params = append(params, blobHashes, parentBeaconRoot, hexRequests)
108113
case "deneb":
109114
method = "engine_newPayloadV3"
110115
parentBeaconRoot := event.BeaconHead.ParentRoot

0 commit comments

Comments
 (0)