Skip to content

Commit 0cf098b

Browse files
committed
Improve verification key error handling
1 parent 59b1fe0 commit 0cf098b

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

batcher/Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

operator/mina/lib/Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

operator/mina/lib/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ blake2 = "0.10.6"
3131
once_cell = "1.19.0"
3232
mina_bridge_core = { git = "https://github.com/lambdaclass/mina_bridge", rev = "884f28b834b62133384661fdf73c9db283f68c62" }
3333
bincode = "1.3.3"
34+
log = "0.4.21"
3435

3536
[patch.crates-io]
3637
ark-ff = { git = "https://github.com/lambdaclass/openmina_algebra", branch = "mina_bridge" }

operator/mina/lib/src/lib.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
mod consensus_state;
55
mod verifier_index;
66

7+
use log::error;
78
use mina_bridge_core::proof::state_proof::{MinaStateProof, MinaStatePubInputs};
89

910
use ark_ec::short_weierstrass_jacobian::GroupAffine;
@@ -21,9 +22,15 @@ use verifier_index::{deserialize_blockchain_vk, MinaChain};
2122

2223
lazy_static! {
2324
static ref DEVNET_VERIFIER_INDEX: VerifierIndex<GroupAffine<PallasParameters>> =
24-
deserialize_blockchain_vk(MinaChain::Devnet).unwrap();
25+
deserialize_blockchain_vk(MinaChain::Devnet).unwrap_or_else(|err| {
26+
error!("Failed to load Devnet verification key: {}", err);
27+
std::process::exit(1);
28+
});
2529
static ref MAINNET_VERIFIER_INDEX: VerifierIndex<GroupAffine<PallasParameters>> =
26-
deserialize_blockchain_vk(MinaChain::Mainnet).unwrap();
30+
deserialize_blockchain_vk(MinaChain::Mainnet).unwrap_or_else(|err| {
31+
error!("Failed to load Mainnet verification key: {}", err);
32+
std::process::exit(1);
33+
});
2734
static ref MINA_SRS: SRS<Vesta> = SRS::<Vesta>::create(Fq::SRS_DEPTH);
2835
}
2936

0 commit comments

Comments
 (0)