Skip to content

Commit

Permalink
add step fix (#4047)
Browse files Browse the repository at this point in the history
  • Loading branch information
nisdas authored Nov 19, 2019
1 parent 3f6435a commit 0e88085
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions beacon-chain/sync/initial-sync/round_robin.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ func (s *InitialSync) roundRobinSync(genesis time.Time) error {

// Handle block large block ranges of skipped slots.
start += count * uint64(lastEmptyRequests*len(peers))
if count <= 1 {
step = 1
}

// Short circuit start far exceeding the highest finalized epoch in some infinite loop.
if start > helpers.StartSlot(highestFinalizedEpoch()+1) {
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/sync/rpc_beacon_blocks_by_range.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (r *RegularSync) beaconBlocksByRangeRPCHandler(ctx context.Context, msg int
m := msg.(*pb.BeaconBlocksByRangeRequest)

startSlot := m.StartSlot
endSlot := startSlot + (m.Step * (m.Count-1))
endSlot := startSlot + (m.Step * (m.Count - 1))

span.AddAttributes(
trace.Int64Attribute("start", int64(startSlot)),
Expand Down
5 changes: 3 additions & 2 deletions proto/beacon/db/attestation_container.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion proto/beacon/db/finalized_block_root_container.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0e88085

Please sign in to comment.