Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-pick caplin fixes to release #11781

Merged
merged 2 commits into from
Sep 1, 2024
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
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
Loading