From 2c22ab07d72d936886a2aa2df3630580bc2da1d1 Mon Sep 17 00:00:00 2001 From: Giulio Date: Fri, 23 Aug 2024 11:12:31 +0200 Subject: [PATCH 1/2] save --- cl/antiquary/state_antiquary.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cl/antiquary/state_antiquary.go b/cl/antiquary/state_antiquary.go index 94087884745..a616c7cc0c4 100644 --- a/cl/antiquary/state_antiquary.go +++ b/cl/antiquary/state_antiquary.go @@ -241,7 +241,7 @@ func (s *Antiquary) IncrementBeaconState(ctx context.Context, to uint64) error { defer progressTimer.Stop() prevSlot := slot first := false - blocksBeforeCommit := 350_000 + blocksBeforeCommit := 35_000 blocksProcessed := 0 for ; slot < to && blocksProcessed < blocksBeforeCommit; slot++ { From 92f2a89ff8550d5e95789d97fd75a5b9944ce9ac Mon Sep 17 00:00:00 2001 From: Giulio Date: Wed, 28 Aug 2024 15:53:58 +0200 Subject: [PATCH 2/2] save --- cl/beacon/handler/headers.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/cl/beacon/handler/headers.go b/cl/beacon/handler/headers.go index 2eb4b44b51c..9a0a52231af 100644 --- a/cl/beacon/handler/headers.go +++ b/cl/beacon/handler/headers.go @@ -31,7 +31,7 @@ func (a *ApiHandler) getHeaders(w http.ResponseWriter, r *http.Request) (*beacon var potentialRoot libcommon.Hash // First lets find some good candidates for the query. TODO(Giulio2002): this does not give all the headers. switch { - case queryParentHash != nil && querySlot != nil: + case queryParentHash != nil: // get all blocks with this parent slot, err = beacon_indicies.ReadBlockSlotByBlockRoot(tx, *queryParentHash) if err != nil { @@ -40,14 +40,13 @@ func (a *ApiHandler) getHeaders(w http.ResponseWriter, r *http.Request) (*beacon if slot == nil { break } - if *slot+1 != *querySlot { - break + for i := uint64(1); i < a.beaconChainCfg.SlotsPerEpoch; i++ { + potentialRoot, err = beacon_indicies.ReadCanonicalBlockRoot(tx, (*slot)+i) + if err != nil { + return nil, err + } + candidates = append(candidates, potentialRoot) } - potentialRoot, err = beacon_indicies.ReadCanonicalBlockRoot(tx, *slot+1) - if err != nil { - return nil, err - } - candidates = append(candidates, potentialRoot) case queryParentHash == nil && querySlot != nil: potentialRoot, err = beacon_indicies.ReadCanonicalBlockRoot(tx, *querySlot) if err != nil {