diff --git a/op-service/eth/types.go b/op-service/eth/types.go index 76d7fdd9f348..56f3efa2dbb2 100644 --- a/op-service/eth/types.go +++ b/op-service/eth/types.go @@ -324,6 +324,9 @@ func BlockAsPayload(bl *types.Block, config *params.ChainConfig) (*ExecutionPayl } opaqueTxs[i] = otx } + if baseFee == nil { + return nil, fmt.Errorf("base fee was nil") + } payload := &ExecutionPayload{ ParentHash: bl.ParentHash(), diff --git a/op-wheel/engine/engine.go b/op-wheel/engine/engine.go index 9367e1d32d8e..5d14cb0f9067 100644 --- a/op-wheel/engine/engine.go +++ b/op-wheel/engine/engine.go @@ -39,12 +39,28 @@ type RPCBlock struct { } func getBlock(ctx context.Context, client client.RPC, method string, tag string) (*types.Block, error) { - var bl *RPCBlock - err := client.CallContext(ctx, &bl, method, tag, true) + var raw json.RawMessage + err := client.CallContext(ctx, &raw, method, tag, true) if err != nil { return nil, err } - return types.NewBlockWithHeader(&bl.Header).WithBody(types.Body{Transactions: bl.Transactions}), nil + + var head *types.Header + if err := json.Unmarshal(raw, &head); err != nil { + return nil, err + } + + type rpcBlock struct { + Hash common.Hash `json:"hash"` + Transactions []*types.Transaction `json:"transactions"` + } + + var body *rpcBlock + if err := json.Unmarshal(raw, &body); err != nil { + return nil, err + } + + return types.NewBlockWithHeader(head).WithBody(types.Body{Transactions: body.Transactions}), nil } func getHeader(ctx context.Context, client client.RPC, method string, tag string) (*types.Header, error) {