Skip to content

Commit

Permalink
Add derivation key to external services config
Browse files Browse the repository at this point in the history
A new field named 'derivation' has been incorporated to the external services configuration, setting a preset value for different environments. This modification enables us to use a variable derivation key, retrieved from the external services configuration, in the nullifier module.
  • Loading branch information
sergeytimoshin committed Jun 25, 2024
1 parent 0b86cae commit c502d3e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions forester/src/external_services_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pub struct ExternalServicesConfig {
pub ws_rpc_url: String,
pub indexer_url: String,
pub prover_url: String,
pub derivation: String
}

impl ExternalServicesConfig {
Expand All @@ -13,6 +14,9 @@ impl ExternalServicesConfig {
ws_rpc_url: "ws://localhost:8900".to_string(),
indexer_url: "http://localhost:8784".to_string(),
prover_url: "http://localhost:3001".to_string(),
// derivation: "H7ZzJngDRtAGCV8Y9HwJrMpsxeNZQyYkjxw4GE8YcUG2".to_string(),
derivation: "En9a97stB3Ek2n6Ey3NJwCUJnmTzLMMEA5C69upGDuQP".to_string(),
// derivation: "ALA2cnz41Wa2v2EYUdkYHsg7VnKsbH1j7secM5aiP8k".to_string()
}
}

Expand All @@ -22,6 +26,7 @@ impl ExternalServicesConfig {
ws_rpc_url: "ws://zk-testnet.helius.dev:8900".to_string(),
indexer_url: "https://zk-testnet.helius.dev:8784".to_string(),
prover_url: "https://zk-testnet.helius.dev:3001".to_string(),
derivation: "En9a97stB3Ek2n6Ey3NJwCUJnmTzLMMEA5C69upGDuQP".to_string()
}
}
}
2 changes: 1 addition & 1 deletion forester/src/nullifier/nullify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ pub async fn nullify_compressed_account<T: Indexer, R: RpcConnection>(
indices: vec![leaf_index],
proofs: vec![proof],
authority: config.payer_keypair.pubkey(),
derivation: Pubkey::from_str("En9a97stB3Ek2n6Ey3NJwCUJnmTzLMMEA5C69upGDuQP").unwrap(),
derivation: Pubkey::from_str(&config.external_services.derivation).unwrap(),
});
let instructions = [
solana_sdk::compute_budget::ComputeBudgetInstruction::set_compute_unit_limit(1_000_000),
Expand Down

0 comments on commit c502d3e

Please sign in to comment.