Skip to content
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 script/bin/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const ELF: &[u8] = include_bytes!("../../elf/sp1-helios-elf");
async fn main() -> Result<()> {
dotenv::dotenv().ok();
setup_logger();
let slot = 10193088;
let slot = 10485824;
// Test checkpoint slot
let checkpoint = get_checkpoint(slot).await;

Expand Down
9 changes: 7 additions & 2 deletions script/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,18 @@ pub async fn get_updates(
let period =
calc_sync_period::<MainnetConsensusSpec>(client.store.finalized_header.beacon().slot);

let updates = client
let mut updates = client
.rpc
.get_updates(period, MAX_REQUEST_LIGHT_CLIENT_UPDATES)
.await
.unwrap();

updates.clone()
updates.retain(|u| {
calc_sync_period::<MainnetConsensusSpec>(u.attested_header().beacon().slot) >= period
});
updates.sort_by_key(|u| u.attested_header().beacon().slot);

updates
}

/// Fetch latest checkpoint from chain to bootstrap client to the latest state.
Expand Down
Loading