Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
2 changes: 2 additions & 0 deletions config-files/config-batcher-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ batcher:
pre_verification_is_enabled: true
metrics_port: 9093
telemetry_ip_port_address: localhost:4001
# The specific name for each verifier should match the ProvingSystemId string representation
disabled_verifiers: []
non_paying:
address: '0xa0Ee7A142d267C1f36714E4a8F75612F20a79720' # Anvil address 9
replacement_private_key: ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 # Anvil address 1
Expand Down
2 changes: 2 additions & 0 deletions config-files/config-batcher-ethereum-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ batcher:
pre_verification_is_enabled: true
metrics_port: 9093
telemetry_ip_port_address: localhost:4001
# The specific name for each verifier should match the ProvingSystemId string representation
disabled_verifiers: []
non_paying:
address: '0xa0Ee7A142d267C1f36714E4a8F75612F20a79720' # Anvil address 9
replacement_private_key: ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 # Anvil address 1
Expand Down
2 changes: 2 additions & 0 deletions config-files/config-batcher.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ batcher:
pre_verification_is_enabled: true
metrics_port: 9093
telemetry_ip_port_address: localhost:4001
# The specific name for each verifier should match the ProvingSystemId string representation
Comment thread
JuArce marked this conversation as resolved.
disabled_verifiers: []
non_paying:
address: '0xa0Ee7A142d267C1f36714E4a8F75612F20a79720' # Anvil address 9
replacement_private_key: ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 # Anvil address 1
Expand Down
1 change: 1 addition & 0 deletions crates/batcher/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ pub struct BatcherConfigFromYaml {
pub amount_of_proofs_for_min_max_fee: usize,
pub min_bump_percentage: u64,
pub balance_unlock_polling_interval_seconds: u64,
pub disabled_verifiers: Vec<String>,
Comment thread
JuArce marked this conversation as resolved.
Outdated
}

#[derive(Debug, Deserialize)]
Expand Down
20 changes: 17 additions & 3 deletions crates/batcher/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ pub struct Batcher {

disabled_verifiers: Mutex<U256>,

// The list of disabled verifiers from the config file. Note that this is separate from the
// contract's disabled verifiers, and is updated only when the batcher is restarted.
config_disabled_verifiers: Vec<String>,

// Observability and monitoring
pub metrics: metrics::BatcherMetrics,
pub telemetry: TelemetrySender,
Expand Down Expand Up @@ -298,12 +302,14 @@ impl Batcher {
None
};

let disabled_verifiers = match service_manager.disabled_verifiers().call().await {
Ok(disabled_verifiers) => Ok(disabled_verifiers),
let contract_disabled_verifiers = match service_manager.disabled_verifiers().call().await {
Ok(contract_disabled_verifiers) => Ok(contract_disabled_verifiers),
Err(_) => service_manager_fallback.disabled_verifiers().call().await,
}
.expect("Failed to get disabled verifiers");

let config_disabled_verifiers = config.batcher.disabled_verifiers.clone();

let telemetry = TelemetrySender::new(format!(
"http://{}",
config.batcher.telemetry_ip_port_address
Expand Down Expand Up @@ -347,7 +353,8 @@ impl Batcher {
posting_batch: Mutex::new(false),
batch_state: Mutex::new(batch_state),
user_states,
disabled_verifiers: Mutex::new(disabled_verifiers),
disabled_verifiers: Mutex::new(contract_disabled_verifiers),
config_disabled_verifiers,
current_min_max_fee: RwLock::new(U256::zero()),
metrics,
telemetry,
Expand Down Expand Up @@ -1484,6 +1491,13 @@ impl Batcher {
}

async fn is_verifier_disabled(&self, verifier: ProvingSystemId) -> bool {
// Check if the verifier is disabled in the configuration first
if self
.config_disabled_verifiers
.contains(&verifier.to_string())
{
return true;
}
let disabled_verifiers = self.disabled_verifiers.lock().await;
zk_utils::is_verifier_disabled(*disabled_verifiers, verifier)
}
Expand Down
Loading