From f794536389faa4567f16d76554dfccb84f157737 Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Thu, 16 May 2024 11:54:51 +0300 Subject: [PATCH] fix: update data format of WithdrawalRequestV1 (#6789) --- packages/beacon-node/src/execution/engine/payloadIdCache.ts | 2 +- packages/beacon-node/src/execution/engine/types.ts | 4 ++-- .../src/block/processExecutionLayerWithdrawalRequest.ts | 2 +- packages/types/src/electra/sszTypes.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/beacon-node/src/execution/engine/payloadIdCache.ts b/packages/beacon-node/src/execution/engine/payloadIdCache.ts index f79c2858245..35a50e97cfb 100644 --- a/packages/beacon-node/src/execution/engine/payloadIdCache.ts +++ b/packages/beacon-node/src/execution/engine/payloadIdCache.ts @@ -28,7 +28,7 @@ export type DepositRequestV1 = { export type ExecutionLayerWithdrawalRequestV1 = { sourceAddress: DATA; - validatorPubkey: DATA; + validatorPublicKey: DATA; amount: QUANTITY; }; diff --git a/packages/beacon-node/src/execution/engine/types.ts b/packages/beacon-node/src/execution/engine/types.ts index 2c346035423..ead8005df2f 100644 --- a/packages/beacon-node/src/execution/engine/types.ts +++ b/packages/beacon-node/src/execution/engine/types.ts @@ -419,7 +419,7 @@ export function serializeExecutionLayerWithdrawalRequest( ): ExecutionLayerWithdrawalRequestRpc { return { sourceAddress: bytesToData(withdrawalRequest.sourceAddress), - validatorPubkey: bytesToData(withdrawalRequest.validatorPubkey), + validatorPublicKey: bytesToData(withdrawalRequest.validatorPublicKey), amount: numToQuantity(withdrawalRequest.amount), }; } @@ -429,7 +429,7 @@ export function deserializeExecutionLayerWithdrawalRequest( ): electra.ExecutionLayerWithdrawalRequest { return { sourceAddress: dataToBytes(withdrawalRequest.sourceAddress, 20), - validatorPubkey: dataToBytes(withdrawalRequest.validatorPubkey, 48), + validatorPublicKey: 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 e02129a09d0..935acd522da 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.validatorPubkey); + const validatorIndex = pubkey2index.get(executionLayerWithdrawalRequest.validatorPublicKey); if (validatorIndex === undefined) { return; } diff --git a/packages/types/src/electra/sszTypes.ts b/packages/types/src/electra/sszTypes.ts index 0aa2872c3a7..3596bdbce5b 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, - validatorPubkey: BLSPubkey, + validatorPublicKey: BLSPubkey, amount: UintNum64, }, {typeName: "ExecutionLayerWithdrawalRequest", jsonCase: "eth2"}