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
2 changes: 1 addition & 1 deletion rocketpool/api/megapool/challenge-performance.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func getChallengeSlotProof(
if err != nil {
return 0, megapool.SlotProof{}, fmt.Errorf("error getting beacon config: %w", err)
}
_, slotTimestamp, slotProof, err := services.GetValidatorProof(c, 0, w, eth2Config, megapoolAddress, pubkey, nil)
_, slotTimestamp, slotProof, err := services.GetValidatorProof(c, 0, w, eth2Config, pubkey, nil)
if err != nil {
return 0, megapool.SlotProof{}, fmt.Errorf("error building slot proof: %w", err)
}
Expand Down
4 changes: 2 additions & 2 deletions rocketpool/api/megapool/dissolve-with-proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func canDissolveWithProof(c *cli.Command, validatorId uint32) (*api.CanDissolveW
return nil, err
}

proof, slotTimestamp, slotProof, err := services.GetValidatorProof(c, 0, w, eth2Config, megapoolAddress, types.ValidatorPubkey(validatorInfo.Pubkey), nil)
proof, slotTimestamp, slotProof, err := services.GetValidatorProof(c, 0, w, eth2Config, types.ValidatorPubkey(validatorInfo.Pubkey), nil)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -163,7 +163,7 @@ func dissolveWithProof(c *cli.Command, validatorId uint32, t *snroute.TransactOp
return nil, err
}

validatorProof, slotTimestamp, slotProof, err := services.GetValidatorProof(c, 0, w, eth2Config, megapoolAddress, types.ValidatorPubkey(validatorInfo.Pubkey), nil)
validatorProof, slotTimestamp, slotProof, err := services.GetValidatorProof(c, 0, w, eth2Config, types.ValidatorPubkey(validatorInfo.Pubkey), nil)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions rocketpool/api/megapool/notify-validator-exit.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func canNotifyValidatorExit(c *cli.Command, validatorId uint32) (*api.CanNotifyV
return nil, err
}

proof, slotTimestamp, slotProof, err := services.GetValidatorProof(c, 0, w, eth2Config, megapoolAddress, pubkey, beaconState)
proof, slotTimestamp, slotProof, err := services.GetValidatorProof(c, 0, w, eth2Config, pubkey, beaconState)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -207,7 +207,7 @@ func notifyValidatorExit(c *cli.Command, validatorId uint32, t *snroute.Transact
return nil, err
}

validatorProof, slotTimetamp, slotProof, err := services.GetValidatorProof(c, 0, w, eth2Config, megapoolAddress, pubkey, beaconState)
validatorProof, slotTimetamp, slotProof, err := services.GetValidatorProof(c, 0, w, eth2Config, pubkey, beaconState)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions rocketpool/api/megapool/stake.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func canStake(c *cli.Command, validatorId uint64) (*api.CanStakeResponse, error)
return nil, err
}

