Skip to content

Commit 0e513a6

Browse files
committed
fix compile issues
1 parent bd44bb6 commit 0e513a6

File tree

10 files changed

+175
-130
lines changed

10 files changed

+175
-130
lines changed

Cargo.lock

Lines changed: 118 additions & 74 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,17 @@ solana-program = "1.18.0"
7979
solana-sdk = "1.18.0"
8080
solana-transaction-status = "1.18.0"
8181

82-
light-merkle-tree-metadata = { git = "https://github.com/Lightprotocol/light-protocol", rev = "9d3cc26f06e31b614dc1393977925de9e99f37f5", features = [
82+
light-merkle-tree-metadata = { git = "https://github.com/Lightprotocol/light-protocol", rev = "b46641809c0bf46c8064775f19f99abf5b2c5eb2", features = [
8383
] }
84-
light-concurrent-merkle-tree = { git = "https://github.com/Lightprotocol/light-protocol", rev = "9d3cc26f06e31b614dc1393977925de9e99f37f5", features = [
84+
light-concurrent-merkle-tree = { git = "https://github.com/Lightprotocol/light-protocol", rev = "b46641809c0bf46c8064775f19f99abf5b2c5eb2", features = [
8585
] }
86-
light-sdk = { git = "https://github.com/Lightprotocol/light-protocol", rev = "9d3cc26f06e31b614dc1393977925de9e99f37f5", features = [
86+
light-sdk = { git = "https://github.com/Lightprotocol/light-protocol", rev = "b46641809c0bf46c8064775f19f99abf5b2c5eb2", features = [
8787
] }
88-
light-compressed-account = { git = "https://github.com/Lightprotocol/light-protocol", rev = "9d3cc26f06e31b614dc1393977925de9e99f37f5", features = [
88+
light-compressed-account = { git = "https://github.com/Lightprotocol/light-protocol", rev = "b46641809c0bf46c8064775f19f99abf5b2c5eb2", features = [
8989
] }
90-
light-batched-merkle-tree = { git = "https://github.com/Lightprotocol/light-protocol", rev = "9d3cc26f06e31b614dc1393977925de9e99f37f5", features = [
90+
light-batched-merkle-tree = { git = "https://github.com/Lightprotocol/light-protocol", rev = "b46641809c0bf46c8064775f19f99abf5b2c5eb2", features = [
9191
] }
92-
light-prover-client = { git = "https://github.com/Lightprotocol/light-protocol", rev = "9d3cc26f06e31b614dc1393977925de9e99f37f5", features = [
92+
light-prover-client = { version = "1.2.0", git = "https://github.com/Lightprotocol/light-protocol", rev = "b46641809c0bf46c8064775f19f99abf5b2c5eb2", features = [
9393
] }
9494

9595
sqlx = { version = "0.6.2", features = [
@@ -113,7 +113,7 @@ time = "0.3.36"
113113
tokio = { version = "1.43.0", features = ["full"] }
114114
tower = { version = "0.4.13", features = ["full"] }
115115
tower-http = { version = "0.3.5", features = ["full"] }
116-
tracing = "0.1.35"
116+
tracing = "0.1.41"
117117
tracing-subscriber = { version = "0.3.16", features = [
118118
"json",
119119
"env-filter",

src/api/method/get_queue_elements.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use light_merkle_tree_metadata::queue::QueueType;
1+
use light_compressed_account::QueueType;
22
use sea_orm::{
33
ColumnTrait, Condition, ConnectionTrait, DatabaseBackend, DatabaseConnection, EntityTrait,
44
FromQueryResult, QueryFilter, QueryOrder, QuerySelect, Statement, TransactionTrait,
@@ -72,15 +72,15 @@ pub async fn get_queue_elements(
7272
Condition::all().add(accounts::Column::Tree.eq(request.tree.to_vec()));
7373

7474
match queue_type {
75-
QueueType::BatchedInput => {
75+
QueueType::InputStateV2 => {
7676
query_condition =
7777
query_condition.add(accounts::Column::NullifierQueueIndex.is_not_null());
7878
if let Some(start_offset) = request.start_offset {
7979
query_condition = query_condition
8080
.add(accounts::Column::NullifierQueueIndex.gte(start_offset as i64));
8181
}
8282
}
83-
QueueType::BatchedOutput => {
83+
QueueType::OutputStateV2 => {
8484
query_condition = query_condition.add(accounts::Column::InOutputQueue.eq(true));
8585
if let Some(start_offset) = request.start_offset {
8686
query_condition =
@@ -96,10 +96,10 @@ pub async fn get_queue_elements(
9696
}
9797

9898
let query = match queue_type {
99-
QueueType::BatchedInput => accounts::Entity::find()
99+
QueueType::InputStateV2 => accounts::Entity::find()
100100
.filter(query_condition)
101101
.order_by_asc(accounts::Column::NullifierQueueIndex),
102-
QueueType::BatchedOutput => accounts::Entity::find()
102+
QueueType::OutputStateV2 => accounts::Entity::find()
103103
.filter(query_condition)
104104
.order_by_asc(accounts::Column::LeafIndex),
105105
_ => {
@@ -121,10 +121,10 @@ pub async fn get_queue_elements(
121121
let indices: Vec<u64> = queue_elements.iter().map(|e| e.leaf_index as u64).collect();
122122
let (proofs, first_value_queue_index) = if !indices.is_empty() {
123123
let first_value_queue_index = match queue_type {
124-
QueueType::BatchedInput => Ok(queue_elements[0].nullifier_queue_index.ok_or(
124+
QueueType::InputStateV2 => Ok(queue_elements[0].nullifier_queue_index.ok_or(
125125
PhotonApiError::ValidationError("Nullifier queue index is missing".to_string()),
126126
)? as u64),
127-
QueueType::BatchedOutput => Ok(queue_elements[0].leaf_index as u64),
127+
QueueType::OutputStateV2 => Ok(queue_elements[0].leaf_index as u64),
128128
_ => Err(PhotonApiError::ValidationError(format!(
129129
"Invalid queue type: {:?}",
130130
queue_type

src/common/typedefs/account/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::common::typedefs::unsigned_integer::UnsignedInteger;
88
use crate::dao::generated::accounts::Model;
99
use crate::ingester::parser::indexer_events::CompressedAccount;
1010
use byteorder::{ByteOrder, LittleEndian};
11-
use light_merkle_tree_metadata::merkle_tree::TreeType;
11+
use light_compressed_account::TreeType;
1212
use serde::Serialize;
1313
use solana_program::pubkey::Pubkey;
1414
use utoipa::ToSchema;

src/ingester/parser/tree_info.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use lazy_static::lazy_static;
2-
use light_merkle_tree_metadata::merkle_tree::TreeType;
2+
use light_compressed_account::TreeType;
33
use solana_program::pubkey;
44
use solana_program::pubkey::Pubkey;
55
use std::collections::HashMap;
@@ -35,7 +35,7 @@ lazy_static! {
3535
tree: pubkey!("HLKs5NJ8FXkJg8BrzJt56adFYYuwg5etzDtBbQYTsixu"),
3636
queue: pubkey!("6L7SzhYB3anwEQ9cphpJ1U7Scwj57bx2xueReg7R9cKU"),
3737
height: 32,
38-
tree_type: TreeType::BatchedState,
38+
tree_type: TreeType::StateV2,
3939
},
4040
);
4141

@@ -45,7 +45,7 @@ lazy_static! {
4545
tree: pubkey!("smt1NamzXdq4AMqS2fS2F1i5KTYPZRhoHgWx38d8WsT"),
4646
queue: pubkey!("nfq1NvQDJ2GEgnS8zt9prAe8rjjpAW1zFkrvZoBR148"),
4747
height: 26,
48-
tree_type: TreeType::State,
48+
tree_type: TreeType::StateV1,
4949
},
5050
);
5151

@@ -55,7 +55,7 @@ lazy_static! {
5555
tree: pubkey!("smt2rJAFdyJJupwMKAqTNAJwvjhmiZ4JYGZmbVRw1Ho"),
5656
queue: pubkey!("nfq2hgS7NYemXsFaFUCe3EMXSDSfnZnAe27jC6aPP1X"),
5757
height: 26,
58-
tree_type: TreeType::State,
58+
tree_type: TreeType::StateV1,
5959
},
6060
);
6161

@@ -66,7 +66,7 @@ lazy_static! {
6666
// tree: pubkey!("smt3AFtReRGVcrP11D6bSLEaKdUmrGfaTNowMVccJeu"),
6767
// queue: pubkey!("nfq2hgS7NYemXsFaFUCe3EMXSDSfnZnAe27jC6aPP1X"),
6868
// height: 26,
69-
// tree_type: TreeType::State,
69+
// tree_type: TreeType::StateV1,
7070
// },
7171
// );
7272
//
@@ -76,7 +76,7 @@ lazy_static! {
7676
// tree: pubkey!("smt2rJAFdyJJupwMKAqTNAJwvjhmiZ4JYGZmbVRw1Ho"),
7777
// queue: pubkey!("smt4vjXvdjDFzvRMUxwTWnSy4c7cKkMaHuPrGsdDH7V"),
7878
// height: 26,
79-
// tree_type: TreeType::State,
79+
// tree_type: TreeType::StateV1,
8080
// },
8181
// );
8282
//
@@ -86,7 +86,7 @@ lazy_static! {
8686
// tree: pubkey!("smt5uPaQT9n6b1qAkgyonmzRxtuazA53Rddwntqistc"),
8787
// queue: pubkey!("nfq2hgS7NYemXsFaFUCe3EMXSDSfnZnAe27jC6aPP1X"),
8888
// height: 26,
89-
// tree_type: TreeType::State,
89+
// tree_type: TreeType::StateV1,
9090
// },
9191
// );
9292
//
@@ -96,7 +96,7 @@ lazy_static! {
9696
// tree: pubkey!("smt6ukQDSPPYHSshQovmiRUjG9jGFq2hW9vgrDFk5Yz"),
9797
// queue: pubkey!("nfq2hgS7NYemXsFaFUCe3EMXSDSfnZnAe27jC6aPP1X"),
9898
// height: 26,
99-
// tree_type: TreeType::State,
99+
// tree_type: TreeType::StateV1,
100100
// },
101101
// );
102102
//
@@ -106,7 +106,7 @@ lazy_static! {
106106
// tree: pubkey!("smt7onMFkvi3RbyhQCMajudYQkB1afAFt9CDXBQTLz6"),
107107
// queue: pubkey!("nfq2hgS7NYemXsFaFUCe3EMXSDSfnZnAe27jC6aPP1X"),
108108
// height: 26,
109-
// tree_type: TreeType::State,
109+
// tree_type: TreeType::StateV1,
110110
// },
111111
// );
112112
//
@@ -116,7 +116,7 @@ lazy_static! {
116116
// tree: pubkey!("smt8TYxNy8SuhAdKJ8CeLtDkr2w6dgDmdz5ruiDw9Y9"),
117117
// queue: pubkey!("nfq2hgS7NYemXsFaFUCe3EMXSDSfnZnAe27jC6aPP1X"),
118118
// height: 26,
119-
// tree_type: TreeType::State,
119+
// tree_type: TreeType::StateV1,
120120
// },
121121
// );
122122
//
@@ -126,7 +126,7 @@ lazy_static! {
126126
// tree: pubkey!("smt9ReAYRF5eFjTd5gBJMn5aKwNRcmp3ub2CQr2vW7j"),
127127
// queue: pubkey!("nfq2hgS7NYemXsFaFUCe3EMXSDSfnZnAe27jC6aPP1X"),
128128
// height: 26,
129-
// tree_type: TreeType::State,
129+
// tree_type: TreeType::StateV1,
130130
// },
131131
// );
132132
//
@@ -136,7 +136,7 @@ lazy_static! {
136136
// tree: pubkey!("smtAvYA5UbTRyKAkAj5kHs1CmrA42t6WkVLi4c6mA1f"),
137137
// queue: pubkey!("nfq2hgS7NYemXsFaFUCe3EMXSDSfnZnAe27jC6aPP1X"),
138138
// height: 26,
139-
// tree_type: TreeType::State,
139+
// tree_type: TreeType::StateV1,
140140
// },
141141
// );
142142

@@ -146,7 +146,7 @@ lazy_static! {
146146
tree: pubkey!("amt1Ayt45jfbdw5YSo7iz6WZxUmnZsQTYXy82hVwyC2"),
147147
queue: pubkey!("aq1S9z4reTSQAdgWHGD2zDaS39sjGrAxbR31vxJ2F4F"),
148148
height: 26,
149-
tree_type: TreeType::Address,
149+
tree_type: TreeType::AddressV1,
150150
},
151151
);
152152

@@ -156,7 +156,7 @@ lazy_static! {
156156
tree: pubkey!("amt1Ayt45jfbdw5YSo7iz6WZxUmnZsQTYXy82hVwyC2"),
157157
queue: pubkey!("aq1S9z4reTSQAdgWHGD2zDaS39sjGrAxbR31vxJ2F4F"),
158158
height: 26,
159-
tree_type: TreeType::Address,
159+
tree_type: TreeType::AddressV1,
160160
},
161161
);
162162

@@ -166,7 +166,7 @@ lazy_static! {
166166
tree: pubkey!("HLKs5NJ8FXkJg8BrzJt56adFYYuwg5etzDtBbQYTsixu"),
167167
queue: pubkey!("6L7SzhYB3anwEQ9cphpJ1U7Scwj57bx2xueReg7R9cKU"),
168168
height: 32,
169-
tree_type: TreeType::BatchedState,
169+
tree_type: TreeType::StateV2,
170170
},
171171
);
172172

@@ -176,7 +176,7 @@ lazy_static! {
176176
tree: pubkey!("smt1NamzXdq4AMqS2fS2F1i5KTYPZRhoHgWx38d8WsT"),
177177
queue: pubkey!("nfq1NvQDJ2GEgnS8zt9prAe8rjjpAW1zFkrvZoBR148"),
178178
height: 26,
179-
tree_type: TreeType::State,
179+
tree_type: TreeType::StateV1,
180180
},
181181
);
182182

@@ -186,7 +186,7 @@ lazy_static! {
186186
tree: pubkey!("smt2rJAFdyJJupwMKAqTNAJwvjhmiZ4JYGZmbVRw1Ho"),
187187
queue: pubkey!("nfq2hgS7NYemXsFaFUCe3EMXSDSfnZnAe27jC6aPP1X"),
188188
height: 26,
189-
tree_type: TreeType::State,
189+
tree_type: TreeType::StateV1,
190190
},
191191
);
192192

src/ingester/parser/tx_event_parser.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ use crate::ingester::parser::tree_info::TreeInfo;
66
use crate::ingester::parser::{ACCOUNT_COMPRESSION_PROGRAM_ID, NOOP_PROGRAM_ID, SYSTEM_PROGRAM};
77
use crate::ingester::typedefs::block_info::{Instruction, TransactionInfo};
88
use anchor_lang::AnchorDeserialize;
9-
use light_merkle_tree_metadata::merkle_tree::TreeType;
9+
use light_compressed_account::TreeType;
10+
1011
use log::info;
1112
use solana_sdk::signature::Signature;
1213
use std::collections::HashMap;
@@ -64,8 +65,8 @@ pub fn parse_public_transaction_event(
6465

6566
for seq in sequence_numbers.iter() {
6667
if let Some(tree_info) = TreeInfo::get(&seq.pubkey.to_string()) {
67-
if tree_info.tree_type == TreeType::BatchedState
68-
|| tree_info.tree_type == TreeType::BatchedAddress
68+
if tree_info.tree_type == TreeType::StateV2
69+
|| tree_info.tree_type == TreeType::AddressV2
6970
{
7071
tree_to_seq_number.insert(tree_info.tree, seq.seq);
7172
has_batched_instructions = true;
@@ -95,7 +96,7 @@ pub fn parse_public_transaction_event(
9596
.clone();
9697

9798
let mut seq = None;
98-
if tree_and_queue.tree_type == TreeType::State {
99+
if tree_and_queue.tree_type == TreeType::StateV1 {
99100
seq = Some(*tree_to_seq_number.get(&tree).ok_or_else(|| {
100101
IngesterError::ParserError("Missing sequence number".to_string())
101102
})?);
@@ -106,7 +107,7 @@ pub fn parse_public_transaction_event(
106107
*seq += 1;
107108
}
108109

109-
let in_output_queue = tree_and_queue.tree_type == TreeType::BatchedState;
110+
let in_output_queue = tree_and_queue.tree_type == TreeType::StateV2;
110111
let enriched_account = AccountWithContext::new(
111112
out_account.compressed_account,
112113
hash,

src/ingester/parser/tx_event_parser_v2.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pub fn parse_public_transaction_event_v2(
5353
.sequence_numbers
5454
.iter()
5555
.map(|x| MerkleTreeSequenceNumber {
56-
pubkey: x.pubkey,
56+
pubkey: x.tree_pubkey,
5757
seq: x.seq,
5858
})
5959
.collect(),
@@ -72,15 +72,15 @@ pub fn parse_public_transaction_event_v2(
7272
.input_sequence_numbers
7373
.iter()
7474
.map(|x| MerkleTreeSequenceNumber {
75-
pubkey: x.pubkey,
75+
pubkey: x.tree_pubkey,
7676
seq: x.seq,
7777
})
7878
.collect(),
7979
address_sequence_numbers: public_transaction_event
8080
.address_sequence_numbers
8181
.iter()
8282
.map(|x| MerkleTreeSequenceNumber {
83-
pubkey: x.pubkey,
83+
pubkey: x.tree_pubkey,
8484
seq: x.seq,
8585
})
8686
.collect(),

src/monitor/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ use crate::{
2222
};
2323
use light_concurrent_merkle_tree::copy::ConcurrentMerkleTreeCopy;
2424
use light_concurrent_merkle_tree::light_hasher::Poseidon;
25-
use light_sdk::state::MerkleTreeMetadata;
2625

2726
use crate::common::typedefs::hash::Hash;
2827

2928
use solana_sdk::account::Account as SolanaAccount;
3029

3130
use crate::common::typedefs::context::Context;
3231
use light_batched_merkle_tree::merkle_tree::BatchedMerkleTreeAccount;
32+
use light_merkle_tree_metadata::merkle_tree::MerkleTreeMetadata;
3333
use solana_sdk::pubkey::Pubkey;
3434
use std::mem;
3535

0 commit comments

Comments
 (0)