Skip to content

Commit cd2459a

Browse files
cleanup
1 parent cecb4dc commit cd2459a

9 files changed

Lines changed: 69 additions & 193 deletions

File tree

forester/src/processor/v2/processor.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ where
132132
}
133133

134134
if self.worker_pool.is_none() {
135-
let job_tx = spawn_proof_workers(&self.context.prover_config)?;
135+
let job_tx = spawn_proof_workers(&self.context.prover_config);
136136
self.worker_pool = Some(WorkerPool { job_tx });
137137
}
138138

@@ -532,7 +532,7 @@ where
532532
((queue_size / self.zkp_batch_size) as usize).min(self.context.max_batches_per_tree);
533533

534534
if self.worker_pool.is_none() {
535-
let job_tx = spawn_proof_workers(&self.context.prover_config)?;
535+
let job_tx = spawn_proof_workers(&self.context.prover_config);
536536
self.worker_pool = Some(WorkerPool { job_tx });
537537
}
538538

@@ -561,7 +561,7 @@ where
561561
let max_batches = max_batches.min(self.context.max_batches_per_tree);
562562

563563
if self.worker_pool.is_none() {
564-
let job_tx = spawn_proof_workers(&self.context.prover_config)?;
564+
let job_tx = spawn_proof_workers(&self.context.prover_config);
565565
self.worker_pool = Some(WorkerPool { job_tx });
566566
}
567567

forester/src/processor/v2/proof_worker.rs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -132,27 +132,27 @@ struct ProofClients {
132132
}
133133

134134
impl ProofClients {
135-
fn new(config: &ProverConfig) -> crate::Result<Self> {
136-
Ok(Self {
135+
fn new(config: &ProverConfig) -> Self {
136+
Self {
137137
append_client: ProofClient::with_config(
138138
config.append_url.clone(),
139139
config.polling_interval,
140140
config.max_wait_time,
141141
config.api_key.clone(),
142-
)?,
142+
),
143143
nullify_client: ProofClient::with_config(
144144
config.update_url.clone(),
145145
config.polling_interval,
146146
config.max_wait_time,
147147
config.api_key.clone(),
148-
)?,
148+
),
149149
address_append_client: ProofClient::with_config(
150150
config.address_append_url.clone(),
151151
config.polling_interval,
152152
config.max_wait_time,
153153
config.api_key.clone(),
154-
)?,
155-
})
154+
),
155+
}
156156
}
157157

158158
fn get_client(&self, input: &ProofInput) -> &ProofClient {
@@ -164,13 +164,11 @@ impl ProofClients {
164164
}
165165
}
166166

