Skip to content

Commit

Permalink
feat: download only missing blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
avilagaston9 committed Aug 15, 2024
1 parent 060748c commit 3fc4291
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/lambda_ethereum_consensus/beacon/sync_blocks.ex
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ defmodule LambdaEthereumConsensus.Beacon.SyncBlocks do
alias LambdaEthereumConsensus.ForkChoice
alias LambdaEthereumConsensus.Libp2pPort
alias LambdaEthereumConsensus.P2P.BlockDownloader
alias LambdaEthereumConsensus.StateTransition.Misc

@blocks_per_chunk 16
@retries 50
Expand All @@ -23,9 +22,8 @@ defmodule LambdaEthereumConsensus.Beacon.SyncBlocks do
"""
@spec run() :: non_neg_integer()
def run() do
# Initial sleep for faster app start
checkpoint = ForkChoice.get_finalized_checkpoint()
initial_slot = Misc.compute_start_slot_at_epoch(checkpoint.epoch) + 1
%{head_slot: head_slot} = ForkChoice.get_current_status_message()
initial_slot = head_slot + 1
last_slot = ForkChoice.get_current_chain_slot()

# If we're around genesis, we consider ourselves synced
Expand Down

0 comments on commit 3fc4291

Please sign in to comment.