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++ { 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 {