validatorProof, slotTimestamp, slotProof, err := services.GetValidatorProof(c, 0, w, eth2Config, megapoolAddress, types.ValidatorPubkey(validatorInfo.Pubkey), nil)
validatorProof, slotTimestamp, slotProof, err := services.GetValidatorProof(c, 0, w, eth2Config, types.ValidatorPubkey(validatorInfo.Pubkey), nil)
if err != nil {
if strings.Contains(err.Error(), "index not found") {
response.CanStake = false
Expand Down Expand Up @@ -167,7 +167,7 @@ func stake(c *cli.Command, validatorId uint64, t *snroute.TransactOpts) (*api.St
return nil, err
}

validatorProof, slotTimestamp, slotProof, err := services.GetValidatorProof(c, 0, w, eth2Config, megapoolAddress, types.ValidatorPubkey(validatorInfo.Pubkey), nil)
validatorProof, slotTimestamp, slotProof, err := services.GetValidatorProof(c, 0, w, eth2Config, types.ValidatorPubkey(validatorInfo.Pubkey), nil)
if err != nil {
return nil, err
}
Expand Down
3 changes: 1 addition & 2 deletions rocketpool/node/check-minipool-exit-requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,7 @@ func (t *checkMinipoolExitRequests) proveDidNotExit(beaconState eth2.BeaconState

t.log.Printlnf("[STARTED] Crafting a did-not-exit proof. This process can take several seconds and is CPU and memory intensive. If you don't see a [FINISHED] log entry your system may not have enough resources to perform this operation.")

// The megapool proof structs are generic SSZ proofs; the address parameter is unused by GetValidatorProof
validatorProof, slotTimestamp, slotProof, err := services.GetValidatorProof(t.c, 0, t.w, state.BeaconConfig, common.Address{}, validator.pubkey, beaconState)
validatorProof, slotTimestamp, slotProof, err := services.GetValidatorProof(t.c, 0, t.w, state.BeaconConfig, validator.pubkey, beaconState)
if err != nil {
t.log.Printlnf("[ERROR] There was an error during the proof creation process: %s", err.Error())
return err
Expand Down
2 changes: 1 addition & 1 deletion rocketpool/node/defend-challenge-exit.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func (t *defendChallengeExit) defendChallenge(rp *rocketpool.RocketPool, mp mega

t.log.Printlnf("Crafting a validator proof.")

validatorProof, slotTimestamp, slotProof, err := services.GetValidatorProof(t.c, 0, t.w, state.BeaconConfig, mp.GetAddress(), validatorPubkey, nil)
validatorProof, slotTimestamp, slotProof, err := services.GetValidatorProof(t.c, 0, t.w, state.BeaconConfig, validatorPubkey, nil)
if err != nil {
t.log.Printlnf("[ERROR] There was an error during the proof creation process: %w", err)
return err
Expand Down
2 changes: 1 addition & 1 deletion rocketpool/node/defend-challenge-performance.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ func (t *defendChallengePerformance) respondWithValidator(challenge megapoolPerf

// Build a fresh validator proof against the head state to satisfy the
// contract's slot recency requirement
validatorProof, slotTimestamp, slotProof, err := services.GetValidatorProof(t.c, 0, t.w, state.BeaconConfig, challenge.megapoolAddress, defender.pubkey, nil)
validatorProof, slotTimestamp, slotProof, err := services.GetValidatorProof(t.c, 0, t.w, state.BeaconConfig, defender.pubkey, nil)
if err != nil {
return fmt.Errorf("error creating the validator proof: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion rocketpool/node/notify-validator-exit.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ func (t *notifyValidatorExit) createExitProof(rp *rocketpool.RocketPool, beaconS

t.log.Printlnf("Crafting an exit proof.")

validatorProof, slotTimestamp, slotProof, err := services.GetValidatorProof(t.c, 0, t.w, state.BeaconConfig, mp.GetAddress(), validatorPubkey, beaconState)
validatorProof, slotTimestamp, slotProof, err := services.GetValidatorProof(t.c, 0, t.w, state.BeaconConfig, validatorPubkey, beaconState)
if err != nil {
t.log.Printlnf("[ERROR] There was an error during the proof creation process: %w", err)
return err
Expand Down
2 changes: 1 addition & 1 deletion rocketpool/node/stake-megapool-validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func (t *stakeMegapoolValidator) stakeValidator(rp *rocketpool.RocketPool, beaco

t.log.Printlnf("Crafting a proof that the correct credentials were used on the first beacon chain deposit. This process can take several seconds and is CPU and memory intensive.")

validatorProof, slotTimestamp, slotProof, err := services.GetValidatorProof(t.c, 0, t.w, state.BeaconConfig, mp.GetAddress(), validatorPubkey, beaconState)
validatorProof, slotTimestamp, slotProof, err := services.GetValidatorProof(t.c, 0, t.w, state.BeaconConfig, validatorPubkey, beaconState)
if err != nil {
t.log.Printlnf("There was an error during the proof creation process: %w", err)
return err
Expand Down
2 changes: 1 addition & 1 deletion rocketpool/watchtower/dissolve-invalid-credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func (t *dissolveInvalidCredentials) dissolveMegapoolValidator(validator megapoo
return
}

validatorProof, slotTimestamp, slotProof, err := services.GetValidatorProof(t.c, 0, t.w, eth2Config, validator.MegapoolAddress, types.ValidatorPubkey(validator.Pubkey), nil)
validatorProof, slotTimestamp, slotProof, err := services.GetValidatorProof(t.c, 0, t.w, eth2Config, types.ValidatorPubkey(validator.Pubkey), nil)
if err != nil {
t.log.Printlnf("error getting validator proof: %v", err)
return
Expand Down
6 changes: 3 additions & 3 deletions shared/services/megapools.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ type WithdrawalProofResponse struct {
Witnesses []common.Hash `json:"witnesses"`
}

func GetValidatorProof(c *cli.Command, slot uint64, wallet wallet.Wallet, eth2Config beacon.Eth2Config, megapoolAddress common.Address, validatorPubkey types.ValidatorPubkey, beaconState eth2.BeaconState) (megapool.ValidatorProof, uint64, megapool.SlotProof, error) {
func GetValidatorProof(c *cli.Command, slot uint64, wallet wallet.Wallet, eth2Config beacon.Eth2Config, validatorPubkey types.ValidatorPubkey, beaconState eth2.BeaconState) (megapool.ValidatorProof, uint64, megapool.SlotProof, error) {

bc, err := GetBeaconClient(c)
if err != nil {
Expand Down Expand Up @@ -1212,7 +1212,7 @@ func getPreGloasFinalBalanceProofs(c *cli.Command, slotHint uint64, validatorInd
stateUsed = nil
}

validatorProof, slotTimestamp, slotProof, err := GetValidatorProof(c, proofSlot, w, eth2Config, megapoolAddress, validatorPubkey, stateUsed)
validatorProof, slotTimestamp, slotProof, err := GetValidatorProof(c, proofSlot, w, eth2Config, validatorPubkey, stateUsed)
if err != nil {
return megapool.WithdrawalProof{}, megapool.ValidatorProof{}, megapool.SlotProof{}, 0, err
}
Expand Down Expand Up @@ -1339,7 +1339,7 @@ func getGloasFinalBalanceProofBundle(c *cli.Command, bc beacon.Client, eth2Confi
return nil, nil, 0, err
}

validatorProof, slotTimestamp, slotProof, err := GetValidatorProof(c, finalizedSlot, w, eth2Config, megapoolAddress, validatorPubkey, proofState)
validatorProof, slotTimestamp, slotProof, err := GetValidatorProof(c, finalizedSlot, w, eth2Config, validatorPubkey, proofState)
if err != nil {
return nil, nil, 0, err
}
Expand Down
Loading