From af884204cbc6f042deab49838312c5048d09a98a Mon Sep 17 00:00:00 2001 From: racytech <82003208+racytech@users.noreply.github.com> Date: Sun, 30 Jul 2023 19:49:31 +0600 Subject: [PATCH] eip-4844: hive tests: RLP decode order and newPayloadV3 to expect versionedHashes (#7943) --- cl/phase1/execution_client/execution_client_direct.go | 2 +- core/types/blob_tx_wrapper.go | 4 ++-- turbo/engineapi/engine_server.go | 2 +- turbo/engineapi/engine_server_experimental.go | 2 +- turbo/engineapi/interface.go | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cl/phase1/execution_client/execution_client_direct.go b/cl/phase1/execution_client/execution_client_direct.go index 8d58e9ad4..316d12fd1 100644 --- a/cl/phase1/execution_client/execution_client_direct.go +++ b/cl/phase1/execution_client/execution_client_direct.go @@ -78,7 +78,7 @@ func (cc *ExecutionClientDirect) NewPayload(payload *cltypes.Eth1Block) (invalid case clparams.CapellaVersion: payloadStatus, err = cc.api.NewPayloadV2(cc.ctx, &request) case clparams.DenebVersion: - payloadStatus, err = cc.api.NewPayloadV3(cc.ctx, &request) + payloadStatus, err = cc.api.NewPayloadV3(cc.ctx, &request, nil) default: err = fmt.Errorf("invalid payload version") } diff --git a/core/types/blob_tx_wrapper.go b/core/types/blob_tx_wrapper.go index b9bf3593d..21a4a87e7 100644 --- a/core/types/blob_tx_wrapper.go +++ b/core/types/blob_tx_wrapper.go @@ -460,11 +460,11 @@ func (txw *BlobTxWrapper) DecodeRLP(s *rlp.Stream) error { return err } - if err := txw.Commitments.DecodeRLP(s); err != nil { + if err := txw.Blobs.DecodeRLP(s); err != nil { return err } - if err := txw.Blobs.DecodeRLP(s); err != nil { + if err := txw.Commitments.DecodeRLP(s); err != nil { return err } diff --git a/turbo/engineapi/engine_server.go b/turbo/engineapi/engine_server.go index 4078a061d..8c82935a7 100644 --- a/turbo/engineapi/engine_server.go +++ b/turbo/engineapi/engine_server.go @@ -598,7 +598,7 @@ func (e *EngineServer) NewPayloadV2(ctx context.Context, payload *engine_types.E // NewPayloadV3 processes new payloads (blocks) from the beacon chain with withdrawals & blob gas. // See https://github.com/ethereum/execution-apis/blob/main/src/engine/specification.md#engine_newpayloadv3 -func (e *EngineServer) NewPayloadV3(ctx context.Context, payload *engine_types.ExecutionPayload) (*engine_types.PayloadStatus, error) { +func (e *EngineServer) NewPayloadV3(ctx context.Context, payload *engine_types.ExecutionPayload, versionedHashes []libcommon.Hash) (*engine_types.PayloadStatus, error) { return e.newPayload(ctx, payload, clparams.DenebVersion) } diff --git a/turbo/engineapi/engine_server_experimental.go b/turbo/engineapi/engine_server_experimental.go index 11c0fbcc6..d6dec2756 100644 --- a/turbo/engineapi/engine_server_experimental.go +++ b/turbo/engineapi/engine_server_experimental.go @@ -623,7 +623,7 @@ func (e *EngineServerExperimental) NewPayloadV2(ctx context.Context, payload *en // NewPayloadV3 processes new payloads (blocks) from the beacon chain with withdrawals & blob gas. // See https://github.com/ethereum/execution-apis/blob/main/src/engine/specification.md#engine_newpayloadv3 -func (e *EngineServerExperimental) NewPayloadV3(ctx context.Context, payload *engine_types.ExecutionPayload) (*engine_types.PayloadStatus, error) { +func (e *EngineServerExperimental) NewPayloadV3(ctx context.Context, payload *engine_types.ExecutionPayload, versionedHashes []libcommon.Hash) (*engine_types.PayloadStatus, error) { return e.newPayload(ctx, payload, clparams.DenebVersion) } diff --git a/turbo/engineapi/interface.go b/turbo/engineapi/interface.go index 566040964..e64417ced 100644 --- a/turbo/engineapi/interface.go +++ b/turbo/engineapi/interface.go @@ -13,7 +13,7 @@ import ( type EngineAPI interface { NewPayloadV1(context.Context, *engine_types.ExecutionPayload) (*engine_types.PayloadStatus, error) NewPayloadV2(context.Context, *engine_types.ExecutionPayload) (*engine_types.PayloadStatus, error) - NewPayloadV3(context.Context, *engine_types.ExecutionPayload) (*engine_types.PayloadStatus, error) + NewPayloadV3(context.Context, *engine_types.ExecutionPayload, []common.Hash) (*engine_types.PayloadStatus, error) ForkchoiceUpdatedV1(ctx context.Context, forkChoiceState *engine_types.ForkChoiceState, payloadAttributes *engine_types.PayloadAttributes) (*engine_types.ForkChoiceUpdatedResponse, error) ForkchoiceUpdatedV2(ctx context.Context, forkChoiceState *engine_types.ForkChoiceState, payloadAttributes *engine_types.PayloadAttributes) (*engine_types.ForkChoiceUpdatedResponse, error) GetPayloadV1(ctx context.Context, payloadID hexutility.Bytes) (*engine_types.ExecutionPayload, error)