From 38e9a8039d8c434ba9f9fde857c516e173fd545c Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Thu, 16 May 2024 21:23:52 +0300 Subject: [PATCH] fix: update withdrawal request container to match consensus spec (#6797) --- packages/beacon-node/src/execution/engine/types.ts | 4 ++-- .../src/block/processExecutionLayerWithdrawalRequest.ts | 2 +- packages/types/src/electra/sszTypes.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/beacon-node/src/execution/engine/types.ts b/packages/beacon-node/src/execution/engine/types.ts index c7b0aefd07ad..8fcca29a026c 100644 --- a/packages/beacon-node/src/execution/engine/types.ts +++ b/packages/beacon-node/src/execution/engine/types.ts @@ -437,7 +437,7 @@ export function serializeExecutionLayerWithdrawalRequest( ): ExecutionLayerWithdrawalRequestRpc { return { sourceAddress: bytesToData(withdrawalRequest.sourceAddress), - validatorPublicKey: bytesToData(withdrawalRequest.validatorPublicKey), + validatorPublicKey: bytesToData(withdrawalRequest.validatorPubkey), amount: numToQuantity(withdrawalRequest.amount), }; } @@ -447,7 +447,7 @@ export function deserializeExecutionLayerWithdrawalRequest( ): electra.ExecutionLayerWithdrawalRequest { return { sourceAddress: dataToBytes(withdrawalRequest.sourceAddress, 20), - validatorPublicKey: dataToBytes(withdrawalRequest.validatorPublicKey, 48), + validatorPubkey: dataToBytes(withdrawalRequest.validatorPublicKey, 48), amount: quantityToNum(withdrawalRequest.amount), }; } diff --git a/packages/state-transition/src/block/processExecutionLayerWithdrawalRequest.ts b/packages/state-transition/src/block/processExecutionLayerWithdrawalRequest.ts index 935acd522da1..e02129a09d05 100644 --- a/packages/state-transition/src/block/processExecutionLayerWithdrawalRequest.ts +++ b/packages/state-transition/src/block/processExecutionLayerWithdrawalRequest.ts @@ -32,7 +32,7 @@ export function processExecutionLayerWithdrawalRequest( // bail out if validator is not in beacon state // note that we don't need to check for 6110 unfinalized vals as they won't be eligible for withdraw/exit anyway - const validatorIndex = pubkey2index.get(executionLayerWithdrawalRequest.validatorPublicKey); + const validatorIndex = pubkey2index.get(executionLayerWithdrawalRequest.validatorPubkey); if (validatorIndex === undefined) { return; } diff --git a/packages/types/src/electra/sszTypes.ts b/packages/types/src/electra/sszTypes.ts index 0a0c0f6aeefb..a8249156c7b9 100644 --- a/packages/types/src/electra/sszTypes.ts +++ b/packages/types/src/electra/sszTypes.ts @@ -128,7 +128,7 @@ export const DepositReceipts = new ListCompositeType(DepositReceipt, MAX_DEPOSIT export const ExecutionLayerWithdrawalRequest = new ContainerType( { sourceAddress: ExecutionAddress, - validatorPublicKey: BLSPubkey, + validatorPubkey: BLSPubkey, amount: UintNum64, }, {typeName: "ExecutionLayerWithdrawalRequest", jsonCase: "eth2"}