Skip to content

Commit

Permalink
refactor: batched trees to 2 batches (#1492)
Browse files Browse the repository at this point in the history
* perf: optimize batched Merkle tree & output queue deserialization

* chore: cleanup remaining num_batches inputs

* fix: github workflow & start prover in test test_fill_queues_completely

* chore: reorg rust ci tests

* chore: add second concurrent state Merkle tree to standard cli accounts
  • Loading branch information
ananas-block authored Jan 21, 2025
1 parent 0565d33 commit 9054b6f
Show file tree
Hide file tree
Showing 44 changed files with 727 additions and 817 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,22 +102,23 @@ jobs:
if [[ -n "$pkg" ]]; then # Skip empty lines
echo "::group::Testing ${pkg}"
start=$(date +%s)
echo "${name}"
echo "${{ matrix.group.name }}"
if [ "${pkg}" == "light-batched-merkle-tree" ]; then
if [ "${name}" == "sdk-libs" ]; then
if [ "${{ matrix.group.name }}" == "sdk-libs" ]; then
# execute simulate transactions test
cargo test -p "${pkg}" -- --test test_simulate_transactions || exit 1
elif [ "${name}" == "program-libs" ]; then
cargo test -p "${pkg}" -- --skip test_simulate_transactions --skip test_e2e || exit 1
elif [ "${{ matrix.group.name }}" == "program-libs" ]; then
# execute e2e test
cargo test -p "${pkg}" -- --test test_e2e || exit 1
else
# execute all tests except test_simulate_transactions and test_e2e
cargo test -p "${pkg}" -- --skip test_simulate_transactions --skip test_e2e || exit 1
cargo test -p "${pkg}" -- --test test_simulate_transactions || exit 1
fi
else {
else
cargo test -p "${pkg}" || exit 1
}
fi
end=$(date +%s)
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"pubkey":"6L7SzhYB3anwEQ9cphpJ1U7Scwj57bx2xueReg7R9cKU","account":{"lamports":29176320,"data":["cXVldWVhY2MP2NRH06M+VSyY8R8Xdq4y4g7ChxQIOUQPXTDG51dI2AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=","base64"],"owner":"compr6CUsB5m2jS4Y3831ztGSTnDpnKJTKS95d64XVq","executable":false,"rentEpoch":18446744073709551615,"space":4064}}
{"pubkey":"6L7SzhYB3anwEQ9cphpJ1U7Scwj57bx2xueReg7R9cKU","account":{"lamports":29120640,"data":["cXVldWVhY2MP2NRH06M+VSyY8R8Xdq4y4g7ChxQIOUQPXTDG51dI2AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAXwAAAAAAAACIEwAAAAAAAP////////////////////8IUAAAAAAAAPKuWuX0POEKz8TJiMAjOgmV1yiV9Am40XHqZVvj8yn+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAIAAAAAAAAAMgAAAAAAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADIAAAAAAAAACgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAyAAAAAAAAAAoAAAAAAAAAAAAAAAAAAAAyAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","base64"],"owner":"compr6CUsB5m2jS4Y3831ztGSTnDpnKJTKS95d64XVq","executable":false,"rentEpoch":18446744073709551615,"space":4056}}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions forester-utils/src/instructions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ where
.unwrap();