167-
pub fn spawn_proof_workers(
168-
config: &ProverConfig,
169-
) -> crate::Result<async_channel::Sender<ProofJob>> {
167+
pub fn spawn_proof_workers(config: &ProverConfig) -> async_channel::Sender<ProofJob> {
170168
let (job_tx, job_rx) = async_channel::bounded::<ProofJob>(256);
171-
let clients = Arc::new(ProofClients::new(config)?);
169+
let clients = Arc::new(ProofClients::new(config));
172170
tokio::spawn(async move { run_proof_pipeline(job_rx, clients).await });
173-
Ok(job_tx)
171+
job_tx
174172
}
175173

176174
async fn run_proof_pipeline(

js/compressed-token/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
- **Delegate approval and revocation** for SPL Token, Token-2022, and light-token, aligned with existing interface helpers:
66
- **Actions:** `approveInterface`, `revokeInterface`.
77
- **Instruction builders:** `createApproveInterfaceInstructions`, `createRevokeInterfaceInstructions` — each inner array is one transaction’s instructions (same batching style as other interface instruction builders).
8-
- **Program-level helpers:** `createLightTokenApproveInstruction`, `createLightTokenRevokeInstruction`
8+
- **Program-level helpers:** `createLightTokenApproveInstruction`, `createLightTokenRevokeInstruction`
99
- **Shared options:** approve/revoke accept optional `InterfaceOptions` (same type as `transferInterface`), including `splInterfaceInfos` when you need to supply SPL interface pool accounts explicitly.
1010

1111
### Changed

js/stateless.js/src/utils/instruction.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import { AccountMeta, PublicKey, SystemProgram } from '@solana/web3.js';
22
import { defaultStaticAccountsStruct, featureFlags } from '../constants';
33
import { LightSystemProgram } from '../programs';
44

5-
const toStrictBool = (value: unknown): boolean =>
6-
value === true || value === 1;
5+
const toStrictBool = (value: unknown): boolean => value === true || value === 1;
76

87
export class PackedAccounts {
98
private preAccounts: AccountMeta[] = [];

program-tests/utils/src/mock_batched_forester.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ impl<const HEIGHT: usize> MockBatchedForester<HEIGHT> {
132132

133133
assert_eq!(computed_new_root, self.merkle_tree.root());
134134

135-
let proof_client = ProofClient::local()?;
135+
let proof_client = ProofClient::local();
136136
let proof_result = match proof_client
137137
.generate_batch_append_proof(circuit_inputs)
138138
.await
@@ -208,7 +208,7 @@ impl<const HEIGHT: usize> MockBatchedForester<HEIGHT> {
208208
batch_size,
209209
&[],
210210
)?;
211-
let proof_client = ProofClient::local()?;
211+
let proof_client = ProofClient::local();
212212
let proof_result = proof_client.generate_batch_update_proof(inputs).await?;
213213
let new_root = self.merkle_tree.root();
214214
let proof = CompressedProof {
@@ -318,7 +318,7 @@ impl<const HEIGHT: usize> MockBatchedAddressForester<HEIGHT> {
318318
)));
319319
}
320320
};
321-
let proof_client = ProofClient::local()?;
321+
let proof_client = ProofClient::local();
322322
let proof_result = match proof_client
323323
.generate_batch_address_append_proof(inputs)
324324
.await

program-tests/utils/src/test_batch_forester.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ pub async fn create_append_batch_ix_data<R: Rpc>(
164164
bigint_to_be_bytes_array::<32>(&circuit_inputs.new_root.to_biguint().unwrap()).unwrap(),
165165
bundle.merkle_tree.root()
166166
);
167-
let proof_client = ProofClient::local().unwrap();
167+
let proof_client = ProofClient::local();
168168
let inputs_json = BatchAppendInputsJson::from_inputs(&circuit_inputs).to_string();
169169

170170
match proof_client.generate_proof(inputs_json).await {
@@ -293,7 +293,7 @@ pub async fn get_batched_nullify_ix_data<R: Rpc>(
293293
&[],
294294
)
295295
.unwrap();
296-
let proof_client = ProofClient::local().unwrap();
296+
let proof_client = ProofClient::local();
297297
let circuit_inputs_new_root =
298298
bigint_to_be_bytes_array::<32>(&inputs.new_root.to_biguint().unwrap()).unwrap();
299299
let inputs_json = update_inputs_string(&inputs);
@@ -715,7 +715,7 @@ pub async fn create_batch_update_address_tree_instruction_data_with_proof<R: Rpc
715715
)
716716
.unwrap();
717717

718-
let proof_client = ProofClient::local().unwrap();
718+
let proof_client = ProofClient::local();
719719
let circuit_inputs_new_root = bigint_to_be_bytes_array::<32>(&inputs.new_root).unwrap();
720720
let inputs_json = to_json(&inputs);
721721

prover/client/src/proof_client.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@ pub struct ProofClient {
6767
}
6868

6969
impl ProofClient {
70-
pub fn local() -> Result<Self, ProverClientError> {
71-
Ok(Self {
72-
client: build_http_client()?,
70+
pub fn local() -> Self {
71+
Self {
72+
client: build_http_client(),
7373
server_address: SERVER_ADDRESS.to_string(),
7474
polling_interval: Duration::from_millis(DEFAULT_POLLING_INTERVAL_MS),
7575
max_wait_time: Duration::from_secs(DEFAULT_MAX_WAIT_TIME_SECS),
7676
api_key: None,
7777
initial_poll_delay: Duration::from_millis(INITIAL_POLL_DELAY_SMALL_CIRCUIT_MS),
78-
})
78+
}
7979
}
8080

8181
#[allow(unused)]
@@ -84,21 +84,21 @@ impl ProofClient {
8484
polling_interval: Duration,
8585
max_wait_time: Duration,
8686
api_key: Option<String>,
87-
) -> Result<Self, ProverClientError> {
87+
) -> Self {
8888
let initial_poll_delay = if api_key.is_some() {
8989
Duration::from_millis(INITIAL_POLL_DELAY_LARGE_CIRCUIT_MS)
9090
} else {
9191
Duration::from_millis(INITIAL_POLL_DELAY_SMALL_CIRCUIT_MS)
9292
};
9393

94-
Ok(Self {
95-
client: build_http_client()?,
94+
Self {
95+
client: build_http_client(),
9696
server_address,
9797
polling_interval,
9898
max_wait_time,
9999
api_key,
100100
initial_poll_delay,
101-
})
101+
}
102102
}
103103

104104
#[allow(unused)]
@@ -108,15 +108,15 @@ impl ProofClient {
108108
max_wait_time: Duration,
109109
api_key: Option<String>,
110110
initial_poll_delay: Duration,
111-
) -> Result<Self, ProverClientError> {
112-
Ok(Self {
113-
client: build_http_client()?,
111+
) -> Self {
112+
Self {
113+
client: build_http_client(),
114114
server_address,
115115
polling_interval,
116116
max_wait_time,
117117
api_key,
118118
initial_poll_delay,
119-
})
119+
}
120120
}
121121

122122
pub async fn submit_proof_async(

prover/client/src/proof_types/batch_address_append/proof_inputs.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,12 @@ pub fn get_batch_address_append_circuit_inputs<const HEIGHT: usize>(
221221
}
222222
let new_element_values = &new_element_values[..zkp_batch_size];
223223
let mut new_root = [0u8; 32];
224-
let mut low_element_circuit_merkle_proofs = Vec::with_capacity(batch_len);
225-
let mut new_element_circuit_merkle_proofs = Vec::with_capacity(batch_len);
226-
let mut patched_low_element_next_values = Vec::with_capacity(batch_len);
227-
let mut patched_low_element_next_indices = Vec::with_capacity(batch_len);
228-
let mut patched_low_element_values = Vec::with_capacity(batch_len);
229-
let mut patched_low_element_indices = Vec::with_capacity(batch_len);
224+
let mut low_element_circuit_merkle_proofs = Vec::with_capacity(zkp_batch_size);
225+
let mut new_element_circuit_merkle_proofs = Vec::with_capacity(zkp_batch_size);
226+
let mut patched_low_element_next_values = Vec::with_capacity(zkp_batch_size);
227+
let mut patched_low_element_next_indices = Vec::with_capacity(zkp_batch_size);
228+
let mut patched_low_element_values = Vec::with_capacity(zkp_batch_size);
229+
let mut patched_low_element_indices = Vec::with_capacity(zkp_batch_size);
230230

231231
let computed_hashchain = create_hash_chain_from_slice(new_element_values).map_err(|e| {
232232
ProverClientError::GenericError(format!("Failed to compute hashchain: {}", e))
@@ -261,7 +261,7 @@ pub fn get_batch_address_append_circuit_inputs<const HEIGHT: usize>(
261261
let is_first_batch = indexed_changelog.is_empty();
262262
let mut expected_root_for_low = current_root;
263263

264-
for i in 0..batch_len {
264+
for i in 0..zkp_batch_size {
265265
let mut changelog_index = 0;
266266
let low_element_index = low_element_indices[i].try_into().map_err(|_| {
267267
ProverClientError::IntegerConversion(format!(

0 commit comments

Comments
 (0)