Documentation ¶
Index ¶
- Constants
- Variables
- func AllZero(s []byte) bool
- func CastBalanceProofs(proofs []*eigenpodproofs.BalanceProof) []onchain.BeaconChainProofsBalanceProof
- func CastValidatorFields(proof [][]eigenpodproofs.Bytes32) [][][32]byte
- func ContextWithTracing(ctx context.Context, callbacks *TracerCallbacks) context.Context
- func FetchMultipleOnchainValidatorInfoMulticalls(eigenpodAddress string, allValidators []*phase0.Validator) ([]*multicall.MultiCallMetaData[*onchain.IEigenPodValidatorInfo], error)
- func FindStaleEigenpods(ctx context.Context, eth *ethclient.Client, nodeUrl string, ...) (map[string][]ValidatorWithIndex, error)
- func ForkVersions() map[uint64]string
- func FracMul(a *big.Int, x *big.Int, y *big.Int) *big.Int
- func GenerateCheckpointProof(ctx context.Context, eigenpodAddress string, eth *ethclient.Client, ...) (*eigenpodproofs.VerifyCheckpointProofsCallParams, error)
- func GenerateCheckpointProofForState(ctx context.Context, eigenpodAddress string, ...) (*eigenpodproofs.VerifyCheckpointProofsCallParams, error)
- func GenerateValidatorProof(ctx context.Context, eigenpodAddress string, eth *ethclient.Client, ...) (*eigenpodproofs.VerifyValidatorFieldsCallParams, uint64, error)
- func GenerateValidatorProofAtState(ctx context.Context, proofs *eigenpodproofs.EigenPodProofs, ...) (*eigenpodproofs.VerifyValidatorFieldsCallParams, error)
- func GetCheckpointTimestampAndBeaconState(ctx context.Context, eigenpodAddress string, eth *ethclient.Client, ...) (uint64, *spec.VersionedBeaconState, error)
- func GetCurrentCheckpoint(eigenpodAddress string, client *ethclient.Client) (uint64, error)
- func GetCurrentCheckpointBlockRoot(eigenpodAddress string, eth *ethclient.Client) (*[32]byte, error)
- func GweiToEther(val *big.Float) *big.Float
- func GweiToWei(val *big.Float) *big.Float
- func IGweiToWei(val *big.Int) *big.Int
- func IsAwaitingWithdrawalCredentialProof(validatorInfo onchain.IEigenPodValidatorInfo, validator *phase0.Validator) bool
- func IweiToEther(val *big.Int) *big.Float
- func LoadCheckpointProofFromFile(path string) (*eigenpodproofs.VerifyCheckpointProofsCallParams, error)
- func Panic(message string)
- func PanicIfNoConsent(prompt string)
- func PanicOnError(message string, err error)
- func PodManagerContracts() map[uint64]string
- func SortByStatus(validators map[string]Validator) ([]Validator, []Validator, []Validator, []Validator)
- func StartCheckpoint(ctx context.Context, eigenpodAddress string, ownerPrivateKey string, ...) (*types.Transaction, error)
- func StartCheckpointProofConsent() string
- func SubmitCheckpointProof(ctx context.Context, owner, eigenpodAddress string, chainId *big.Int, ...) ([]*types.Transaction, error)
- func SubmitCheckpointProofBatch(ctx context.Context, owner, eigenpodAddress string, chainId *big.Int, ...) (*types.Transaction, error)
- func SubmitCredentialsProofConsent(numTransactions int) string
- func SubmitValidatorProof(ctx context.Context, owner, eigenpodAddress string, chainId *big.Int, ...) ([]*types.Transaction, [][]*big.Int, error)
- func SubmitValidatorProofChunk(ctx context.Context, ownerAccount *Owner, eigenPod *onchain.EigenPod, ...) (*types.Transaction, error)
- func Uint64ArrayToBigIntArray(nums []uint64) []*big.Int
- func WeiToGwei(val *big.Int) *big.Float
- func WriteOutputToFileOrStdout(output []byte, out *string) error
- type BeaconClient
- func GetBeaconClient(beaconUri string, verbose bool) (BeaconClient, error)
- func GetClients(ctx context.Context, node, beaconNodeUri string, enableLogs bool) (*ethclient.Client, BeaconClient, *big.Int, error)
- func NewBeaconClient(endpoint string, verbose bool) (BeaconClient, context.CancelFunc, error)
- type Cache
- type Checkpoint
- type EigenpodStatus
- type Owner
- type PodOwnerShare
- type SerializableCredentialProof
- type TEigenKey
- type TracerCallbacks
- type Validator
- type ValidatorWithIndex
- type ValidatorWithOnchainInfo
- func FetchMultipleOnchainValidatorInfo(ctx context.Context, client *ethclient.Client, eigenpodAddress string, ...) ([]ValidatorWithOnchainInfo, error)
- func SelectActiveValidators(client *ethclient.Client, eigenpodAddress string, ...) ([]ValidatorWithOnchainInfo, error)
- func SelectAwaitingActivationValidators(client *ethclient.Client, eigenpodAddress string, ...) ([]ValidatorWithOnchainInfo, error)
- func SelectAwaitingCredentialValidators(client *ethclient.Client, eigenpodAddress string, ...) ([]ValidatorWithOnchainInfo, error)
- func SelectCheckpointableValidators(client *ethclient.Client, eigenpodAddress string, ...) ([]ValidatorWithOnchainInfo, error)
Constants ¶
const ( ValidatorStatusInactive = 0 ValidatorStatusActive = 1 ValidatorStatusWithdrawn = 2 )
const FAR_FUTURE_EPOCH = math.MaxUint64
Variables ¶
Functions ¶
func CastBalanceProofs ¶
func CastBalanceProofs(proofs []*eigenpodproofs.BalanceProof) []onchain.BeaconChainProofsBalanceProof
func CastValidatorFields ¶
func CastValidatorFields(proof [][]eigenpodproofs.Bytes32) [][][32]byte
golang was a mistake. these types are literally identical :'(
func ContextWithTracing ¶
func ContextWithTracing(ctx context.Context, callbacks *TracerCallbacks) context.Context
func FetchMultipleOnchainValidatorInfoMulticalls ¶
func FetchMultipleOnchainValidatorInfoMulticalls(eigenpodAddress string, allValidators []*phase0.Validator) ([]*multicall.MultiCallMetaData[*onchain.IEigenPodValidatorInfo], error)
func FindStaleEigenpods ¶
func ForkVersions ¶
this is a mapping from <chainId, genesis_fork_version>.
func GenerateCheckpointProof ¶
func GenerateCheckpointProof(ctx context.Context, eigenpodAddress string, eth *ethclient.Client, chainId *big.Int, beaconClient BeaconClient, verbose bool) (*eigenpodproofs.VerifyCheckpointProofsCallParams, error)
func GenerateCheckpointProofForState ¶
func GenerateCheckpointProofForState(ctx context.Context, eigenpodAddress string, beaconState *spec.VersionedBeaconState, header *v1.BeaconBlockHeader, eth *ethclient.Client, currentCheckpointTimestamp uint64, proofs *eigenpodproofs.EigenPodProofs, verbose bool) (*eigenpodproofs.VerifyCheckpointProofsCallParams, error)
func GenerateValidatorProof ¶
func GenerateValidatorProof(ctx context.Context, eigenpodAddress string, eth *ethclient.Client, chainId *big.Int, beaconClient BeaconClient, validatorIndex *big.Int, verbose bool) (*eigenpodproofs.VerifyValidatorFieldsCallParams, uint64, error)
*
- Generates a .ProveValidatorContainers() proof for all eligible validators on the pod. If `validatorIndex` is set, it will only generate a proof
- against that validator, regardless of the validator's state.
func GenerateValidatorProofAtState ¶
func GenerateValidatorProofAtState(ctx context.Context, proofs *eigenpodproofs.EigenPodProofs, eigenpodAddress string, beaconState *spec.VersionedBeaconState, eth *ethclient.Client, chainId *big.Int, header *v1.BeaconBlockHeader, blockTimestamp uint64, forSpecificValidatorIndex *big.Int, verbose bool) (*eigenpodproofs.VerifyValidatorFieldsCallParams, error)
func GetCheckpointTimestampAndBeaconState ¶
func GetCheckpointTimestampAndBeaconState( ctx context.Context, eigenpodAddress string, eth *ethclient.Client, beaconClient BeaconClient, ) (uint64, *spec.VersionedBeaconState, error)
Fetch and return the current checkpoint timestamp for the pod If the checkpoint exists (timestamp != 0), also return the beacon state for the checkpoint If the checkpoint does not exist (timestamp == 0), return the head beacon state (i.e. the state we would use "if we start a checkpoint now")
func GetCurrentCheckpoint ¶
func IsAwaitingWithdrawalCredentialProof ¶
func IsAwaitingWithdrawalCredentialProof(validatorInfo onchain.IEigenPodValidatorInfo, validator *phase0.Validator) bool
func LoadCheckpointProofFromFile ¶
func LoadCheckpointProofFromFile(path string) (*eigenpodproofs.VerifyCheckpointProofsCallParams, error)
, out, owner *string, forceCheckpoint bool
func PanicIfNoConsent ¶
func PanicIfNoConsent(prompt string)
func PanicOnError ¶
func PodManagerContracts ¶
func SortByStatus ¶
func StartCheckpoint ¶
func StartCheckpointProofConsent ¶
func StartCheckpointProofConsent() string
func SubmitCheckpointProof ¶
func SubmitCheckpointProofBatch ¶
func SubmitCheckpointProofBatch(ctx context.Context, owner, eigenpodAddress string, chainId *big.Int, proof *eigenpodproofs.ValidatorBalancesRootProof, balanceProofs []*eigenpodproofs.BalanceProof, eth *ethclient.Client, noSend bool, verbose bool) (*types.Transaction, error)
func SubmitValidatorProof ¶
func SubmitValidatorProof(ctx context.Context, owner, eigenpodAddress string, chainId *big.Int, eth *ethclient.Client, batchSize uint64, proofs *eigenpodproofs.VerifyValidatorFieldsCallParams, oracleBeaconTimesetamp uint64, noPrompt bool, noSend bool, verbose bool) ([]*types.Transaction, [][]*big.Int, error)
func SubmitValidatorProofChunk ¶
func SubmitValidatorProofChunk(ctx context.Context, ownerAccount *Owner, eigenPod *onchain.EigenPod, chainId *big.Int, eth *ethclient.Client, indices []*big.Int, validatorFields [][][32]byte, stateRootProofs *eigenpodproofs.StateRootProof, validatorFieldsProofs [][]byte, oracleBeaconTimesetamp uint64, verbose bool) (*types.Transaction, error)
Types ¶
type BeaconClient ¶
type BeaconClient interface { GetBeaconHeader(ctx context.Context, blockId string) (*v1.BeaconBlockHeader, error) GetBeaconState(ctx context.Context, stateId string) (*spec.VersionedBeaconState, error) GetValidator(ctx context.Context, index uint64) (*v1.Validator, error) GetGenesisForkVersion(ctx context.Context) (*phase0.Version, error) }
func GetBeaconClient ¶
func GetBeaconClient(beaconUri string, verbose bool) (BeaconClient, error)
func GetClients ¶
func NewBeaconClient ¶
func NewBeaconClient(endpoint string, verbose bool) (BeaconClient, context.CancelFunc, error)
type Checkpoint ¶
type EigenpodStatus ¶
type EigenpodStatus struct { Validators map[string]Validator ActiveCheckpoint *Checkpoint NumberValidatorsToCheckpoint int Status int // if you completed a new checkpoint right now, how many shares would you get? // // this is computed as: // - If checkpoint is already started: // sum(beacon chain balances) + currentCheckpoint.podBalanceGwei + pod.withdrawableRestakedExecutionLayerGwei() // - If no checkpoint is started: // total_shares_after_checkpoint = sum(validator[i].regular_balance) + (balanceOf(pod) rounded down to gwei) - withdrawableRestakedExecutionLayerGwei PodOwner gethCommon.Address ProofSubmitter gethCommon.Address // Whether the checkpoint would need to be started with the `--force` flag. // This would be due to the pod not having any uncheckpointed native ETH MustForceCheckpoint bool }
func GetStatus ¶
func GetStatus(ctx context.Context, eigenpodAddress string, eth *ethclient.Client, beaconClient BeaconClient) EigenpodStatus
type Owner ¶
type PodOwnerShare ¶
type PodOwnerShare struct {}
type SerializableCredentialProof ¶
type SerializableCredentialProof struct { ValidatorProofs *eigenpodproofs.VerifyValidatorFieldsCallParams OracleBeaconTimestamp uint64 }
func LoadValidatorProofFromFile ¶
func LoadValidatorProofFromFile(path string) (*SerializableCredentialProof, error)
type TracerCallbacks ¶
type TracerCallbacks struct { OnStartSection func(name string, metadata map[string]string) OnEndSection func() }
func GetContextTracingCallbacks ¶
func GetContextTracingCallbacks(ctx context.Context) *TracerCallbacks
type ValidatorWithIndex ¶
func FindAllValidatorsForEigenpod ¶
func FindAllValidatorsForEigenpod(eigenpodAddress string, beaconState *spec.VersionedBeaconState) ([]ValidatorWithIndex, error)
search through beacon state for validators whose withdrawal address is set to eigenpod.
type ValidatorWithOnchainInfo ¶
type ValidatorWithOnchainInfo = struct { Info onchain.IEigenPodValidatorInfo Validator *phase0.Validator Index uint64 }
func FetchMultipleOnchainValidatorInfo ¶
func FetchMultipleOnchainValidatorInfo(ctx context.Context, client *ethclient.Client, eigenpodAddress string, allValidators []ValidatorWithIndex) ([]ValidatorWithOnchainInfo, error)
func SelectActiveValidators ¶
func SelectActiveValidators( client *ethclient.Client, eigenpodAddress string, validators []ValidatorWithOnchainInfo, ) ([]ValidatorWithOnchainInfo, error)
func SelectAwaitingActivationValidators ¶
func SelectAwaitingActivationValidators( client *ethclient.Client, eigenpodAddress string, validators []ValidatorWithOnchainInfo, ) ([]ValidatorWithOnchainInfo, error)
Validators whose deposits have been processed but are awaiting activation on the beacon chain If the validator has 32 ETH effective balance, they should
func SelectAwaitingCredentialValidators ¶
func SelectAwaitingCredentialValidators( client *ethclient.Client, eigenpodAddress string, validators []ValidatorWithOnchainInfo, ) ([]ValidatorWithOnchainInfo, error)
func SelectCheckpointableValidators ¶
func SelectCheckpointableValidators( client *ethclient.Client, eigenpodAddress string, validators []ValidatorWithOnchainInfo, lastCheckpoint uint64, ) ([]ValidatorWithOnchainInfo, error)