Skip to content
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
3 changes: 0 additions & 3 deletions bindings/megapool/proof-bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ type FinalBalanceProofBundleV2 struct {
ValidatorProof ValidatorProof `json:"validatorProof"`
SlotProof SlotProof `json:"slotProof"`
PreviousNextWithdrawalIndexProof NextWithdrawalIndexProof `json:"previousNextWithdrawalIndexProof"`
ValidatorBalanceProof ValidatorBalanceProof `json:"validatorBalanceProof"`
}

// UsesProofBundles selects the transaction format from the deployed manager version.
Expand Down Expand Up @@ -158,7 +157,6 @@ func EncodeFinalBalanceProofBundleV2(
validatorProof ValidatorProof,
slotProof SlotProof,
previousNextWithdrawalIndexProof NextWithdrawalIndexProof,
validatorBalanceProof ValidatorBalanceProof,
) ([]byte, error) {
return encodeTuple([]abi.ArgumentMarshaling{
{Name: "withdrawalProof", Type: "tuple", Components: withdrawalProofComponents},
Expand All @@ -171,7 +169,6 @@ func EncodeFinalBalanceProofBundleV2(
ValidatorProof: validatorProof,
SlotProof: slotProof,
PreviousNextWithdrawalIndexProof: previousNextWithdrawalIndexProof,
ValidatorBalanceProof: validatorBalanceProof,
})
}

Expand Down
4 changes: 0 additions & 4 deletions bindings/megapool/proof-bundle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ func TestEncodeFinalBalanceProofBundleV2(t *testing.T) {
NextWithdrawalIndex: 9,
Witnesses: [][32]byte{{0x66}},
},
ValidatorBalanceProof{
BalanceChunk: [32]byte{0x77},
Witnesses: [][32]byte{{0x88}},
},
)
if err != nil {
t.Fatalf("encode: %v", err)
Expand Down
11 changes: 0 additions & 11 deletions shared/services/megapools.go
Original file line number Diff line number Diff line change
Expand Up @@ -1282,13 +1282,6 @@ func getGloasFinalBalanceProofBundle(bc beacon.Client, ec withdrawalExecutionCli
if err != nil {
return nil, nil, err
}
balanceLeafProof, balanceChunk, err := gloasWithdrawalState.ProveValidatorBalanceChunk(validatorIndex)
if err != nil {
return nil, nil, err
}
if !gloas.IsZeroValidatorBalance(balanceChunk, validatorIndex) {
return nil, nil, fmt.Errorf("validator %d balance chunk is not zero at withdrawal slot %d", validatorIndex, withdrawalSlot)
}

previousSlot := withdrawalSlot - 1
nextWithdrawalIndex, nextWithdrawalIndexLeafProof, err := proveNextWithdrawalIndex(previousState)
Expand Down Expand Up @@ -1344,10 +1337,6 @@ func getGloasFinalBalanceProofBundle(bc beacon.Client, ec withdrawalExecutionCli
NextWithdrawalIndex: nextWithdrawalIndex,
Witnesses: ConvertToFixedSize(concatProofs(nextWithdrawalIndexLeafProof, previousPastRoot, blockHeaderProof)),
},
megapool.ValidatorBalanceProof{
BalanceChunk: balanceChunk,
Witnesses: ConvertToFixedSize(concatProofs(balanceLeafProof, withdrawalPastRoot, blockHeaderProof)),
},
)
if err != nil {
return nil, nil, err
Expand Down
32 changes: 0 additions & 32 deletions shared/types/eth2/fork/gloas/gloas_proofs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,38 +405,6 @@ func TestProveNextWithdrawalIndex(t *testing.T) {
}
}

func TestProveValidatorBalanceChunk(t *testing.T) {
state := minimalBeaconState()
state.Balances = []uint64{1, 0, 3, 4, 5}

_, chunk, err := state.ProveValidatorBalanceChunk(1)
if err != nil {
t.Fatalf("ProveValidatorBalanceChunk: %v", err)
}
if !IsZeroValidatorBalance(chunk, 1) {
t.Fatal("expected validator 1 lane to be zero")
}
if IsZeroValidatorBalance(chunk, 0) {
t.Fatal("expected validator 0 lane to be non-zero")
}

stateTree, err := generic.SSZ.GetTree(state)
if err != nil {
t.Fatalf("GetTree: %v", err)
}
direct, err := stateTree.Prove(int(GetGeneralizedIndexForBalanceChunk(1)))
if err != nil {
t.Fatalf("direct Prove: %v", err)
}
if ok, err := treeproof.VerifyProof(stateTree.Hash(), direct); err != nil || !ok {
t.Fatalf("verify balance chunk: ok=%v err=%v", ok, err)
}

if _, _, err := state.ProveValidatorBalanceChunk(uint64(len(state.Balances))); err == nil {
t.Fatal("expected out-of-bounds error")
}
}

func TestHistoricalBoundarySplit(t *testing.T) {
const w uint64 = 100
proofSlot := w + generic.SlotsPerHistoricalRoot
Expand Down
Loading