Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
6d4720a
state update simplified
sergeytimoshin Nov 23, 2025
b7abf38
format
sergeytimoshin Nov 23, 2025
cd3242c
append+nullify works. epoch transition wip
sergeytimoshin Nov 23, 2025
ca787e8
wip
sergeytimoshin Nov 23, 2025
1ee207c
test green
sergeytimoshin Nov 24, 2025
d28d5f8
fetch all batches
sergeytimoshin Nov 24, 2025
d2ea7b4
reduce rpc calls
sergeytimoshin Nov 25, 2025
1e17478
bump photon hash
sergeytimoshin Nov 25, 2025
5e19233
reorg module
sergeytimoshin Nov 25, 2025
0a4dd78
cleanup
sergeytimoshin Nov 25, 2025
a91e376
cleanup
sergeytimoshin Nov 25, 2025
ea59891
cleanup
sergeytimoshin Nov 25, 2025
6c55aaa
cleanup
sergeytimoshin Nov 25, 2025
5e966bd
cleanup
sergeytimoshin Nov 25, 2025
8c1d1aa
cleanup
sergeytimoshin Nov 25, 2025
a58ac90
cleanup
sergeytimoshin Nov 25, 2025
074fbc2
cleanup
sergeytimoshin Nov 25, 2025
0c1fa8a
cleanup
sergeytimoshin Nov 25, 2025
1d251ad
cleanup
sergeytimoshin Nov 25, 2025
89110ca
cleanup
sergeytimoshin Nov 25, 2025
442daec
cleanup
sergeytimoshin Nov 25, 2025
dbdac0b
cleanup
sergeytimoshin Nov 25, 2025
0060bf3
cleanup
sergeytimoshin Nov 25, 2025
9067dc6
cleanup
sergeytimoshin Nov 25, 2025
6ad54fd
cleanup
sergeytimoshin Nov 25, 2025
bd3fccb
cleanup
sergeytimoshin Nov 25, 2025
a43a9b2
cleanup
sergeytimoshin Nov 25, 2025
7912b30
cleanup
sergeytimoshin Nov 25, 2025
947c250
cleanup
sergeytimoshin Nov 25, 2025
0d30616
cleanup
sergeytimoshin Nov 25, 2025
3784df4
cleanup
sergeytimoshin Nov 25, 2025
c464efe
cleanup
sergeytimoshin Nov 25, 2025
1386c3c
Update forester/src/processor/v2/state/helpers.rs
sergeytimoshin Nov 25, 2025
5d2b3c3
cleanup
sergeytimoshin Nov 25, 2025
80bb32d
cleanup
sergeytimoshin Nov 25, 2025
6fbf4a7
cleanup
sergeytimoshin Nov 25, 2025
f10ac8c
cleanup
sergeytimoshin Nov 26, 2025
1db6f3a
cleanup
sergeytimoshin Nov 26, 2025
e6ffd04
cleanup
sergeytimoshin Nov 26, 2025
891ba99
cleanup
sergeytimoshin Nov 26, 2025
e1373cb
cleanup
sergeytimoshin Nov 26, 2025
697dedb
cleanup
sergeytimoshin Nov 26, 2025
2af5e1b
cleanup
sergeytimoshin Nov 26, 2025
7fdc4da
feat: add prover polling interval and max wait time to config
sergeytimoshin Nov 26, 2025
6f06524
add prover polling interval and max wait time to test configuration
sergeytimoshin Nov 26, 2025
bb99b50
cleanup
sergeytimoshin Nov 26, 2025
7dcdc22
cleanup
sergeytimoshin Nov 26, 2025
e8ff2c0
cleanup
sergeytimoshin Nov 26, 2025
4b9614c
reduce slots stop threshold to 1
sergeytimoshin Nov 26, 2025
cbc00c6
refactor: simplify proof worker spawning
sergeytimoshin Nov 27, 2025
00cadc7
cleanup
sergeytimoshin Nov 27, 2025
162ea99
feat: add method to get end of consecutive eligible slots in TreeFore…
sergeytimoshin Nov 27, 2025
7b125f3
fix: handle tree height mismatch in node insertion
sergeytimoshin Nov 27, 2025
c48dd7c
fix: skip node insertion for root level to prevent tree height mismat…
sergeytimoshin Nov 27, 2025
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
20 changes: 19 additions & 1 deletion Cargo.lock

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

