Skip to content

chore: bump commit hash #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: sergey/batch-address-updates
Choose a base branch
from
Open
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
38 changes: 20 additions & 18 deletions Cargo.lock

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

20 changes: 10 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ solana-program = "1.18.0"
solana-sdk = "1.18.0"
solana-transaction-status = "1.18.0"

light-batched-merkle-tree = { git = "https://github.com/Lightprotocol/light-protocol", rev = "d3e3170243d9cd87926ed41703f58374bfcaf532" }
light-compressed-account = { git = "https://github.com/Lightprotocol/light-protocol", rev = "d3e3170243d9cd87926ed41703f58374bfcaf532" }
light-concurrent-merkle-tree = { git = "https://github.com/Lightprotocol/light-protocol", rev = "d3e3170243d9cd87926ed41703f58374bfcaf532" }
light-hasher = { git = "https://github.com/Lightprotocol/light-protocol", rev = "d3e3170243d9cd87926ed41703f58374bfcaf532" }
light-indexed-merkle-tree = { git = "https://github.com/Lightprotocol/light-protocol", rev = "d3e3170243d9cd87926ed41703f58374bfcaf532" }
light-merkle-tree-metadata = { git = "https://github.com/Lightprotocol/light-protocol", rev = "d3e3170243d9cd87926ed41703f58374bfcaf532" }
light-merkle-tree-reference = { git = "https://github.com/Lightprotocol/light-protocol", rev = "d3e3170243d9cd87926ed41703f58374bfcaf532" }
light-prover-client = { git = "https://github.com/Lightprotocol/light-protocol", rev = "d3e3170243d9cd87926ed41703f58374bfcaf532" }
light-sdk = { git = "https://github.com/Lightprotocol/light-protocol", rev = "d3e3170243d9cd87926ed41703f58374bfcaf532" }
light-batched-merkle-tree = { git = "https://github.com/Lightprotocol/light-protocol", rev = "3c1107cf1d6dd8e9bce29d4d22209673153db64b" }
light-compressed-account = { git = "https://github.com/Lightprotocol/light-protocol", rev = "3c1107cf1d6dd8e9bce29d4d22209673153db64b" }
light-concurrent-merkle-tree = { git = "https://github.com/Lightprotocol/light-protocol", rev = "3c1107cf1d6dd8e9bce29d4d22209673153db64b" }
light-hasher = { git = "https://github.com/Lightprotocol/light-protocol", rev = "3c1107cf1d6dd8e9bce29d4d22209673153db64b" }
light-indexed-merkle-tree = { git = "https://github.com/Lightprotocol/light-protocol", rev = "3c1107cf1d6dd8e9bce29d4d22209673153db64b" }
light-merkle-tree-metadata = { git = "https://github.com/Lightprotocol/light-protocol", rev = "3c1107cf1d6dd8e9bce29d4d22209673153db64b" }
light-merkle-tree-reference = { git = "https://github.com/Lightprotocol/light-protocol", rev = "3c1107cf1d6dd8e9bce29d4d22209673153db64b" }
light-prover-client = { git = "https://github.com/Lightprotocol/light-protocol", rev = "3c1107cf1d6dd8e9bce29d4d22209673153db64b" }
light-sdk = { git = "https://github.com/Lightprotocol/light-protocol", rev = "3c1107cf1d6dd8e9bce29d4d22209673153db64b" }

