Skip to content

Commit

Permalink
Cherry-pick caplin fixes to release (#11781)
Browse files Browse the repository at this point in the history
  • Loading branch information
Giulio2002 committed Sep 1, 2024
1 parent 801aa1b commit 144bb2c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cl/antiquary/state_antiquary.go
Original file line number Diff line number Diff line change
Expand Up @@ -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++ {
Expand Down
15 changes: 7 additions & 8 deletions cl/beacon/handler/headers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit 144bb2c

Please sign in to comment.