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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ At all times, refer to the `mainnet`, `testnet`, and `preprod` git tags to under
| Environment | Version |
| -------------- | ------------- |
| Mainnet | [v1.5.2](https://github.com/Layr-Labs/eigenpod-proofs-generation/releases/tag/v1.5.2) |
| Testnet(Hoodi & Holesky)| [v1.5.2](https://github.com/Layr-Labs/eigenpod-proofs-generation/releases/tag/v1.5.2) |
| Preprod | [v1.5.2](https://github.com/Layr-Labs/eigenpod-proofs-generation/releases/tag/v1.5.2) |
| Testnet(Hoodi & Holesky)| [v1.6.0](https://github.com/Layr-Labs/eigenpod-proofs-generation/releases/tag/v1.6.0) |
| Preprod | [v1.6.0](https://github.com/Layr-Labs/eigenpod-proofs-generation/releases/tag/v1.6.0) |

# Introduction

Expand Down
47 changes: 47 additions & 0 deletions beacon/beacon_state_top_level_roots.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ type VersionedBeaconStateTopLevelRoots struct {
Version spec.DataVersion
Deneb *BeaconStateTopLevelRootsDeneb
Electra *BeaconStateTopLevelRootsElectra
Fulu *BeaconStateTopLevelRootsFulu
}

func (v *VersionedBeaconStateTopLevelRoots) GetBalancesRoot() (*phase0.Root, error) {
Expand All @@ -21,6 +22,8 @@ func (v *VersionedBeaconStateTopLevelRoots) GetBalancesRoot() (*phase0.Root, err
return v.Deneb.BalancesRoot, nil
case spec.DataVersionElectra:
return v.Electra.BalancesRoot, nil
case spec.DataVersionFulu:
return v.Fulu.BalancesRoot, nil
default:
return nil, errors.New("unsupported beacon state version")
}
Expand Down Expand Up @@ -97,6 +100,47 @@ type BeaconStateTopLevelRootsElectra struct {
PendingConsolidationsRoot *phase0.Root
}

type BeaconStateTopLevelRootsFulu struct {
GenesisTimeRoot *phase0.Root
GenesisValidatorsRoot *phase0.Root
SlotRoot *phase0.Root
ForkRoot *phase0.Root
LatestBlockHeaderRoot *phase0.Root
BlockRootsRoot *phase0.Root
StateRootsRoot *phase0.Root
HistoricalRootsRoot *phase0.Root
ETH1DataRoot *phase0.Root
ETH1DataVotesRoot *phase0.Root
ETH1DepositIndexRoot *phase0.Root
ValidatorsRoot *phase0.Root
BalancesRoot *phase0.Root
RANDAOMixesRoot *phase0.Root
SlashingsRoot *phase0.Root
PreviousEpochParticipationRoot *phase0.Root
CurrentEpochParticipationRoot *phase0.Root
JustificationBitsRoot *phase0.Root
PreviousJustifiedCheckpointRoot *phase0.Root
CurrentJustifiedCheckpointRoot *phase0.Root
FinalizedCheckpointRoot *phase0.Root
InactivityScoresRoot *phase0.Root
CurrentSyncCommitteeRoot *phase0.Root
NextSyncCommitteeRoot *phase0.Root
LatestExecutionPayloadHeaderRoot *phase0.Root
NextWithdrawalIndexRoot *phase0.Root
NextWithdrawalValidatorIndexRoot *phase0.Root
HistoricalSummariesRoot *phase0.Root
DepositRequestsStartIndexRoot *phase0.Root
DepositBalanceToConsumeRoot *phase0.Root
ExitBalanceToConsumeRoot *phase0.Root
EarliestExitEpochRoot *phase0.Root
ConsolidationBalanceToConsumeRoot *phase0.Root
EarliestConsolidationEpochRoot *phase0.Root
PendingDepositsRoot *phase0.Root
PendingPartialWithdrawalsRoot *phase0.Root
PendingConsolidationsRoot *phase0.Root
ProposerLookaheadRoot *phase0.Root
}

func ProveBeaconTopLevelRootAgainstBeaconState(beaconTopLevelRoots *VersionedBeaconStateTopLevelRoots, index uint64) (common.Proof, error) {
var v reflect.Value
var treeHeight uint64
Expand All @@ -107,6 +151,9 @@ func ProveBeaconTopLevelRootAgainstBeaconState(beaconTopLevelRoots *VersionedBea
case spec.DataVersionElectra:
v = reflect.ValueOf(*beaconTopLevelRoots.Electra)
treeHeight = BEACON_STATE_TREE_HEIGHT_ELECTRA
case spec.DataVersionFulu:
v = reflect.ValueOf(*beaconTopLevelRoots.Fulu)
treeHeight = BEACON_STATE_TREE_HEIGHT_FULU
default:
return nil, errors.New("unsupported beacon state version")
}
Expand Down
1 change: 1 addition & 0 deletions beacon/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const (
BEACON_BLOCK_HEADER_TREE_HEIGHT = uint64(3)
BEACON_STATE_TREE_HEIGHT_DENEB = uint64(5)
BEACON_STATE_TREE_HEIGHT_ELECTRA = uint64(6)
BEACON_STATE_TREE_HEIGHT_FULU = uint64(6)
BALANCE_TREE_HEIGHT = uint64(38)
VALIDATOR_TREE_HEIGHT = uint64(40)

Expand Down
Loading