eigenpodproofs

package module
v0.0.0-...-7d5141f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2024 License: MIT Imports: 15 Imported by: 0

README

This is a fork of https://github.com/Layr-Labs/eigenpod-proofs-generation that wraps checkpoint related transactions to be use etherfiNodesManager.forwardEigenpodCall() instead of calling the methods directly on the eigenpod. The reason for this is so that we don't need to set eigenpod.proofSubmitter for all 50k eigenpods we control

You should be able to use this fork exactly as you would the normal CLI. The --sender key you use must have operatingAdmin permissions on EtherfiNodesManager contract

Only supports mainnet at this time

Introduction

PEPE Changes how we prove balances to EigenLayer. For more information, check out some of the links below.

WARNING: You should only use this software with Holesky Testnet. When PePe goes to production, we will update this tool to support further networks. Thanks!

Usage

  • If you want to produce and submit proofs onchain -- either immediately, or by writing to a file to submit later -- check out our CLI. The CLI can produce both credential and checkpoint proofs, and submit them onchain if given a private key.

  • If you want to produce proofs from within Golang, please use cli/core:GenerateValidatorProof or cli/core:GenerateCheckpointProof for our high-level APIs. These will handle downloading beacon state, interfacing with an eth node, and generating the relevant proofs. Lower level APIs are available in prove_validator.go.

Questions

For any questions, feel free to;

  • Open a Github Issue
  • Ask in Discord

Documentation

Index

Constants

View Source
const (
	MAX_ORACLE_STATE_CACHE_SIZE = 2000000
)

Variables

This section is empty.

Functions

func BigToLittleEndian

func BigToLittleEndian(input *big.Int) [32]byte

func ConvertTo32ByteArray

func ConvertTo32ByteArray(b []byte) [32]byte

func ConvertUint64ToRoot

func ConvertUint64ToRoot(n uint64) phase0.Root

func GetDepth

func GetDepth(d uint64) uint8

func GetSlotTimestamp

func GetSlotTimestamp(beaconState *spec.VersionedBeaconState, blockHeader *phase0.BeaconBlockHeader) (uint64, error)

func NextPowerOfTwo

func NextPowerOfTwo(v uint64) uint

Types

type BalanceProof

type BalanceProof struct {
	PubkeyHash  [32]byte     `json:"pubkeyHash"`
	BalanceRoot phase0.Root  `json:"balanceRoot"`
	Proof       common.Proof `json:"proof"`
}

type Bytes32

type Bytes32 [32]byte

func ConvertUint64ToBytes32

func ConvertUint64ToBytes32(n uint64) Bytes32

func ConvertValidatorToValidatorFields

func ConvertValidatorToValidatorFields(v *phase0.Validator) []Bytes32

func (*Bytes32) MarshalJSON

func (p *Bytes32) MarshalJSON() ([]byte, error)

func (*Bytes32) UnmarshalJSON

func (p *Bytes32) UnmarshalJSON(data []byte) error

type EigenPodProofs

type EigenPodProofs struct {
	// contains filtered or unexported fields
}

func NewEigenPodProofs

func NewEigenPodProofs(chainID uint64, oracleStateCacheExpirySeconds int) (*EigenPodProofs, error)

NewEigenPodProofs creates a new EigenPodProofs instance. chainID is the chain ID of the chain that the EigenPodProofs instance will be used for. oracleStateCacheExpirySeconds is the expiry time for the oracle state cache in seconds. After this time caches of beacon state roots, validator trees and validator balances trees will be evicted.

func (*EigenPodProofs) ComputeBeaconStateRoot

func (epp *EigenPodProofs) ComputeBeaconStateRoot(beaconState *deneb.BeaconState) (phase0.Root, error)

func (*EigenPodProofs) ComputeBeaconStateTopLevelRoots

func (epp *EigenPodProofs) ComputeBeaconStateTopLevelRoots(beaconState *spec.VersionedBeaconState) (*beacon.BeaconStateTopLevelRoots, error)

func (*EigenPodProofs) ComputeValidatorBalancesTree

func (epp *EigenPodProofs) ComputeValidatorBalancesTree(slot phase0.Slot, balances []phase0.Gwei) ([][]phase0.Root, error)

func (*EigenPodProofs) ComputeValidatorTree

func (epp *EigenPodProofs) ComputeValidatorTree(slot phase0.Slot, validators []*phase0.Validator) ([][]phase0.Root, error)

func (*EigenPodProofs) ComputeVersionedBeaconStateTopLevelRoots

func (epp *EigenPodProofs) ComputeVersionedBeaconStateTopLevelRoots(beaconState *spec.VersionedBeaconState) (*beacon.BeaconStateTopLevelRoots, error)

func (*EigenPodProofs) PrecomputeCache

func (epp *EigenPodProofs) PrecomputeCache(state *spec.VersionedBeaconState) error

func (*EigenPodProofs) ProveCheckpointProofs

func (epp *EigenPodProofs) ProveCheckpointProofs(oracleBlockHeader *phase0.BeaconBlockHeader, oracleBeaconState *spec.VersionedBeaconState, validatorIndices []uint64) (*VerifyCheckpointProofsCallParams, error)

func (*EigenPodProofs) ProveValidatorContainers

func (epp *EigenPodProofs) ProveValidatorContainers(oracleBlockHeader *phase0.BeaconBlockHeader, oracleBeaconState *spec.VersionedBeaconState, validatorIndices []uint64) (*VerifyValidatorFieldsCallParams, error)

ProveValidatorContainers generates proofs for the validator containers. oracleBlockHeader is the block header of block whose state root will be looked up from the EIP-4788 precompile oracleBeaconState is the beacon state corresponding to the oracleBlockHeader validatorIndices is the list of validator indices for which the proofs are to be generated

type StateRootProof

type StateRootProof struct {
	BeaconStateRoot phase0.Root  `json:"beaconStateRoot"`
	Proof           common.Proof `json:"stateRootProof"`
}

type ValidatorBalancesRootProof

type ValidatorBalancesRootProof struct {
	ValidatorBalancesRoot phase0.Root  `json:"validatorBalanceRoot"`
	Proof                 common.Proof `json:"proof"`
}

type VerifyCheckpointProofsCallParams

type VerifyCheckpointProofsCallParams struct {
	ValidatorBalancesRootProof *ValidatorBalancesRootProof `json:"validatorBalancesRootProof"`
	BalanceProofs              []*BalanceProof             `json:"balanceProofs"`
}

type VerifyValidatorFieldsCallParams

type VerifyValidatorFieldsCallParams struct {
	StateRootProof        *StateRootProof `json:"stateRootProof"`
	ValidatorIndices      []uint64        `json:"validatorIndices"`
	ValidatorFieldsProofs []common.Proof  `json:"validatorFieldsProofs"`
	ValidatorFields       [][]Bytes32     `json:"validatorFields"`
}

Directories

Path Synopsis
bindings
cli

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL