From 87e4da0ea2503553da63ec9a60f7f6ed00c4ddb7 Mon Sep 17 00:00:00 2001 From: rkapka Date: Thu, 30 Jan 2025 20:56:11 +0100 Subject: [PATCH] rename `index` to `validator_index` in `PendingPartialWithdrawal` --- api/server/structs/conversions.go | 2 +- api/server/structs/other.go | 2 +- beacon-chain/core/blocks/exit_test.go | 4 +- beacon-chain/core/blocks/withdrawals_test.go | 4 +- .../core/electra/consolidations_test.go | 4 +- beacon-chain/core/electra/withdrawals.go | 2 +- beacon-chain/core/electra/withdrawals_test.go | 16 ++-- .../state/state-native/getters_validator.go | 4 +- .../state-native/getters_validator_test.go | 12 +-- .../state/state-native/getters_withdrawal.go | 10 +-- .../state-native/getters_withdrawal_test.go | 4 +- proto/prysm/v1alpha1/eip_7251.pb.go | 85 ++++++++++--------- proto/prysm/v1alpha1/eip_7251.proto | 2 +- proto/prysm/v1alpha1/eip_7521.go | 2 +- proto/prysm/v1alpha1/electra.ssz.go | 12 +-- 15 files changed, 83 insertions(+), 82 deletions(-) diff --git a/api/server/structs/conversions.go b/api/server/structs/conversions.go index 25db9676a8..bb06521dcc 100644 --- a/api/server/structs/conversions.go +++ b/api/server/structs/conversions.go @@ -1532,7 +1532,7 @@ func PendingPartialWithdrawalsFromConsensus(ws []*eth.PendingPartialWithdrawal) withdrawals := make([]*PendingPartialWithdrawal, len(ws)) for i, w := range ws { withdrawals[i] = &PendingPartialWithdrawal{ - Index: fmt.Sprintf("%d", w.Index), + ValidatorIndex: fmt.Sprintf("%d", w.ValidatorIndex), Amount: fmt.Sprintf("%d", w.Amount), WithdrawableEpoch: fmt.Sprintf("%d", w.WithdrawableEpoch), } diff --git a/api/server/structs/other.go b/api/server/structs/other.go index ef5a00c56f..d30dc14b96 100644 --- a/api/server/structs/other.go +++ b/api/server/structs/other.go @@ -273,7 +273,7 @@ type PendingDeposit struct { } type PendingPartialWithdrawal struct { - Index string `json:"index"` + ValidatorIndex string `json:"validator_index"` Amount string `json:"amount"` WithdrawableEpoch string `json:"withdrawable_epoch"` } diff --git a/beacon-chain/core/blocks/exit_test.go b/beacon-chain/core/blocks/exit_test.go index bda5f7ef81..9d4213e23c 100644 --- a/beacon-chain/core/blocks/exit_test.go +++ b/beacon-chain/core/blocks/exit_test.go @@ -318,8 +318,8 @@ func TestVerifyExitAndSignature(t *testing.T) { // Give validator a pending balance to withdraw. require.NoError(t, bs.AppendPendingPartialWithdrawal(ðpb.PendingPartialWithdrawal{ - Index: 0, - Amount: 500, + ValidatorIndex: 0, + Amount: 500, })) return validator, signedExit, bs, nil diff --git a/beacon-chain/core/blocks/withdrawals_test.go b/beacon-chain/core/blocks/withdrawals_test.go index 9a6f290d75..61e2d6a4a3 100644 --- a/beacon-chain/core/blocks/withdrawals_test.go +++ b/beacon-chain/core/blocks/withdrawals_test.go @@ -898,8 +898,8 @@ func TestProcessWithdrawals(t *testing.T) { }, PendingPartialWithdrawals: []*ethpb.PendingPartialWithdrawal{ { - Index: 11, - Amount: withdrawalAmount(11) - maxEffectiveBalance, + ValidatorIndex: 11, + Amount: withdrawalAmount(11) - maxEffectiveBalance, }, }, }, diff --git a/beacon-chain/core/electra/consolidations_test.go b/beacon-chain/core/electra/consolidations_test.go index 09db720b04..afd18030d6 100644 --- a/beacon-chain/core/electra/consolidations_test.go +++ b/beacon-chain/core/electra/consolidations_test.go @@ -226,8 +226,8 @@ func TestProcessConsolidationRequests(t *testing.T) { st.Validators[16].ExitEpoch = 10 st.PendingPartialWithdrawals = []*eth.PendingPartialWithdrawal{ { - Index: 17, - Amount: 100, + ValidatorIndex: 17, + Amount: 100, }, } s, err := state_native.InitializeFromProtoElectra(st) diff --git a/beacon-chain/core/electra/withdrawals.go b/beacon-chain/core/electra/withdrawals.go index 62156188cc..be5846c3c0 100644 --- a/beacon-chain/core/electra/withdrawals.go +++ b/beacon-chain/core/electra/withdrawals.go @@ -184,7 +184,7 @@ func ProcessWithdrawalRequests(ctx context.Context, st state.BeaconState, wrs [] return nil, errors.Wrap(err, "failed to add withdrawability delay to exit queue epoch") } if err := st.AppendPendingPartialWithdrawal(ðpb.PendingPartialWithdrawal{ - Index: vIdx, + ValidatorIndex: vIdx, Amount: toWithdraw, WithdrawableEpoch: withdrawableEpoch, }); err != nil { diff --git a/beacon-chain/core/electra/withdrawals_test.go b/beacon-chain/core/electra/withdrawals_test.go index da00cdd9cb..cdc2680789 100644 --- a/beacon-chain/core/electra/withdrawals_test.go +++ b/beacon-chain/core/electra/withdrawals_test.go @@ -44,7 +44,7 @@ func TestProcessWithdrawRequests(t *testing.T) { st: func() state.BeaconState { preSt := st.Copy() require.NoError(t, preSt.AppendPendingPartialWithdrawal(ð.PendingPartialWithdrawal{ - Index: 0, + ValidatorIndex: 0, Amount: params.BeaconConfig().FullExitRequestAmount, WithdrawableEpoch: 0, })) @@ -75,7 +75,7 @@ func TestProcessWithdrawRequests(t *testing.T) { v.WithdrawableEpoch = 517 require.NoError(t, wantPostSt.SetValidators([]*eth.Validator{v})) require.NoError(t, wantPostSt.AppendPendingPartialWithdrawal(ð.PendingPartialWithdrawal{ - Index: 0, + ValidatorIndex: 0, Amount: params.BeaconConfig().FullExitRequestAmount, WithdrawableEpoch: 0, })) @@ -99,7 +99,7 @@ func TestProcessWithdrawRequests(t *testing.T) { st: func() state.BeaconState { preSt := st.Copy() require.NoError(t, preSt.AppendPendingPartialWithdrawal(ð.PendingPartialWithdrawal{ - Index: 0, + ValidatorIndex: 0, Amount: params.BeaconConfig().FullExitRequestAmount, WithdrawableEpoch: 0, })) @@ -111,7 +111,7 @@ func TestProcessWithdrawRequests(t *testing.T) { require.NoError(t, preSt.SetValidators([]*eth.Validator{v})) require.NoError(t, preSt.SetBalances([]uint64{params.BeaconConfig().MinActivationBalance + 200})) require.NoError(t, preSt.AppendPendingPartialWithdrawal(ð.PendingPartialWithdrawal{ - Index: 0, + ValidatorIndex: 0, Amount: 100, WithdrawableEpoch: 0, })) @@ -138,17 +138,17 @@ func TestProcessWithdrawRequests(t *testing.T) { bal += 200 require.NoError(t, wantPostSt.SetBalances([]uint64{bal})) require.NoError(t, wantPostSt.AppendPendingPartialWithdrawal(ð.PendingPartialWithdrawal{ - Index: 0, + ValidatorIndex: 0, Amount: 0, WithdrawableEpoch: 0, })) require.NoError(t, wantPostSt.AppendPendingPartialWithdrawal(ð.PendingPartialWithdrawal{ - Index: 0, + ValidatorIndex: 0, Amount: 100, WithdrawableEpoch: 0, })) require.NoError(t, wantPostSt.AppendPendingPartialWithdrawal(ð.PendingPartialWithdrawal{ - Index: 0, + ValidatorIndex: 0, Amount: 100, WithdrawableEpoch: 517, })) @@ -255,7 +255,7 @@ func TestProcessWithdrawRequests(t *testing.T) { logrus.SetLevel(logrus.DebugLevel) preSt := st.Copy() require.NoError(t, preSt.AppendPendingPartialWithdrawal(ð.PendingPartialWithdrawal{ - Index: 0, + ValidatorIndex: 0, Amount: params.BeaconConfig().FullExitRequestAmount, WithdrawableEpoch: 0, })) diff --git a/beacon-chain/state/state-native/getters_validator.go b/beacon-chain/state/state-native/getters_validator.go index dc874bf16c..8e0c0b9108 100644 --- a/beacon-chain/state/state-native/getters_validator.go +++ b/beacon-chain/state/state-native/getters_validator.go @@ -466,7 +466,7 @@ func (b *BeaconState) PendingBalanceToWithdraw(idx primitives.ValidatorIndex) (u // lookup map could be used to reduce the complexity marginally. var sum uint64 for _, w := range b.pendingPartialWithdrawals { - if w.Index == idx { + if w.ValidatorIndex == idx { sum += w.Amount } } @@ -486,7 +486,7 @@ func (b *BeaconState) HasPendingBalanceToWithdraw(idx primitives.ValidatorIndex) // MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD per slot. A more optimized storage indexing such as a // lookup map could be used to reduce the complexity marginally. for _, w := range b.pendingPartialWithdrawals { - if w.Index == idx { + if w.ValidatorIndex == idx { return true, nil } } diff --git a/beacon-chain/state/state-native/getters_validator_test.go b/beacon-chain/state/state-native/getters_validator_test.go index 0a9cce5720..d3804abca3 100644 --- a/beacon-chain/state/state-native/getters_validator_test.go +++ b/beacon-chain/state/state-native/getters_validator_test.go @@ -110,16 +110,16 @@ func TestHasPendingBalanceToWithdraw(t *testing.T) { pb := ðpb.BeaconStateElectra{ PendingPartialWithdrawals: []*ethpb.PendingPartialWithdrawal{ { - Amount: 100, - Index: 1, + Amount: 100, + ValidatorIndex: 1, }, { - Amount: 200, - Index: 2, + Amount: 200, + ValidatorIndex: 2, }, { - Amount: 300, - Index: 3, + Amount: 300, + ValidatorIndex: 3, }, }, } diff --git a/beacon-chain/state/state-native/getters_withdrawal.go b/beacon-chain/state/state-native/getters_withdrawal.go index 2c53c1c399..8f5af4919d 100644 --- a/beacon-chain/state/state-native/getters_withdrawal.go +++ b/beacon-chain/state/state-native/getters_withdrawal.go @@ -123,13 +123,13 @@ func (b *BeaconState) ExpectedWithdrawals() ([]*enginev1.Withdrawal, uint64, err break } - v, err := b.validatorAtIndexReadOnly(w.Index) + v, err := b.validatorAtIndexReadOnly(w.ValidatorIndex) if err != nil { - return nil, 0, fmt.Errorf("failed to determine withdrawals at index %d: %w", w.Index, err) + return nil, 0, fmt.Errorf("failed to determine withdrawals at index %d: %w", w.ValidatorIndex, err) } - vBal, err := b.balanceAtIndex(w.Index) + vBal, err := b.balanceAtIndex(w.ValidatorIndex) if err != nil { - return nil, 0, fmt.Errorf("could not retrieve balance at index %d: %w", w.Index, err) + return nil, 0, fmt.Errorf("could not retrieve balance at index %d: %w", w.ValidatorIndex, err) } hasSufficientEffectiveBalance := v.EffectiveBalance() >= params.BeaconConfig().MinActivationBalance hasExcessBalance := vBal > params.BeaconConfig().MinActivationBalance @@ -137,7 +137,7 @@ func (b *BeaconState) ExpectedWithdrawals() ([]*enginev1.Withdrawal, uint64, err amount := min(vBal-params.BeaconConfig().MinActivationBalance, w.Amount) withdrawals = append(withdrawals, &enginev1.Withdrawal{ Index: withdrawalIndex, - ValidatorIndex: w.Index, + ValidatorIndex: w.ValidatorIndex, Address: v.GetWithdrawalCredentials()[12:], Amount: amount, }) diff --git a/beacon-chain/state/state-native/getters_withdrawal_test.go b/beacon-chain/state/state-native/getters_withdrawal_test.go index 1fc8f188a7..1a79e16629 100644 --- a/beacon-chain/state/state-native/getters_withdrawal_test.go +++ b/beacon-chain/state/state-native/getters_withdrawal_test.go @@ -362,7 +362,7 @@ func TestExpectedWithdrawals(t *testing.T) { require.NoError(t, err) p, err := s.PendingPartialWithdrawals() require.NoError(t, err) - require.NoError(t, s.UpdateBalancesAtIndex(p[0].Index, 0)) // This should still count as partial withdrawal. + require.NoError(t, s.UpdateBalancesAtIndex(p[0].ValidatorIndex, 0)) // This should still count as partial withdrawal. _, partialWithdrawalsCount, err := s.ExpectedWithdrawals() require.NoError(t, err) require.Equal(t, uint64(10), partialWithdrawalsCount) @@ -389,7 +389,7 @@ func TestExpectedWithdrawals(t *testing.T) { require.NoError(t, s.SetBalances(balances)) // Give validator a pending balance to withdraw. require.NoError(t, s.AppendPendingPartialWithdrawal(ðpb.PendingPartialWithdrawal{ - Index: 1, + ValidatorIndex: 1, Amount: balances[1], // will only deduct excess even though balance is more that minimum activation WithdrawableEpoch: primitives.Epoch(0), })) diff --git a/proto/prysm/v1alpha1/eip_7251.pb.go b/proto/prysm/v1alpha1/eip_7251.pb.go index fa98c3d007..ec64cbc1fa 100755 --- a/proto/prysm/v1alpha1/eip_7251.pb.go +++ b/proto/prysm/v1alpha1/eip_7251.pb.go @@ -107,7 +107,7 @@ type PendingPartialWithdrawal struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Index github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"` + ValidatorIndex github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex `protobuf:"varint,1,opt,name=validator_index,json=validatorIndex,proto3" json:"validator_index,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.ValidatorIndex"` Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` WithdrawableEpoch github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Epoch `protobuf:"varint,3,opt,name=withdrawable_epoch,json=withdrawableEpoch,proto3" json:"withdrawable_epoch,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Epoch"` } @@ -144,9 +144,9 @@ func (*PendingPartialWithdrawal) Descriptor() ([]byte, []int) { return file_proto_prysm_v1alpha1_eip_7251_proto_rawDescGZIP(), []int{1} } -func (x *PendingPartialWithdrawal) GetIndex() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex { +func (x *PendingPartialWithdrawal) GetValidatorIndex() github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex { if x != nil { - return x.Index + return x.ValidatorIndex } return github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(0) } @@ -246,50 +246,51 @@ var file_proto_prysm_v1alpha1_eip_7251_proto_rawDesc = []byte{ 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74, 0x52, - 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x22, 0x90, 0x02, 0x0a, 0x18, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, + 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x22, 0xa3, 0x02, 0x0a, 0x18, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, - 0x61, 0x6c, 0x12, 0x65, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, - 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, - 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, - 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, - 0x74, 0x12, 0x75, 0x0a, 0x12, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x62, 0x6c, - 0x65, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, - 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, - 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, - 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, - 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x11, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, - 0x62, 0x6c, 0x65, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x22, 0xfe, 0x01, 0x0a, 0x14, 0x50, 0x65, 0x6e, - 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x72, 0x0a, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, - 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, - 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, - 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, - 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x72, 0x0a, 0x0c, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, + 0x61, 0x6c, 0x12, 0x78, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, + 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0b, 0x74, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x42, 0x97, 0x01, 0x0a, 0x19, 0x6f, 0x72, - 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0c, 0x45, 0x49, 0x50, 0x37, 0x32, 0x35, 0x31, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, - 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, - 0x65, 0x74, 0x68, 0xaa, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15, 0x45, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0e, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x16, 0x0a, 0x06, + 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x75, 0x0a, 0x12, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, + 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, + 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, + 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, + 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, + 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x11, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, + 0x61, 0x77, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x22, 0xfe, 0x01, 0x0a, 0x14, + 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x72, 0x0a, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, + 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, + 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0b, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x72, 0x0a, 0x0c, 0x74, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, + 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, + 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, + 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, + 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x42, 0x97, 0x01, 0x0a, + 0x19, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0c, 0x45, 0x49, 0x50, 0x37, + 0x32, 0x35, 0x31, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, + 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, + 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, + 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/prysm/v1alpha1/eip_7251.proto b/proto/prysm/v1alpha1/eip_7251.proto index 768be978e9..083e7766ec 100644 --- a/proto/prysm/v1alpha1/eip_7251.proto +++ b/proto/prysm/v1alpha1/eip_7251.proto @@ -46,7 +46,7 @@ message PendingDeposit { message PendingPartialWithdrawal { // Validator index for the withdrawal. - uint64 index = 1 [ (ethereum.eth.ext.cast_type) = + uint64 validator_index = 1 [ (ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v5/consensus-types/" "primitives.ValidatorIndex" ]; diff --git a/proto/prysm/v1alpha1/eip_7521.go b/proto/prysm/v1alpha1/eip_7521.go index 92c9453f3f..27d1e639b0 100644 --- a/proto/prysm/v1alpha1/eip_7521.go +++ b/proto/prysm/v1alpha1/eip_7521.go @@ -22,7 +22,7 @@ func (pw *PendingPartialWithdrawal) Copy() *PendingPartialWithdrawal { return nil } return &PendingPartialWithdrawal{ - Index: pw.Index, + ValidatorIndex: pw.ValidatorIndex, Amount: pw.Amount, WithdrawableEpoch: pw.WithdrawableEpoch, } diff --git a/proto/prysm/v1alpha1/electra.ssz.go b/proto/prysm/v1alpha1/electra.ssz.go index 1fb5892f8f..9e7e9c1646 100644 --- a/proto/prysm/v1alpha1/electra.ssz.go +++ b/proto/prysm/v1alpha1/electra.ssz.go @@ -4636,8 +4636,8 @@ func (p *PendingPartialWithdrawal) MarshalSSZ() ([]byte, error) { func (p *PendingPartialWithdrawal) MarshalSSZTo(buf []byte) (dst []byte, err error) { dst = buf - // Field (0) 'Index' - dst = ssz.MarshalUint64(dst, uint64(p.Index)) + // Field (0) 'ValidatorIndex' + dst = ssz.MarshalUint64(dst, uint64(p.ValidatorIndex)) // Field (1) 'Amount' dst = ssz.MarshalUint64(dst, p.Amount) @@ -4656,8 +4656,8 @@ func (p *PendingPartialWithdrawal) UnmarshalSSZ(buf []byte) error { return ssz.ErrSize } - // Field (0) 'Index' - p.Index = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) + // Field (0) 'ValidatorIndex' + p.ValidatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8])) // Field (1) 'Amount' p.Amount = ssz.UnmarshallUint64(buf[8:16]) @@ -4683,8 +4683,8 @@ func (p *PendingPartialWithdrawal) HashTreeRoot() ([32]byte, error) { func (p *PendingPartialWithdrawal) HashTreeRootWith(hh *ssz.Hasher) (err error) { indx := hh.Index() - // Field (0) 'Index' - hh.PutUint64(uint64(p.Index)) + // Field (0) 'ValidatorIndex' + hh.PutUint64(uint64(p.ValidatorIndex)) // Field (1) 'Amount' hh.PutUint64(p.Amount)