diff --git a/proto/engine/v1/json_marshal_unmarshal.go b/proto/engine/v1/json_marshal_unmarshal.go index c172736565..c63f2d1837 100644 --- a/proto/engine/v1/json_marshal_unmarshal.go +++ b/proto/engine/v1/json_marshal_unmarshal.go @@ -187,7 +187,7 @@ func (e *ExecutionPayload) MarshalJSON() ([]byte, error) { for i, tx := range e.Transactions { transactions[i] = tx } - baseFee := new(big.Int).SetBytes(e.BaseFeePerGas) + baseFee := new(big.Int).SetBytes(bytesutil.ReverseByteOrder(e.BaseFeePerGas)) baseFeeHex := hexutil.EncodeBig(baseFee) return json.Marshal(executionPayloadJSON{ ParentHash: e.ParentHash, diff --git a/proto/engine/v1/json_marshal_unmarshal_test.go b/proto/engine/v1/json_marshal_unmarshal_test.go index 66461c9621..ba0e4e792f 100644 --- a/proto/engine/v1/json_marshal_unmarshal_test.go +++ b/proto/engine/v1/json_marshal_unmarshal_test.go @@ -79,6 +79,7 @@ func TestJsonMarshalUnmarshal(t *testing.T) { }) t.Run("execution payload", func(t *testing.T) { baseFeePerGas := big.NewInt(6) + baseFeePerGasBytes := bytesutil.ReverseByteOrder(baseFeePerGas.Bytes()) parentHash := bytesutil.PadTo([]byte("parent"), fieldparams.RootLength) feeRecipient := bytesutil.PadTo([]byte("feeRecipient"), fieldparams.FeeRecipientLength) stateRoot := bytesutil.PadTo([]byte("stateRoot"), fieldparams.RootLength) @@ -99,7 +100,7 @@ func TestJsonMarshalUnmarshal(t *testing.T) { GasUsed: 3, Timestamp: 4, ExtraData: extra, - BaseFeePerGas: baseFeePerGas.Bytes(), + BaseFeePerGas: baseFeePerGasBytes, BlockHash: hash, Transactions: [][]byte{[]byte("hi")}, }