Skip to content

Commit

Permalink
Tidy.
Browse files Browse the repository at this point in the history
  • Loading branch information
0xSasaPrsic committed Nov 22, 2024
1 parent 89dde73 commit 22421bb
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 54 deletions.
79 changes: 64 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions pallets/vector/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ sp-runtime = { workspace = true, default-features = false }
sp-std = { workspace = true, default-features = false }
sp-core = { workspace = true, default-features = false }
frame-benchmarking = { workspace = true, default-features = false, optional = true }
# TODO is there a release version?
sp1-verifier = { git = "https://github.com/succinctlabs/sp1", branch = "dev", default-features = false }
# TODO add a release version
sp1-verifier = { git = "https://github.com/succinctlabs/sp1", rev = "87cab0f744bb36550f0f91c84bac1d2382bee51e", default-features = false }
alloy-sol-types = { version = "0.8.12", default-features = false }

ark-bn254.workspace = true
Expand All @@ -41,7 +41,8 @@ ethabi.workspace = true
[dev-dependencies]
pallet-balances = { workspace = true, default-features = false, features = ["std"] }
pallet-timestamp = { workspace = true, default-features = false }
sp1-sdk = { git = "https://github.com/succinctlabs/sp1", branch = "dev", default-features = false}
# TODO add a release version
sp1-sdk = { git = "https://github.com/succinctlabs/sp1", rev = "87cab0f744bb36550f0f91c84bac1d2382bee51e", default-features = false }

[features]
default = [ "std" ]
Expand Down
2 changes: 2 additions & 0 deletions pallets/vector/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ pub const ROTATE_VK: &str = r#"{"vk_json":{
]
}}"#;

// Generated with SP1 Helios https://github.com/succinctlabs/sp1-helios/blob/main/README.md
// cargo prove key —-elf (sp1 helios elf) in SP1 Helios
const SP1_VERIFICATION_KEY: [u8; 32] =
hex!("00788ce8dc2970920a3d3c072c8c07843d15f1307a53b3dd31b113c3e71c28e8");

Expand Down
2 changes: 0 additions & 2 deletions pallets/vector/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,7 @@ pub fn new_test_ext() -> sp_io::TestExternalities {
.unwrap();

vector_bridge::GenesisConfig::<Test> {
// finality_threshold: 461,
function_ids: (STEP_FUNCTION_ID, ROTATE_FUNCTION_ID),
// slots_per_period: 8192,
step_verification_key: STEP_VK.as_bytes().to_vec(),
rotate_verification_key: ROTATE_VK.as_bytes().to_vec(),
whitelisted_domains: vec![2],
Expand Down
36 changes: 2 additions & 34 deletions pallets/vector/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ const TEST_SENDER_VEC: [u8; 32] =
hex!("d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d");
const TEST_SENDER_ACCOUNT: AccountId32 = AccountId32::new(TEST_SENDER_VEC);

// Generated with SP1 Helios https://github.com/succinctlabs/sp1-helios/blob/main/README.md
// cargo prove key —-elf (sp1 helios elf) in SP1 Helios
const SP1_VERIFICATION_KEY: [u8; 32] =
hex!("00788ce8dc2970920a3d3c072c8c07843d15f1307a53b3dd31b113c3e71c28e8");

Expand Down Expand Up @@ -1668,40 +1670,6 @@ fn test_fulfill_configuration_not_set() {
});
}

// #[test]
// fn test_fulfill_finality_threshold_not_met() {
// new_test_ext().execute_with(|| {
// let sp1_proof_with_public_values = SP1ProofWithPublicValues::load(PROOF_FILE).unwrap();
// let proof = sp1_proof_with_public_values.bytes();
// let public_inputs = sp1_proof_with_public_values.public_values.to_vec();
// SP1VerificationKey::<Test>::set(H256(SP1_VERIFICATION_KEY));
//
// let proof_outputs: ProofOutputs = SolValue::abi_decode(&public_inputs, true).unwrap();
// let slots_per_period = 8192;
// // max participation required
// let finality_threshold = 5000;
// let slot = 6178816u64;
// let current_period = slot / slots_per_period;
//
// ConfigurationStorage::<Test>::set(Configuration {
// slots_per_period,
// finality_threshold: finality_threshold as u16,
// });
//
// Updater::<Test>::set(H256(TEST_SENDER_VEC));
// SyncCommitteeHashes::<Test>::set(current_period, H256::from(proof_outputs.syncCommitteeHash.0));
//
// let origin = RuntimeOrigin::signed(TEST_SENDER_VEC.into());
// let err = Bridge::fulfill(
// origin,
// BoundedVec::truncate_from(proof),
// BoundedVec::truncate_from(public_inputs),
// );
//
// assert_err!(err, Error::<Test>::NotEnoughParticipants);
// });
// }

#[test]
fn set_sync_committee_hash() {
new_test_ext().execute_with(|| {
Expand Down

0 comments on commit 22421bb

Please sign in to comment.