4 changes: 4 additions & 0 deletions forester-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ light-indexed-merkle-tree = { workspace = true }
light-compressed-account = { workspace = true, features = ["std"] }
light-batched-merkle-tree = { workspace = true }
light-merkle-tree-metadata = { workspace = true }
light-merkle-tree-reference = { workspace = true }
light-sparse-merkle-tree = { workspace = true }
light-account-checks = { workspace = true }
light-sdk = { workspace = true }
Expand All @@ -39,6 +40,7 @@ anchor-lang = { workspace = true }
solana-sdk = { workspace = true }

thiserror = { workspace = true }
anyhow = { workspace = true }

tracing = { workspace = true }

Expand All @@ -51,3 +53,5 @@ governor = { workspace = true }
[dev-dependencies]
tokio-postgres = "0.7"
bs58 = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
3 changes: 3 additions & 0 deletions forester-utils/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,7 @@ pub enum ForesterUtilsError {

#[error("pool error: {0}")]
Pool(#[from] PoolError),

#[error("error: {0}")]
StagingTree(String),
}
17 changes: 17 additions & 0 deletions forester-utils/src/forester_epoch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,23 @@ impl TreeForesterSchedule {
pub fn is_eligible(&self, forester_slot: u64) -> bool {
self.slots[forester_slot as usize].is_some()
}

/// Returns the end solana slot of the last consecutive eligible slot
/// starting from the given light slot index.
pub fn get_consecutive_eligibility_end(&self, from_slot_idx: usize) -> Option<u64> {
let mut last_eligible_end = None;

for slot_opt in self.slots.iter().skip(from_slot_idx) {
match slot_opt {
Some(slot) => {
last_eligible_end = Some(slot.end_solana_slot);
}
None => break,
}
}

last_eligible_end
}
}

#[derive(Debug, Clone, AnchorSerialize, AnchorDeserialize, Default, PartialEq, Eq)]
Expand Down
8 changes: 1 addition & 7 deletions forester-utils/src/instructions/address_batch_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ async fn stream_instruction_data<'a, R: Rpc>(
}
};

// Log Photon response details
debug!(
"Photon response for chunk {}: received {} addresses, batch_start_index={}, first_queue_index={:?}, last_queue_index={:?}",
chunk_idx,
Expand All @@ -104,7 +103,6 @@ async fn stream_instruction_data<'a, R: Rpc>(
indexer_update_info.value.addresses.last().map(|a| a.queue_index)
);

// Update next_queue_index for the next chunk based on the last address returned
if let Some(last_address) = indexer_update_info.value.addresses.last() {
next_queue_index = Some(last_address.queue_index + 1);
debug!(
Expand Down Expand Up @@ -143,9 +141,8 @@ async fn stream_instruction_data<'a, R: Rpc>(
};
current_root = new_current_root;

info!("Generating {} zk proofs for batch_address chunk {} (parallel)", all_inputs.len(), chunk_idx + 1);
info!("Generating {} zk proofs for batch_address chunk {}", all_inputs.len(), chunk_idx + 1);

// Generate ALL proofs in parallel using join_all
let proof_futures: Vec<_> = all_inputs.into_iter().enumerate().map(|(i, inputs)| {
let client = Arc::clone(&proof_client);
async move {
Expand All @@ -154,10 +151,8 @@ async fn stream_instruction_data<'a, R: Rpc>(
}
}).collect();

// Wait for all proofs to complete in parallel
let proof_results = futures::future::join_all(proof_futures).await;

// Process results and batch them into groups of MAX_PROOFS_PER_TX
let mut proof_buffer = Vec::new();
for (idx, result) in proof_results {
match result {
Expand All @@ -172,7 +167,6 @@ async fn stream_instruction_data<'a, R: Rpc>(
};
proof_buffer.push(instruction_data);

// Yield when we have MAX_PROOFS_PER_TX proofs ready
if proof_buffer.len() >= MAX_PROOFS_PER_TX {
yield Ok(proof_buffer.clone());
proof_buffer.clear();
Expand Down
2 changes: 0 additions & 2 deletions forester-utils/src/instructions/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
pub mod address_batch_update;
pub mod create_account;
pub mod state_batch_append;
pub mod state_batch_nullify;

pub use create_account::create_account_instruction;
Loading
Loading