Skip to content

Commit

Permalink
Merge pull request #46 from Layr-Labs/add-holesky
Browse files Browse the repository at this point in the history
add holesky
  • Loading branch information
Sidu28 authored Mar 19, 2024
2 parents c964559 + 052ed65 commit daff6c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 1 addition & 3 deletions eigen_pod_proofs.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ type EigenPodProofs struct {
}

func NewEigenPodProofs(chainID uint64, oracleStateCacheExpirySeconds int) (*EigenPodProofs, error) {
if chainID != 1 && chainID != 5 {
if chainID != 1 && chainID != 5 && chainID != 17000 {
return nil, errors.New("chainID not supported")
}
// note that TTL applies equally to each entry
// oracleStateCache := expirable.NewLRU[string, []byte](MAX_ORACLE_STATE_CACHE_SIZE, nil, time.Duration(oracleStateCacheExpirySeconds)*time.Second)

oracleStateRootCache := expirable.NewLRU[uint64, phase0.Root](MAX_ORACLE_STATE_CACHE_SIZE, nil, time.Duration(oracleStateCacheExpirySeconds)*time.Second)
oracleStateTopLevelRootsCache := expirable.NewLRU[uint64, *beacon.BeaconStateTopLevelRoots](MAX_ORACLE_STATE_CACHE_SIZE, nil, time.Duration(oracleStateCacheExpirySeconds)*time.Second)
Expand Down
3 changes: 3 additions & 0 deletions prove_withdrawal.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ type StateRootProof struct {

const FIRST_CAPELLA_SLOT_GOERLI = uint64(5193728)
const FIRST_CAPELLA_SLOT_MAINNET = uint64(6209536)
const FIRST_CAPELLA_SLOT_HOLESKY = uint64(8192)

func IsProvableWithdrawal(latestOracleBeaconSlot, withdrawalSlot uint64) bool {
return latestOracleBeaconSlot > beacon.SlotsPerHistoricalRoot+withdrawalSlot
Expand All @@ -70,6 +71,8 @@ func (epp *EigenPodProofs) GetWithdrawalProofParams(latestOracleBeaconSlot, with
FIRST_CAPELLA_SLOT = FIRST_CAPELLA_SLOT_GOERLI
} else if epp.chainID == 1 {
FIRST_CAPELLA_SLOT = FIRST_CAPELLA_SLOT_MAINNET
} else if epp.chainID == 17000 {
FIRST_CAPELLA_SLOT = FIRST_CAPELLA_SLOT_HOLESKY
}
// index of the historical summary in the array of historical_summaries
historicalSummaryIndex := (withdrawalSlot - FIRST_CAPELLA_SLOT) / beacon.SlotsPerHistoricalRoot
Expand Down

0 comments on commit daff6c9

Please sign in to comment.