Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update withdrawal request container to match consensus spec #6797

Merged
merged 1 commit into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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),
validatorPublicKey: bytesToData(withdrawalRequest.validatorPublicKey),
validatorPublicKey: bytesToData(withdrawalRequest.validatorPubkey),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a inconsistency in the execution apis, right now all EL clients besides Besu use validatorPublicKey, this means pairing with Besu will not work right now if execution layer withdrawals requests are submitted to the network.

For now, we should just follow the spec

I opened a PR to potentially address this inconsistency

amount: numToQuantity(withdrawalRequest.amount),
};
}
Expand All @@ -429,7 +429,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),
};
}
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.validatorPublicKey);
const validatorIndex = pubkey2index.get(executionLayerWithdrawalRequest.validatorPubkey);
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,
validatorPublicKey: BLSPubkey,
validatorPubkey: BLSPubkey,
amount: UintNum64,
},
{typeName: "ExecutionLayerWithdrawalRequest", jsonCase: "eth2"}
Expand Down
Loading