Skip to content

Commit

Permalink
Redo fix #4588
Browse files Browse the repository at this point in the history
  • Loading branch information
zah committed Mar 10, 2023
1 parent 89dcced commit f91fe56
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions beacon_chain/eth1/eth1_monitor.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1819,8 +1819,18 @@ proc stop(m: ELManager) {.async.} =
const
votedBlocksSafetyMargin = 50

func earliestBlockOfInterest(m: ELManager, latestEth1BlockNumber: Eth1BlockNumber): Eth1BlockNumber =
latestEth1BlockNumber - (2 * m.cfg.ETH1_FOLLOW_DISTANCE) - votedBlocksSafetyMargin
func earliestBlockOfInterest(
m: ELManager,
latestEth1BlockNumber: Eth1BlockNumber): Eth1BlockNumber =
let blocksOfInterestRange =
SLOTS_PER_ETH1_VOTING_PERIOD +
(2 * m.cfg.ETH1_FOLLOW_DISTANCE) +
votedBlocksSafetyMargin

if latestEth1BlockNumber > blocksOfInterestRange:
latestEth1BlockNumber - blocksOfInterestRange
else:
0

proc syncBlockRange(m: ELManager,
connection: ELConnection,
Expand Down

0 comments on commit f91fe56

Please sign in to comment.