let full_batch_index = merkle_tree.queue_metadata.next_full_batch_index;
let batch = &merkle_tree.batches[full_batch_index as usize];
let batch = &merkle_tree.queue_metadata.batches[full_batch_index as usize];
let zkp_batch_index = batch.get_num_inserted_zkps();
let leaves_hashchain =
merkle_tree.hashchain_store[full_batch_index as usize][zkp_batch_index as usize];
Expand Down Expand Up @@ -232,7 +232,7 @@ pub async fn create_append_batch_ix_data<R: RpcConnection, I: Indexer<R>>(
let zkp_batch_size = output_queue.batch_metadata.zkp_batch_size;

let num_inserted_zkps =
output_queue.batches[full_batch_index as usize].get_num_inserted_zkps();
output_queue.batch_metadata.batches[full_batch_index as usize].get_num_inserted_zkps();

let leaves_hashchain =
output_queue.hashchain_store[full_batch_index as usize][num_inserted_zkps as usize];
Expand Down Expand Up @@ -341,7 +341,7 @@ pub async fn create_nullify_batch_ix_data<R: RpcConnection, I: Indexer<R>>(
BatchedMerkleTreeAccount::state_from_bytes(account.data.as_mut_slice()).unwrap();
let batch_idx = merkle_tree.queue_metadata.next_full_batch_index as usize;
let zkp_size = merkle_tree.queue_metadata.zkp_batch_size;
let batch = &merkle_tree.batches[batch_idx];
let batch = &merkle_tree.queue_metadata.batches[batch_idx];
let zkp_idx = batch.get_num_inserted_zkps();
let hashchain = merkle_tree.hashchain_store[batch_idx][zkp_idx as usize];
let root = *merkle_tree.root_history.last().unwrap();
Expand Down
18 changes: 13 additions & 5 deletions forester/src/batch_processor/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ impl<R: RpcConnection, I: Indexer<R> + IndexerType<R>> BatchProcessor<R, I> {
};

let batch_index = tree.queue_metadata.next_full_batch_index;
match tree.batches.get(batch_index as usize) {
match tree.queue_metadata.batches.get(batch_index as usize) {
Some(batch) => Self::calculate_completion(batch),
None => 0.0,
}
Expand All @@ -139,7 +139,7 @@ impl<R: RpcConnection, I: Indexer<R> + IndexerType<R>> BatchProcessor<R, I> {
};

let batch_index = queue.batch_metadata.next_full_batch_index;
match queue.batches.get(batch_index as usize) {
match queue.batch_metadata.batches.get(batch_index as usize) {
Some(batch) => Self::calculate_completion(batch),
None => 0.0,
}
Expand Down Expand Up @@ -181,7 +181,7 @@ impl<R: RpcConnection, I: Indexer<R> + IndexerType<R>> BatchProcessor<R, I> {
let zkp_batch_size = output_queue.batch_metadata.zkp_batch_size;

(
output_queue.batches[batch_index as usize].get_num_inserted_zkps(),
output_queue.batch_metadata.batches[batch_index as usize].get_num_inserted_zkps(),
zkp_batch_size as usize,
)
};
Expand All @@ -206,7 +206,11 @@ impl<R: RpcConnection, I: Indexer<R> + IndexerType<R>> BatchProcessor<R, I> {

if let Ok(tree) = merkle_tree {
let batch_index = tree.queue_metadata.next_full_batch_index;
let full_batch = tree.batches.get(batch_index as usize).unwrap();
let full_batch = tree
.queue_metadata
.batches
.get(batch_index as usize)
.unwrap();

full_batch.get_state() != BatchState::Inserted
&& full_batch.get_current_zkp_batch_index() > full_batch.get_num_inserted_zkps()
Expand All @@ -230,7 +234,11 @@ impl<R: RpcConnection, I: Indexer<R> + IndexerType<R>> BatchProcessor<R, I> {

if let Ok(queue) = output_queue {
let batch_index = queue.batch_metadata.next_full_batch_index;
let full_batch = queue.batches.get(batch_index as usize).unwrap();
let full_batch = queue
.batch_metadata
.batches
.get(batch_index as usize)
.unwrap();

full_batch.get_state() != BatchState::Inserted
&& full_batch.get_current_zkp_batch_index() > full_batch.get_num_inserted_zkps()
Expand Down
4 changes: 2 additions & 2 deletions forester/tests/batched_address_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ async fn test_address_batched() {
let num_zkp_batches = batch_size / zkp_batch_size;

let mut completed_items = 0;
for batch_idx in 0..merkle_tree.batches.len() {
let batch = merkle_tree.batches.get(batch_idx).unwrap();
for batch_idx in 0..merkle_tree.queue_metadata.batches.len() {
let batch = merkle_tree.queue_metadata.batches.get(batch_idx).unwrap();
if batch.get_state() == BatchState::Inserted {
completed_items += batch_size;
}
Expand Down
4 changes: 2 additions & 2 deletions forester/tests/batched_state_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,8 @@ async fn test_state_batched() {
let num_zkp_batches = batch_size / zkp_batch_size;

let mut completed_items = 0;
for batch_idx in 0..output_queue.batches.len() {
let batch = output_queue.batches.get(batch_idx).unwrap();
for batch_idx in 0..output_queue.batch_metadata.batches.len() {
let batch = output_queue.batch_metadata.batches.get(batch_idx).unwrap();
if batch.get_state() == BatchState::Inserted {
completed_items += batch_size;
}
Expand Down
Loading

0 comments on commit 9054b6f

Please sign in to comment.