Skip to content

Commit

Permalink
remove excess logs
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrower95 committed Sep 19, 2024
1 parent c6b04c0 commit 1329855
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 21 deletions.
11 changes: 2 additions & 9 deletions cli/commands/computeCheckpointableValue.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,9 @@ func queryAllEigenpodsOnNetwork(args TQueryAllEigenpodsOnNetworkArgs) ([]string,
}
return success
})
fmt.Printf("podToOwner\n")
printAsJSON(podToPodOwner)
fmt.Printf("=============")

// array[eigenpods given the owner]
fmt.Printf("Querying %d addresses (podMan=%s) to see if it knows about these eigenpods\n", len(addressesWithPodOwners), args.PodManagerAddress)
fmt.Printf("Querying %d addresses on (EigenPodManager=%s) to see if it knows about these eigenpods\n", len(addressesWithPodOwners), args.PodManagerAddress)

eigenpodForOwner, err := multicall.DoMultiCallManyReportingFailures(
*args.Mc,
Expand Down Expand Up @@ -179,10 +176,6 @@ func ComputeCheckpointableValueCommand(args TComputeCheckpointableValueCommandAr
return allEigenpodSet
}, map[string]int{})

fmt.Printf("allEigenpods\n")
printAsJSON(allEigenpods)
fmt.Printf("==========\n")

fmt.Printf("%d eigenpods discovered on the network", len(allEigenpods))

// Compute all pending rewards for each eigenpod;
Expand All @@ -198,7 +191,7 @@ func ComputeCheckpointableValueCommand(args TComputeCheckpointableValueCommandAr
multicallAbiRef, err := abi.JSON(strings.NewReader(multicallAbi))
core.PanicOnError("failed to load multicall abi", err)

fmt.Printf("Loading address(EigenPod).balance....\n")
fmt.Printf("Loading Eigenpod ETH balances....\n")
podNativeEthBalances, err := multicall.DoMultiCallMany(
*mc,
utils.Map(allEigenpods, func(eigenpod string, index uint64) *multicall.MultiCallMetaData[*big.Int] {
Expand Down
16 changes: 5 additions & 11 deletions cli/core/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/Layr-Labs/eigenpod-proofs-generation/cli/core/onchain"
"github.com/attestantio/go-eth2-client/spec"
"github.com/attestantio/go-eth2-client/spec/phase0"
"github.com/ethereum/go-ethereum/common"
gethCommon "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/ethclient"
)
Expand Down Expand Up @@ -90,7 +89,7 @@ func GetStatus(ctx context.Context, eigenpodAddress string, eth *ethclient.Clien
validators := map[string]Validator{}
var activeCheckpoint *Checkpoint = nil

eigenPod, err := onchain.NewEigenPod(common.HexToAddress(eigenpodAddress), eth)
eigenPod, err := onchain.NewEigenPod(gethCommon.HexToAddress(eigenpodAddress), eth)
PanicOnError("failed to reach eigenpod", err)

checkpoint, err := eigenPod.CurrentCheckpoint(nil)
Expand All @@ -106,15 +105,15 @@ func GetStatus(ctx context.Context, eigenpodAddress string, eth *ethclient.Clien
allValidatorsWithInfoForEigenpod, err := FetchMultipleOnchainValidatorInfo(ctx, eth, eigenpodAddress, allValidatorsForEigenpod)
PanicOnError("failed to fetch validator info", err)

allBeaconBalances := getRegularBalancesGwei(state)
allBeaconBalancesGwei := getRegularBalancesGwei(state)

activeValidators, err := SelectActiveValidators(eth, eigenpodAddress, allValidatorsWithInfoForEigenpod)
PanicOnError("failed to find active validators", err)

checkpointableValidators, err := SelectCheckpointableValidators(eth, eigenpodAddress, allValidatorsWithInfoForEigenpod, checkpointTimestamp)
PanicOnError("failed to find checkpointable validators", err)

sumBeaconBalancesWei := IGweiToWei(sumValidatorBeaconBalancesGwei(activeValidators, allBeaconBalances))
sumBeaconBalancesWei := IGweiToWei(sumValidatorBeaconBalancesGwei(activeValidators, allBeaconBalancesGwei))
sumRestakedBalancesWei := IGweiToWei(sumRestakedBalancesGwei(activeValidators))

PanicOnError("failed to calculate sum of onchain validator balances", err)
Expand All @@ -129,7 +128,7 @@ func GetStatus(ctx context.Context, eigenpodAddress string, eth *ethclient.Clien
IsAwaitingActivationQueue: validator.Validator.ActivationEpoch == FAR_FUTURE_EPOCH,
IsAwaitingWithdrawalCredentialProof: IsAwaitingWithdrawalCredentialProof(validator.Info, validator.Validator),
EffectiveBalance: uint64(validator.Validator.EffectiveBalance),
CurrentBalance: uint64(allBeaconBalances[validator.Index]),
CurrentBalance: uint64(allBeaconBalancesGwei[validator.Index]),
}
}

Expand Down Expand Up @@ -178,7 +177,7 @@ func GetStatus(ctx context.Context, eigenpodAddress string, eth *ethclient.Clien
}
} else {
fmt.Printf("pod did not have a checkpoint\n")
latestPodBalanceWei, err := eth.BalanceAt(ctx, common.HexToAddress(eigenpodAddress), nil)
latestPodBalanceWei, err := eth.BalanceAt(ctx, gethCommon.HexToAddress(eigenpodAddress), nil)
PanicOnError("failed to fetch pod balance", err)

// We don't have a checkpoint currently, so we need to calculate what
Expand Down Expand Up @@ -215,11 +214,6 @@ func GetStatus(ctx context.Context, eigenpodAddress string, eth *ethclient.Clien
totalShareDeltaWei,
)

fmt.Printf("beaconETHDeltaETH: %s\n", GweiToEther(WeiToGwei(beaconETHDeltaWei)).String())
fmt.Printf("sumBeaconBalancesETH: %s\n", GweiToEther(WeiToGwei(sumBeaconBalancesWei)).String())
fmt.Printf("sumRestakedBalancesETH: %s\n", GweiToEther(WeiToGwei(sumRestakedBalancesWei)).String())
fmt.Printf("nativeETHDeltaETH: %s\n", GweiToEther(WeiToGwei(nativeETHDeltaWei)).String())

pendingEth := GweiToEther(WeiToGwei(pendingSharesWei))

return EigenpodStatus{
Expand Down
2 changes: 1 addition & 1 deletion cli/core/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ func FindAllValidatorsForEigenpod(eigenpodAddress string, beaconState *spec.Vers
// // first 12 bytes are not the pubKeyHash, see (https://github.com/Layr-Labs/eigenlayer-contracts/blob/d148952a2942a97a218a2ab70f9b9f1792796081/src/contracts/pods/EigenPod.sol#L663)
validatorWithdrawalAddress := common.BytesToAddress(validator.WithdrawalCredentials[12:])

if strings.EqualFold(eigenpod.Hex(), validatorWithdrawalAddress.Hex()) {
if eigenpod.Cmp(validatorWithdrawalAddress) == 0 {
outputValidators = append(outputValidators, ValidatorWithIndex{
Validator: validator,
Index: i,
Expand Down

0 comments on commit 1329855

Please sign in to comment.