sqlx = { version = "0.6.2", features = [
"macros",
Expand Down Expand Up @@ -129,7 +129,7 @@ rust-s3 = "0.34.0"
[dev-dependencies]
function_name = "0.3.0"
serial_test = "2.0.0"
light-hasher = { git = "https://github.com/Lightprotocol/light-protocol", rev = "d3e3170243d9cd87926ed41703f58374bfcaf532" }
light-hasher = { git = "https://github.com/Lightprotocol/light-protocol", rev = "3c1107cf1d6dd8e9bce29d4d22209673153db64b" }

[profile.dev]
# Do not produce debug info for ~40% faster incremental compilation.
Expand Down
4 changes: 2 additions & 2 deletions src/api/method/get_multiple_new_address_proofs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ pub async fn get_multiple_new_address_proofs_helper(
})?
.clone();
let (model, proof) = match tree_and_queue.tree_type {
TreeType::Address => {
TreeType::AddressV1 => {
let address = address.to_bytes_vec();
let tree = tree.to_bytes_vec();
get_exclusion_range_with_proof_legacy(txn, tree, tree_and_queue.height + 1, address)
.await?
}
TreeType::BatchedAddress => {
TreeType::AddressV2 => {
get_exclusion_range_with_proof(
txn,
tree.to_bytes_vec(),
Expand Down
12 changes: 6 additions & 6 deletions src/api/method/get_queue_elements.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ pub async fn get_queue_elements(
Condition::all().add(accounts::Column::Tree.eq(request.tree.to_vec()));

match queue_type {
QueueType::BatchedInput => {
QueueType::InputStateV2 => {
query_condition =
query_condition.add(accounts::Column::NullifierQueueIndex.is_not_null());
if let Some(start_offset) = request.start_offset {
query_condition = query_condition
.add(accounts::Column::NullifierQueueIndex.gte(start_offset as i64));
}
}
QueueType::BatchedOutput => {
QueueType::OutputStateV2 => {
query_condition = query_condition.add(accounts::Column::InOutputQueue.eq(true));
if let Some(start_offset) = request.start_offset {
query_condition =
Expand All @@ -96,10 +96,10 @@ pub async fn get_queue_elements(
}

let query = match queue_type {
QueueType::BatchedInput => accounts::Entity::find()
QueueType::InputStateV2 => accounts::Entity::find()
.filter(query_condition)
.order_by_asc(accounts::Column::NullifierQueueIndex),
QueueType::BatchedOutput => accounts::Entity::find()
QueueType::OutputStateV2 => accounts::Entity::find()
.filter(query_condition)
.order_by_asc(accounts::Column::LeafIndex),
_ => {
Expand All @@ -121,10 +121,10 @@ pub async fn get_queue_elements(
let indices: Vec<u64> = queue_elements.iter().map(|e| e.leaf_index as u64).collect();
let (proofs, first_value_queue_index) = if !indices.is_empty() {
let first_value_queue_index = match queue_type {
QueueType::BatchedInput => Ok(queue_elements[0].nullifier_queue_index.ok_or(
QueueType::InputStateV2 => Ok(queue_elements[0].nullifier_queue_index.ok_or(
PhotonApiError::ValidationError("Nullifier queue index is missing".to_string()),
)? as u64),
QueueType::BatchedOutput => Ok(queue_elements[0].leaf_index as u64),
QueueType::OutputStateV2 => Ok(queue_elements[0].leaf_index as u64),
_ => Err(PhotonApiError::ValidationError(format!(
"Invalid queue type: {:?}",
queue_type
Expand Down
14 changes: 7 additions & 7 deletions src/ingester/parser/tree_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ lazy_static! {
tree: *legacy_tree,
queue: *legacy_queue,
height: 26,
tree_type: TreeType::State,
tree_type: TreeType::StateV1,
},
);

Expand All @@ -192,7 +192,7 @@ lazy_static! {
tree: *legacy_tree,
queue: *legacy_queue,
height: 26,
tree_type: TreeType::State,
tree_type: TreeType::StateV1,
},
);
}
Expand All @@ -204,7 +204,7 @@ lazy_static! {
tree: *legacy_tree,
queue: *legacy_queue,
height: 26,
tree_type: TreeType::Address,
tree_type: TreeType::AddressV1,
},
);

Expand All @@ -214,7 +214,7 @@ lazy_static! {
tree: *legacy_tree,
queue: *legacy_queue,
height: 26,
tree_type: TreeType::Address,
tree_type: TreeType::AddressV1,
},
);
}
Expand All @@ -225,7 +225,7 @@ lazy_static! {
tree: pubkey!("HLKs5NJ8FXkJg8BrzJt56adFYYuwg5etzDtBbQYTsixu"),
queue: pubkey!("6L7SzhYB3anwEQ9cphpJ1U7Scwj57bx2xueReg7R9cKU"),
height: 32,
tree_type: TreeType::BatchedState,
tree_type: TreeType::StateV2,
},
);

Expand All @@ -235,7 +235,7 @@ lazy_static! {
tree: pubkey!("HLKs5NJ8FXkJg8BrzJt56adFYYuwg5etzDtBbQYTsixu"),
queue: pubkey!("6L7SzhYB3anwEQ9cphpJ1U7Scwj57bx2xueReg7R9cKU"),
height: 32,
tree_type: TreeType::BatchedState,
tree_type: TreeType::StateV2,
},
);

Expand All @@ -245,7 +245,7 @@ lazy_static! {
tree: pubkey!("EzKE84aVTkCUhDHLELqyJaq1Y7UVVmqxXqZjVHwHY3rK"),
queue: pubkey!("EzKE84aVTkCUhDHLELqyJaq1Y7UVVmqxXqZjVHwHY3rK"),
height: 40,
tree_type: TreeType::BatchedAddress,
tree_type: TreeType::AddressV2,
},
);

Expand Down
4 changes: 2 additions & 2 deletions src/ingester/parser/tx_event_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pub fn create_state_update_v1(
.clone();

let mut seq = None;
if tree_and_queue.tree_type == TreeType::State {
if tree_and_queue.tree_type == TreeType::StateV1 {
seq = Some(*tree_to_seq_number.get(&tree).ok_or_else(|| {
IngesterError::ParserError("Missing sequence number".to_string())
})?);
Expand All @@ -81,7 +81,7 @@ pub fn create_state_update_v1(
*seq += 1;
}

let in_output_queue = tree_and_queue.tree_type == TreeType::BatchedState;
let in_output_queue = tree_and_queue.tree_type == TreeType::StateV2;
let enriched_account = AccountWithContext::new(
out_account.compressed_account.clone(),
&hash,
Expand Down
Loading