Skip to content

Commit

Permalink
fix: update data format of WithdrawalRequestV1 (ChainSafe#6789)
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig authored and g11tech committed Jun 19, 2024
1 parent 0668076 commit f0dc964
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export type DepositRequestV1 = {

export type ExecutionLayerWithdrawalRequestV1 = {
sourceAddress: DATA;
validatorPubkey: DATA;
validatorPublicKey: DATA;
amount: QUANTITY;
};

Expand Down
4 changes: 2 additions & 2 deletions packages/beacon-node/src/execution/engine/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
};
}
Expand All @@ -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),
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/types/src/electra/sszTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down

0 comments on commit f0dc964

Please sign in to comment.