diff --git a/.github/workflows/check-excluded-packages.yml b/.github/workflows/check-excluded-packages.yml index f9f9adcdd7..e07287c086 100644 --- a/.github/workflows/check-excluded-packages.yml +++ b/.github/workflows/check-excluded-packages.yml @@ -5,7 +5,7 @@ on: paths: - aleph-client/** - bin/cliain/** - - bin/runtime/src/chain_extension/snarcos-extension/** + - bin/runtime/src/chain_extension/baby-liminal-extension/** - relations/** - poseidon/** - .github/workflows/check-excluded-packages.yml @@ -86,7 +86,7 @@ jobs: - name: Assert that packages are compatible with no-std run: | - packages=("relations" "bin/runtime/src/chain_extension/snarcos-extension") + packages=("relations" "bin/runtime/src/chain_extension/baby-liminal-extension") for p in ${packages[@]} do echo "Checking package $p..." diff --git a/Cargo.lock b/Cargo.lock index 62cb1477f8..aecb421ea7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -303,6 +303,7 @@ dependencies = [ "pallet-aleph", "pallet-aura", "pallet-authorship", + "pallet-baby-liminal", "pallet-balances", "pallet-contracts", "pallet-contracts-primitives", @@ -314,7 +315,6 @@ dependencies = [ "pallet-randomness-collective-flip", "pallet-scheduler", "pallet-session", - "pallet-snarcos", "pallet-staking", "pallet-sudo", "pallet-timestamp", @@ -4639,6 +4639,38 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-baby-liminal" +version = "0.1.0" +dependencies = [ + "ark-bls12-381", + "ark-crypto-primitives", + "ark-ec", + "ark-ff", + "ark-gm17", + "ark-groth16", + "ark-marlin", + "ark-poly", + "ark-poly-commit", + "ark-r1cs-std", + "ark-relations", + "ark-serialize", + "ark-snark", + "ark-std", + "blake2 0.9.2", + "digest 0.9.0", + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "primitives", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-balances" version = "4.0.0-dev" @@ -4835,38 +4867,6 @@ dependencies = [ "sp-trie", ] -[[package]] -name = "pallet-snarcos" -version = "0.1.0" -dependencies = [ - "ark-bls12-381", - "ark-crypto-primitives", - "ark-ec", - "ark-ff", - "ark-gm17", - "ark-groth16", - "ark-marlin", - "ark-poly", - "ark-poly-commit", - "ark-r1cs-std", - "ark-relations", - "ark-serialize", - "ark-snark", - "ark-std", - "blake2 0.9.2", - "digest 0.9.0", - "frame-benchmarking", - "frame-support", - "frame-system", - "parity-scale-codec", - "primitives", - "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", -] - [[package]] name = "pallet-staking" version = "4.0.0-dev" diff --git a/Cargo.toml b/Cargo.toml index 5ef2aad34b..92450c0ba2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,14 +8,14 @@ members = [ "pallets/aleph", "pallets/elections", "pallets/support", - "pallets/snarcos", + "pallets/baby-liminal", "primitives", ] exclude = [ "aleph-client", "bin/cliain", - "bin/runtime/src/chain_extension/snarcos-extension", + "bin/runtime/src/chain_extension/baby-liminal-extension", "relations", "relations/src/proc_macro", "poseidon", diff --git a/aleph-client/Cargo.lock b/aleph-client/Cargo.lock index 201ff9004a..545069f70d 100644 --- a/aleph-client/Cargo.lock +++ b/aleph-client/Cargo.lock @@ -60,8 +60,8 @@ dependencies = [ "hex", "ink_metadata", "log", + "pallet-baby-liminal", "pallet-contracts-primitives", - "pallet-snarcos", "parity-scale-codec", "primitives", "serde", @@ -2239,19 +2239,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] -name = "pallet-contracts-primitives" -version = "6.0.0" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=liminal-v0.9.32#f0c4d4700e400f398b945d7cccbda0ec1acba57b" -dependencies = [ - "bitflags", - "parity-scale-codec", - "sp-runtime 6.0.0", - "sp-std 4.0.0", - "sp-weights 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=liminal-v0.9.32)", -] - -[[package]] -name = "pallet-snarcos" +name = "pallet-baby-liminal" version = "0.1.0" dependencies = [ "ark-bls12-381", @@ -2281,6 +2269,18 @@ dependencies = [ "sp-std 4.0.0", ] +[[package]] +name = "pallet-contracts-primitives" +version = "6.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=liminal-v0.9.32#f0c4d4700e400f398b945d7cccbda0ec1acba57b" +dependencies = [ + "bitflags", + "parity-scale-codec", + "sp-runtime 6.0.0", + "sp-std 4.0.0", + "sp-weights 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=liminal-v0.9.32)", +] + [[package]] name = "parity-scale-codec" version = "3.2.1" diff --git a/aleph-client/Cargo.toml b/aleph-client/Cargo.toml index 5a95ef1804..f68d5b3ea8 100644 --- a/aleph-client/Cargo.toml +++ b/aleph-client/Cargo.toml @@ -24,5 +24,5 @@ sp-core = { git = "https://github.com/Cardinal-Cryptography/substrate.git", bran sp-runtime = { git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "liminal-v0.9.32" } pallet-contracts-primitives = { git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "liminal-v0.9.32" } -pallet-snarcos = { path = "../pallets/snarcos" } +pallet-baby-liminal = { path = "../pallets/baby-liminal" } primitives = { path = "../primitives" } diff --git a/aleph-client/src/aleph_zero.rs b/aleph-client/src/aleph_zero.rs index 9aa71546fe..2ec1a70a1b 100644 --- a/aleph-client/src/aleph_zero.rs +++ b/aleph-client/src/aleph_zero.rs @@ -23,7 +23,7 @@ pub mod api { "Contracts", "NominationPools", "Identity", - "Snarcos", + "BabyLiminal", ]; #[derive( :: subxt :: ext :: codec :: Decode, @@ -67,7 +67,7 @@ pub mod api { #[codec(index = 20)] Identity(identity::Event), #[codec(index = 21)] - Snarcos(snarcos::Event), + BabyLiminal(baby_liminal::Event), } pub mod system { use super::{root_mod, runtime_types}; @@ -766,9 +766,9 @@ pub mod api { "Events", vec![], [ - 11u8, 236u8, 50u8, 171u8, 31u8, 56u8, 117u8, 141u8, 172u8, 16u8, 124u8, - 103u8, 71u8, 79u8, 241u8, 118u8, 146u8, 56u8, 208u8, 175u8, 154u8, - 29u8, 133u8, 76u8, 226u8, 7u8, 179u8, 119u8, 245u8, 6u8, 72u8, 222u8, + 156u8, 100u8, 192u8, 33u8, 155u8, 231u8, 5u8, 239u8, 48u8, 33u8, 53u8, + 24u8, 129u8, 77u8, 88u8, 207u8, 65u8, 90u8, 180u8, 134u8, 5u8, 213u8, + 111u8, 129u8, 24u8, 123u8, 93u8, 123u8, 57u8, 235u8, 75u8, 12u8, ], ) } @@ -1213,10 +1213,9 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 155u8, 178u8, 143u8, 27u8, 155u8, 241u8, 239u8, 199u8, 97u8, 225u8, - 57u8, 233u8, 136u8, 128u8, 115u8, 95u8, 125u8, 161u8, 247u8, 55u8, - 208u8, 166u8, 232u8, 44u8, 199u8, 127u8, 66u8, 178u8, 49u8, 195u8, - 239u8, 69u8, + 148u8, 58u8, 201u8, 20u8, 221u8, 14u8, 230u8, 20u8, 186u8, 141u8, + 215u8, 53u8, 58u8, 13u8, 229u8, 32u8, 88u8, 161u8, 201u8, 122u8, 87u8, + 29u8, 18u8, 10u8, 239u8, 141u8, 5u8, 98u8, 85u8, 34u8, 233u8, 117u8, ], ) } @@ -1260,10 +1259,9 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 199u8, 208u8, 168u8, 245u8, 16u8, 51u8, 240u8, 219u8, 124u8, 186u8, - 195u8, 240u8, 61u8, 157u8, 157u8, 144u8, 176u8, 57u8, 152u8, 146u8, - 138u8, 122u8, 187u8, 243u8, 153u8, 68u8, 9u8, 25u8, 189u8, 82u8, 78u8, - 110u8, + 225u8, 61u8, 131u8, 50u8, 219u8, 59u8, 155u8, 214u8, 55u8, 226u8, 16u8, + 97u8, 105u8, 233u8, 120u8, 165u8, 93u8, 190u8, 95u8, 17u8, 98u8, 190u8, + 215u8, 5u8, 68u8, 159u8, 175u8, 151u8, 18u8, 225u8, 173u8, 33u8, ], ) } @@ -1308,10 +1306,10 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 119u8, 236u8, 147u8, 33u8, 174u8, 6u8, 120u8, 50u8, 205u8, 112u8, - 202u8, 3u8, 152u8, 1u8, 143u8, 27u8, 80u8, 206u8, 11u8, 198u8, 35u8, - 94u8, 156u8, 232u8, 108u8, 50u8, 255u8, 155u8, 162u8, 220u8, 230u8, - 243u8, + 195u8, 232u8, 95u8, 210u8, 72u8, 173u8, 250u8, 205u8, 177u8, 12u8, + 133u8, 150u8, 29u8, 117u8, 36u8, 224u8, 15u8, 96u8, 146u8, 166u8, + 150u8, 201u8, 100u8, 39u8, 24u8, 101u8, 106u8, 203u8, 5u8, 254u8, + 152u8, 200u8, ], ) } @@ -1342,10 +1340,10 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 103u8, 41u8, 156u8, 240u8, 240u8, 44u8, 136u8, 242u8, 172u8, 165u8, - 94u8, 74u8, 167u8, 215u8, 255u8, 138u8, 168u8, 73u8, 173u8, 185u8, - 50u8, 99u8, 222u8, 73u8, 47u8, 174u8, 168u8, 21u8, 110u8, 45u8, 245u8, - 100u8, + 66u8, 207u8, 170u8, 201u8, 97u8, 14u8, 247u8, 128u8, 228u8, 59u8, + 244u8, 247u8, 0u8, 196u8, 211u8, 231u8, 73u8, 247u8, 214u8, 46u8, 38u8, + 31u8, 246u8, 0u8, 255u8, 212u8, 125u8, 73u8, 114u8, 243u8, 165u8, + 115u8, ], ) } @@ -8169,9 +8167,10 @@ pub mod api { "batch", Batch { calls }, [ - 104u8, 4u8, 189u8, 40u8, 157u8, 168u8, 223u8, 156u8, 36u8, 47u8, 2u8, - 252u8, 244u8, 77u8, 248u8, 2u8, 37u8, 114u8, 151u8, 133u8, 111u8, 99u8, - 163u8, 162u8, 237u8, 46u8, 38u8, 84u8, 240u8, 106u8, 194u8, 32u8, + 133u8, 221u8, 235u8, 193u8, 91u8, 7u8, 110u8, 134u8, 44u8, 216u8, + 153u8, 186u8, 141u8, 18u8, 35u8, 164u8, 125u8, 26u8, 221u8, 179u8, + 87u8, 36u8, 7u8, 143u8, 157u8, 187u8, 247u8, 11u8, 5u8, 99u8, 33u8, + 84u8, ], ) } @@ -8201,10 +8200,10 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 58u8, 78u8, 217u8, 64u8, 173u8, 171u8, 49u8, 147u8, 195u8, 213u8, - 155u8, 112u8, 198u8, 107u8, 255u8, 126u8, 79u8, 141u8, 111u8, 60u8, - 243u8, 71u8, 65u8, 176u8, 74u8, 109u8, 143u8, 242u8, 4u8, 182u8, 243u8, - 229u8, + 89u8, 124u8, 203u8, 121u8, 79u8, 155u8, 107u8, 115u8, 184u8, 130u8, + 104u8, 88u8, 113u8, 95u8, 1u8, 95u8, 5u8, 130u8, 97u8, 224u8, 164u8, + 229u8, 156u8, 215u8, 124u8, 12u8, 220u8, 19u8, 244u8, 161u8, 34u8, + 239u8, ], ) } @@ -8231,9 +8230,9 @@ pub mod api { "batch_all", BatchAll { calls }, [ - 141u8, 157u8, 224u8, 101u8, 87u8, 136u8, 179u8, 236u8, 120u8, 34u8, - 63u8, 144u8, 140u8, 81u8, 152u8, 150u8, 122u8, 135u8, 31u8, 8u8, 112u8, - 254u8, 125u8, 113u8, 188u8, 74u8, 47u8, 167u8, 37u8, 243u8, 120u8, 4u8, + 113u8, 175u8, 42u8, 32u8, 149u8, 19u8, 249u8, 103u8, 107u8, 29u8, + 199u8, 119u8, 153u8, 64u8, 17u8, 55u8, 36u8, 179u8, 163u8, 252u8, 40u8, + 68u8, 87u8, 159u8, 201u8, 43u8, 186u8, 15u8, 203u8, 51u8, 110u8, 134u8, ], ) } @@ -8260,9 +8259,9 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 40u8, 163u8, 243u8, 170u8, 81u8, 23u8, 90u8, 204u8, 253u8, 14u8, 35u8, - 108u8, 90u8, 6u8, 175u8, 181u8, 8u8, 78u8, 7u8, 20u8, 11u8, 155u8, - 212u8, 146u8, 166u8, 232u8, 36u8, 168u8, 57u8, 77u8, 0u8, 40u8, + 22u8, 78u8, 25u8, 229u8, 141u8, 41u8, 212u8, 143u8, 191u8, 209u8, 85u8, + 50u8, 52u8, 182u8, 87u8, 90u8, 220u8, 192u8, 227u8, 22u8, 112u8, 80u8, + 219u8, 15u8, 79u8, 71u8, 223u8, 156u8, 50u8, 238u8, 206u8, 22u8, ], ) } @@ -8289,9 +8288,10 @@ pub mod api { "force_batch", ForceBatch { calls }, [ - 94u8, 38u8, 183u8, 213u8, 130u8, 203u8, 80u8, 22u8, 23u8, 47u8, 67u8, - 195u8, 162u8, 237u8, 189u8, 178u8, 53u8, 100u8, 14u8, 153u8, 0u8, - 151u8, 71u8, 26u8, 247u8, 40u8, 216u8, 33u8, 18u8, 163u8, 20u8, 150u8, + 120u8, 171u8, 148u8, 121u8, 145u8, 46u8, 33u8, 186u8, 156u8, 175u8, + 122u8, 247u8, 127u8, 199u8, 136u8, 252u8, 66u8, 80u8, 212u8, 48u8, + 91u8, 133u8, 79u8, 70u8, 2u8, 16u8, 199u8, 188u8, 135u8, 153u8, 192u8, + 43u8, ], ) } @@ -8515,10 +8515,9 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 58u8, 239u8, 109u8, 214u8, 156u8, 169u8, 183u8, 139u8, 93u8, 0u8, - 117u8, 199u8, 158u8, 203u8, 46u8, 172u8, 77u8, 109u8, 67u8, 66u8, - 161u8, 90u8, 152u8, 214u8, 76u8, 9u8, 222u8, 168u8, 213u8, 175u8, - 215u8, 157u8, + 239u8, 130u8, 103u8, 0u8, 235u8, 43u8, 173u8, 85u8, 187u8, 251u8, 87u8, + 30u8, 24u8, 228u8, 2u8, 227u8, 97u8, 44u8, 144u8, 185u8, 203u8, 192u8, + 233u8, 87u8, 85u8, 85u8, 222u8, 20u8, 248u8, 114u8, 60u8, 127u8, ], ) } @@ -8588,10 +8587,9 @@ pub mod api { max_weight, }, [ - 186u8, 3u8, 240u8, 37u8, 139u8, 153u8, 202u8, 37u8, 229u8, 219u8, - 144u8, 62u8, 197u8, 94u8, 215u8, 46u8, 78u8, 1u8, 125u8, 54u8, 37u8, - 139u8, 235u8, 97u8, 86u8, 149u8, 29u8, 253u8, 102u8, 173u8, 56u8, - 148u8, + 23u8, 197u8, 186u8, 167u8, 4u8, 196u8, 64u8, 69u8, 137u8, 201u8, 66u8, + 46u8, 29u8, 228u8, 12u8, 228u8, 202u8, 85u8, 142u8, 63u8, 202u8, 157u8, + 242u8, 22u8, 97u8, 0u8, 239u8, 190u8, 242u8, 112u8, 66u8, 35u8, ], ) } @@ -9004,10 +9002,9 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 51u8, 168u8, 34u8, 101u8, 141u8, 43u8, 88u8, 39u8, 8u8, 158u8, 170u8, - 229u8, 205u8, 158u8, 60u8, 100u8, 179u8, 128u8, 37u8, 253u8, 146u8, - 248u8, 93u8, 142u8, 221u8, 241u8, 209u8, 159u8, 211u8, 103u8, 248u8, - 239u8, + 45u8, 75u8, 70u8, 203u8, 174u8, 224u8, 54u8, 238u8, 146u8, 185u8, 77u8, + 12u8, 52u8, 100u8, 144u8, 11u8, 240u8, 41u8, 140u8, 4u8, 0u8, 58u8, + 39u8, 155u8, 238u8, 140u8, 67u8, 214u8, 119u8, 104u8, 89u8, 22u8, ], ) } @@ -9034,9 +9031,9 @@ pub mod api { weight, }, [ - 230u8, 90u8, 42u8, 229u8, 6u8, 21u8, 242u8, 19u8, 40u8, 242u8, 169u8, - 50u8, 39u8, 123u8, 141u8, 12u8, 96u8, 146u8, 14u8, 181u8, 68u8, 217u8, - 72u8, 124u8, 143u8, 123u8, 235u8, 232u8, 149u8, 154u8, 150u8, 43u8, + 137u8, 232u8, 9u8, 190u8, 69u8, 47u8, 57u8, 207u8, 54u8, 246u8, 248u8, + 221u8, 1u8, 83u8, 149u8, 19u8, 28u8, 32u8, 24u8, 165u8, 220u8, 67u8, + 76u8, 244u8, 132u8, 160u8, 137u8, 41u8, 180u8, 130u8, 220u8, 200u8, ], ) } @@ -9095,10 +9092,9 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 198u8, 33u8, 112u8, 86u8, 220u8, 207u8, 197u8, 0u8, 199u8, 204u8, - 215u8, 93u8, 81u8, 250u8, 150u8, 193u8, 171u8, 124u8, 168u8, 111u8, - 182u8, 28u8, 118u8, 222u8, 93u8, 97u8, 109u8, 83u8, 91u8, 183u8, 121u8, - 9u8, + 85u8, 36u8, 6u8, 85u8, 135u8, 161u8, 37u8, 24u8, 96u8, 12u8, 20u8, 4u8, + 7u8, 108u8, 106u8, 33u8, 73u8, 22u8, 247u8, 138u8, 220u8, 24u8, 243u8, + 126u8, 236u8, 251u8, 195u8, 79u8, 28u8, 39u8, 50u8, 248u8, ], ) } @@ -12875,7 +12871,7 @@ pub mod api { } } } - pub mod snarcos { + pub mod baby_liminal { use super::{root_mod, runtime_types}; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { @@ -12928,7 +12924,7 @@ pub mod api { pub verification_key_identifier: [::core::primitive::u8; 4usize], pub proof: ::std::vec::Vec<::core::primitive::u8>, pub public_input: ::std::vec::Vec<::core::primitive::u8>, - pub system: runtime_types::pallet_snarcos::systems::ProvingSystem, + pub system: runtime_types::pallet_baby_liminal::systems::ProvingSystem, } pub struct TransactionApi; impl TransactionApi { @@ -12946,7 +12942,7 @@ pub mod api { key: ::std::vec::Vec<::core::primitive::u8>, ) -> ::subxt::tx::StaticTxPayload { ::subxt::tx::StaticTxPayload::new( - "Snarcos", + "BabyLiminal", "store_key", StoreKey { identifier, key }, [ @@ -12964,7 +12960,7 @@ pub mod api { identifier: [::core::primitive::u8; 4usize], ) -> ::subxt::tx::StaticTxPayload { ::subxt::tx::StaticTxPayload::new( - "Snarcos", + "BabyLiminal", "delete_key", DeleteKey { identifier }, [ @@ -12984,7 +12980,7 @@ pub mod api { key: ::std::vec::Vec<::core::primitive::u8>, ) -> ::subxt::tx::StaticTxPayload { ::subxt::tx::StaticTxPayload::new( - "Snarcos", + "BabyLiminal", "overwrite_key", OverwriteKey { identifier, key }, [ @@ -13011,10 +13007,10 @@ pub mod api { verification_key_identifier: [::core::primitive::u8; 4usize], proof: ::std::vec::Vec<::core::primitive::u8>, public_input: ::std::vec::Vec<::core::primitive::u8>, - system: runtime_types::pallet_snarcos::systems::ProvingSystem, + system: runtime_types::pallet_baby_liminal::systems::ProvingSystem, ) -> ::subxt::tx::StaticTxPayload { ::subxt::tx::StaticTxPayload::new( - "Snarcos", + "BabyLiminal", "verify", Verify { verification_key_identifier, @@ -13032,7 +13028,7 @@ pub mod api { } } #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted\n\t\t\tby this pallet.\n\t\t\t"] - pub type Event = runtime_types::pallet_snarcos::pallet::Event; + pub type Event = runtime_types::pallet_baby_liminal::pallet::Event; pub mod events { use super::runtime_types; #[derive( @@ -13046,7 +13042,7 @@ pub mod api { #[doc = "Verification key has been successfully stored."] pub struct VerificationKeyStored; impl ::subxt::events::StaticEvent for VerificationKeyStored { - const PALLET: &'static str = "Snarcos"; + const PALLET: &'static str = "BabyLiminal"; const EVENT: &'static str = "VerificationKeyStored"; } #[derive( @@ -13060,7 +13056,7 @@ pub mod api { #[doc = "Verification key has been successfully deleted."] pub struct VerificationKeyDeleted; impl ::subxt::events::StaticEvent for VerificationKeyDeleted { - const PALLET: &'static str = "Snarcos"; + const PALLET: &'static str = "BabyLiminal"; const EVENT: &'static str = "VerificationKeyDeleted"; } #[derive( @@ -13074,7 +13070,7 @@ pub mod api { #[doc = "Verification key has been successfully overwritten."] pub struct VerificationKeyOverwritten; impl ::subxt::events::StaticEvent for VerificationKeyOverwritten { - const PALLET: &'static str = "Snarcos"; + const PALLET: &'static str = "BabyLiminal"; const EVENT: &'static str = "VerificationKeyOverwritten"; } #[derive( @@ -13088,7 +13084,7 @@ pub mod api { #[doc = "Proof has been successfully verified."] pub struct VerificationSucceeded; impl ::subxt::events::StaticEvent for VerificationSucceeded { - const PALLET: &'static str = "Snarcos"; + const PALLET: &'static str = "BabyLiminal"; const EVENT: &'static str = "VerificationSucceeded"; } } @@ -13110,7 +13106,7 @@ pub mod api { ::subxt::storage::address::Yes, > { ::subxt::storage::address::StaticStorageAddress::new( - "Snarcos", + "BabyLiminal", "VerificationKeys", vec![::subxt::storage::address::StorageMapKey::new( _0.borrow(), @@ -13136,7 +13132,7 @@ pub mod api { ::subxt::storage::address::Yes, > { ::subxt::storage::address::StaticStorageAddress::new( - "Snarcos", + "BabyLiminal", "VerificationKeys", Vec::new(), [ @@ -13162,7 +13158,7 @@ pub mod api { ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, > { ::subxt::constants::StaticConstantAddress::new( - "Snarcos", + "BabyLiminal", "MaximumVerificationKeyLength", [ 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, @@ -13179,7 +13175,7 @@ pub mod api { ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, > { ::subxt::constants::StaticConstantAddress::new( - "Snarcos", + "BabyLiminal", "MaximumDataLength", [ 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, @@ -13267,7 +13263,7 @@ pub mod api { #[codec(index = 20)] Identity(runtime_types::pallet_identity::pallet::Call), #[codec(index = 21)] - Snarcos(runtime_types::pallet_snarcos::pallet::Call), + BabyLiminal(runtime_types::pallet_baby_liminal::pallet::Call), } #[derive( :: subxt :: ext :: codec :: Decode, @@ -13311,7 +13307,7 @@ pub mod api { #[codec(index = 20)] Identity(runtime_types::pallet_identity::pallet::Event), #[codec(index = 21)] - Snarcos(runtime_types::pallet_snarcos::pallet::Event), + BabyLiminal(runtime_types::pallet_baby_liminal::pallet::Event), } #[derive( :: subxt :: ext :: codec :: Decode, @@ -13933,6 +13929,171 @@ pub mod api { Uncle(_1, ::core::option::Option<_2>), } } + pub mod pallet_baby_liminal { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub enum Call { + #[codec(index = 0)] + #[doc = "Stores `key` under `identifier` in `VerificationKeys` map."] + #[doc = ""] + #[doc = "Fails if:"] + #[doc = "- `key.len()` is greater than `MaximumVerificationKeyLength`, or"] + #[doc = "- `identifier` has been already used"] + #[doc = ""] + #[doc = "`key` can come from any proving system - there are no checks that verify it, in"] + #[doc = "particular, `key` can contain just trash bytes."] + store_key { + identifier: [::core::primitive::u8; 4usize], + key: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 1)] + #[doc = "Deletes a key stored under `identifier` in `VerificationKeys` map."] + #[doc = ""] + #[doc = "Can only be called by a root account."] + delete_key { + identifier: [::core::primitive::u8; 4usize], + }, + #[codec(index = 2)] + #[doc = "Overwrites a key stored under `identifier` in `VerificationKeys` map with a new value `key`"] + #[doc = ""] + #[doc = "Fails if `key.len()` is greater than `MaximumVerificationKeyLength`."] + #[doc = "Can only be called by a root account."] + overwrite_key { + identifier: [::core::primitive::u8; 4usize], + key: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 3)] + #[doc = "Verifies `proof` against `public_input` with a key that has been stored under"] + #[doc = "`verification_key_identifier`. All is done within `system` proving system."] + #[doc = ""] + #[doc = "Fails if:"] + #[doc = "- there is no verification key under `verification_key_identifier`"] + #[doc = "- verification key under `verification_key_identifier` cannot be deserialized"] + #[doc = "(e.g. it has been produced for another proving system)"] + #[doc = "- `proof` cannot be deserialized (e.g. it has been produced for another proving system)"] + #[doc = "- `public_input` cannot be deserialized (e.g. it has been produced for another proving"] + #[doc = "system)"] + #[doc = "- verifying procedure fails (e.g. incompatible verification key and proof)"] + #[doc = "- proof is incorrect"] + verify { + verification_key_identifier: [::core::primitive::u8; 4usize], + proof: ::std::vec::Vec<::core::primitive::u8>, + public_input: ::std::vec::Vec<::core::primitive::u8>, + system: runtime_types::pallet_baby_liminal::systems::ProvingSystem, + }, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/main-docs/build/events-errors/)\n\t\t\tof this pallet.\n\t\t\t"] + pub enum Error { + #[codec(index = 0)] + #[doc = "This verification key identifier is already taken."] + IdentifierAlreadyInUse, + #[codec(index = 1)] + #[doc = "There is no verification key available under this identifier."] + UnknownVerificationKeyIdentifier, + #[codec(index = 2)] + #[doc = "Provided verification key is longer than `MaximumVerificationKeyLength` limit."] + VerificationKeyTooLong, + #[codec(index = 3)] + #[doc = "Either proof or public input is longer than `MaximumDataLength` limit."] + DataTooLong, + #[codec(index = 4)] + #[doc = "Couldn't deserialize proof."] + DeserializingProofFailed, + #[codec(index = 5)] + #[doc = "Couldn't deserialize public input."] + DeserializingPublicInputFailed, + #[codec(index = 6)] + #[doc = "Couldn't deserialize verification key from storage."] + DeserializingVerificationKeyFailed, + #[codec(index = 7)] + #[doc = "Verification procedure has failed. Proof still can be correct."] + VerificationFailed( + runtime_types::pallet_baby_liminal::systems::VerificationError, + ), + #[codec(index = 8)] + #[doc = "Proof has been found as incorrect."] + IncorrectProof, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub enum Event { + #[codec(index = 0)] + #[doc = "Verification key has been successfully stored."] + VerificationKeyStored, + #[codec(index = 1)] + #[doc = "Verification key has been successfully deleted."] + VerificationKeyDeleted, + #[codec(index = 2)] + #[doc = "Verification key has been successfully overwritten."] + VerificationKeyOverwritten, + #[codec(index = 3)] + #[doc = "Proof has been successfully verified."] + VerificationSucceeded, + } + } + pub mod systems { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum ProvingSystem { + #[codec(index = 0)] + Groth16, + #[codec(index = 1)] + Gm17, + #[codec(index = 2)] + Marlin, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum VerificationError { + #[codec(index = 0)] + MalformedVerifyingKey, + #[codec(index = 1)] + AHPError, + #[codec(index = 2)] + PolynomialCommitmentError, + #[codec(index = 3)] + UnexpectedError, + } + } + } pub mod pallet_balances { use super::runtime_types; pub mod pallet { @@ -16840,151 +17001,6 @@ pub mod api { } } } - pub mod pallet_snarcos { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - Clone, - Debug, - Eq, - PartialEq, - )] - #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] - pub enum Call { - #[codec(index = 0)] - #[doc = "Stores `key` under `identifier` in `VerificationKeys` map."] - #[doc = ""] - #[doc = "Fails if:"] - #[doc = "- `key.len()` is greater than `MaximumVerificationKeyLength`, or"] - #[doc = "- `identifier` has been already used"] - #[doc = ""] - #[doc = "`key` can come from any proving system - there are no checks that verify it, in"] - #[doc = "particular, `key` can contain just trash bytes."] - store_key { - identifier: [::core::primitive::u8; 4usize], - key: ::std::vec::Vec<::core::primitive::u8>, - }, - #[codec(index = 1)] - #[doc = "Deletes a key stored under `identifier` in `VerificationKeys` map."] - #[doc = ""] - #[doc = "Can only be called by a root account."] - delete_key { - identifier: [::core::primitive::u8; 4usize], - }, - #[codec(index = 2)] - #[doc = "Overwrites a key stored under `identifier` in `VerificationKeys` map with a new value `key`"] - #[doc = ""] - #[doc = "Fails if `key.len()` is greater than `MaximumVerificationKeyLength`."] - #[doc = "Can only be called by a root account."] - overwrite_key { - identifier: [::core::primitive::u8; 4usize], - key: ::std::vec::Vec<::core::primitive::u8>, - }, - #[codec(index = 3)] - #[doc = "Verifies `proof` against `public_input` with a key that has been stored under"] - #[doc = "`verification_key_identifier`. All is done within `system` proving system."] - #[doc = ""] - #[doc = "Fails if:"] - #[doc = "- there is no verification key under `verification_key_identifier`"] - #[doc = "- verification key under `verification_key_identifier` cannot be deserialized"] - #[doc = "(e.g. it has been produced for another proving system)"] - #[doc = "- `proof` cannot be deserialized (e.g. it has been produced for another proving system)"] - #[doc = "- `public_input` cannot be deserialized (e.g. it has been produced for another proving"] - #[doc = "system)"] - #[doc = "- verifying procedure fails (e.g. incompatible verification key and proof)"] - #[doc = "- proof is incorrect"] - verify { - verification_key_identifier: [::core::primitive::u8; 4usize], - proof: ::std::vec::Vec<::core::primitive::u8>, - public_input: ::std::vec::Vec<::core::primitive::u8>, - system: runtime_types::pallet_snarcos::systems::ProvingSystem, - }, - } - #[derive( - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - Clone, - Debug, - Eq, - PartialEq, - )] - #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/main-docs/build/events-errors/)\n\t\t\tof this pallet.\n\t\t\t"] - pub enum Error { - #[codec(index = 0)] - #[doc = "This verification key identifier is already taken."] - IdentifierAlreadyInUse, - #[codec(index = 1)] - #[doc = "There is no verification key available under this identifier."] - UnknownVerificationKeyIdentifier, - #[codec(index = 2)] - #[doc = "Provided verification key is longer than `MaximumVerificationKeyLength` limit."] - VerificationKeyTooLong, - #[codec(index = 3)] - #[doc = "Either proof or public input is longer than `MaximumDataLength` limit."] - DataTooLong, - #[codec(index = 4)] - #[doc = "Couldn't deserialize proof."] - DeserializingProofFailed, - #[codec(index = 5)] - #[doc = "Couldn't deserialize public input."] - DeserializingPublicInputFailed, - #[codec(index = 6)] - #[doc = "Couldn't deserialize verification key from storage."] - DeserializingVerificationKeyFailed, - #[codec(index = 7)] - #[doc = "Verification procedure has failed. Proof still can be correct."] - VerificationFailed, - #[codec(index = 8)] - #[doc = "Proof has been found as incorrect."] - IncorrectProof, - } - #[derive( - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - Clone, - Debug, - Eq, - PartialEq, - )] - #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted\n\t\t\tby this pallet.\n\t\t\t"] - pub enum Event { - #[codec(index = 0)] - #[doc = "Verification key has been successfully stored."] - VerificationKeyStored, - #[codec(index = 1)] - #[doc = "Verification key has been successfully deleted."] - VerificationKeyDeleted, - #[codec(index = 2)] - #[doc = "Verification key has been successfully overwritten."] - VerificationKeyOverwritten, - #[codec(index = 3)] - #[doc = "Proof has been successfully verified."] - VerificationSucceeded, - } - } - pub mod systems { - use super::runtime_types; - #[derive( - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - Clone, - Debug, - Eq, - PartialEq, - )] - pub enum ProvingSystem { - #[codec(index = 0)] - Groth16, - #[codec(index = 1)] - Gm17, - #[codec(index = 2)] - Marlin, - } - } - } pub mod pallet_staking { use super::runtime_types; pub mod pallet { @@ -19877,8 +19893,8 @@ pub mod api { pub fn identity(&self) -> identity::constants::ConstantsApi { identity::constants::ConstantsApi } - pub fn snarcos(&self) -> snarcos::constants::ConstantsApi { - snarcos::constants::ConstantsApi + pub fn baby_liminal(&self) -> baby_liminal::constants::ConstantsApi { + baby_liminal::constants::ConstantsApi } } pub struct StorageApi; @@ -19945,8 +19961,8 @@ pub mod api { pub fn identity(&self) -> identity::storage::StorageApi { identity::storage::StorageApi } - pub fn snarcos(&self) -> snarcos::storage::StorageApi { - snarcos::storage::StorageApi + pub fn baby_liminal(&self) -> baby_liminal::storage::StorageApi { + baby_liminal::storage::StorageApi } } pub struct TransactionApi; @@ -20002,8 +20018,8 @@ pub mod api { pub fn identity(&self) -> identity::calls::TransactionApi { identity::calls::TransactionApi } - pub fn snarcos(&self) -> snarcos::calls::TransactionApi { - snarcos::calls::TransactionApi + pub fn baby_liminal(&self) -> baby_liminal::calls::TransactionApi { + baby_liminal::calls::TransactionApi } } #[doc = r" check whether the Client you are using is aligned with the statically generated codegen."] @@ -20013,9 +20029,9 @@ pub mod api { let runtime_metadata_hash = client.metadata().metadata_hash(&PALLETS); if runtime_metadata_hash != [ - 184u8, 75u8, 165u8, 118u8, 24u8, 136u8, 242u8, 16u8, 162u8, 22u8, 102u8, 227u8, - 209u8, 51u8, 103u8, 153u8, 169u8, 179u8, 166u8, 180u8, 8u8, 94u8, 119u8, 91u8, - 36u8, 120u8, 31u8, 194u8, 89u8, 201u8, 250u8, 173u8, + 33u8, 213u8, 174u8, 180u8, 186u8, 206u8, 107u8, 213u8, 6u8, 40u8, 152u8, 5u8, 20u8, + 170u8, 25u8, 192u8, 31u8, 20u8, 248u8, 185u8, 246u8, 7u8, 106u8, 248u8, 200u8, + 62u8, 69u8, 101u8, 92u8, 199u8, 33u8, 133u8, ] { Err(::subxt::error::MetadataError::IncompatibleMetadata) diff --git a/aleph-client/src/pallets/snarcos.rs b/aleph-client/src/pallets/baby_liminal.rs similarity index 79% rename from aleph-client/src/pallets/snarcos.rs rename to aleph-client/src/pallets/baby_liminal.rs index bcf49794fd..5b4304c833 100644 --- a/aleph-client/src/pallets/snarcos.rs +++ b/aleph-client/src/pallets/baby_liminal.rs @@ -1,10 +1,10 @@ use anyhow::Result; -pub use pallet_snarcos::VerificationKeyIdentifier; +pub use pallet_baby_liminal::VerificationKeyIdentifier; use crate::{ - aleph_runtime::RuntimeCall::Snarcos, + aleph_runtime::RuntimeCall::BabyLiminal, api, - pallet_snarcos::{ + pallet_baby_liminal::{ pallet::Call::{delete_key, overwrite_key}, systems::ProvingSystem, }, @@ -12,7 +12,7 @@ use crate::{ }; #[async_trait::async_trait] -pub trait SnarcosUserApi { +pub trait BabyLiminalUserApi { async fn store_key( &self, identifier: VerificationKeyIdentifier, @@ -31,7 +31,7 @@ pub trait SnarcosUserApi { } #[async_trait::async_trait] -pub trait SnarcosSudoApi { +pub trait BabyLiminalSudoApi { async fn delete_key( &self, identifier: VerificationKeyIdentifier, @@ -47,14 +47,14 @@ pub trait SnarcosSudoApi { } #[async_trait::async_trait] -impl SnarcosUserApi for SignedConnection { +impl BabyLiminalUserApi for SignedConnection { async fn store_key( &self, identifier: VerificationKeyIdentifier, key: Vec, status: TxStatus, ) -> Result { - let tx = api::tx().snarcos().store_key(identifier, key); + let tx = api::tx().baby_liminal().store_key(identifier, key); self.send_tx(tx, status).await } @@ -67,20 +67,20 @@ impl SnarcosUserApi for SignedConnection { status: TxStatus, ) -> Result { let tx = api::tx() - .snarcos() + .baby_liminal() .verify(identifier, proof, public_input, system); self.send_tx(tx, status).await } } #[async_trait::async_trait] -impl SnarcosSudoApi for RootConnection { +impl BabyLiminalSudoApi for RootConnection { async fn delete_key( &self, identifier: VerificationKeyIdentifier, status: TxStatus, ) -> Result { - let call = Snarcos(delete_key { identifier }); + let call = BabyLiminal(delete_key { identifier }); self.sudo_unchecked(call, status).await } @@ -90,7 +90,7 @@ impl SnarcosSudoApi for RootConnection { key: Vec, status: TxStatus, ) -> Result { - let call = Snarcos(overwrite_key { identifier, key }); + let call = BabyLiminal(overwrite_key { identifier, key }); self.sudo_unchecked(call, status).await } } diff --git a/aleph-client/src/pallets/mod.rs b/aleph-client/src/pallets/mod.rs index 712885b1d9..5df282b735 100644 --- a/aleph-client/src/pallets/mod.rs +++ b/aleph-client/src/pallets/mod.rs @@ -1,12 +1,12 @@ pub mod aleph; pub mod author; +pub mod baby_liminal; pub mod balances; pub mod contract; pub mod elections; pub mod fee; pub mod multisig; pub mod session; -pub mod snarcos; pub mod staking; pub mod system; pub mod treasury; diff --git a/bin/cliain/Cargo.lock b/bin/cliain/Cargo.lock index 33a241594a..8bc7dc5088 100644 --- a/bin/cliain/Cargo.lock +++ b/bin/cliain/Cargo.lock @@ -60,8 +60,8 @@ dependencies = [ "hex", "ink_metadata", "log", + "pallet-baby-liminal", "pallet-contracts-primitives", - "pallet-snarcos", "parity-scale-codec", "primitives", "serde", @@ -2457,6 +2457,37 @@ dependencies = [ "sp-std 4.0.0", ] +[[package]] +name = "pallet-baby-liminal" +version = "0.1.0" +dependencies = [ + "ark-bls12-381", + "ark-crypto-primitives", + "ark-ec", + "ark-ff", + "ark-gm17", + "ark-groth16", + "ark-marlin", + "ark-poly", + "ark-poly-commit", + "ark-r1cs-std", + "ark-relations", + "ark-serialize", + "ark-snark", + "ark-std", + "blake2 0.9.2", + "digest 0.9.0", + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "primitives", + "scale-info", + "sp-core 6.0.0", + "sp-io 6.0.0", + "sp-std 4.0.0", +] + [[package]] name = "pallet-contracts-primitives" version = "6.0.0" @@ -2490,37 +2521,6 @@ dependencies = [ "sp-trie 6.0.0", ] -[[package]] -name = "pallet-snarcos" -version = "0.1.0" -dependencies = [ - "ark-bls12-381", - "ark-crypto-primitives", - "ark-ec", - "ark-ff", - "ark-gm17", - "ark-groth16", - "ark-marlin", - "ark-poly", - "ark-poly-commit", - "ark-r1cs-std", - "ark-relations", - "ark-serialize", - "ark-snark", - "ark-std", - "blake2 0.9.2", - "digest 0.9.0", - "frame-benchmarking", - "frame-support", - "frame-system", - "parity-scale-codec", - "primitives", - "scale-info", - "sp-core 6.0.0", - "sp-io 6.0.0", - "sp-std 4.0.0", -] - [[package]] name = "pallet-staking" version = "4.0.0-dev" diff --git a/bin/cliain/src/snarcos.rs b/bin/cliain/src/baby_liminal.rs similarity index 81% rename from bin/cliain/src/snarcos.rs rename to bin/cliain/src/baby_liminal.rs index 47ea38acac..cb10c63fb3 100644 --- a/bin/cliain/src/snarcos.rs +++ b/bin/cliain/src/baby_liminal.rs @@ -1,8 +1,8 @@ use std::{fs, path::PathBuf}; use aleph_client::{ - pallet_snarcos::systems::ProvingSystem, - pallets::snarcos::{SnarcosSudoApi, SnarcosUserApi, VerificationKeyIdentifier}, + pallet_baby_liminal::systems::ProvingSystem, + pallets::baby_liminal::{BabyLiminalSudoApi, BabyLiminalUserApi, VerificationKeyIdentifier}, RootConnection, SignedConnection, TxStatus, }; use anyhow::Result; @@ -11,7 +11,7 @@ fn read_bytes(file: &PathBuf) -> Result> { fs::read(file).map_err(|e| e.into()) } -/// Calls `pallet_snarcos::store_key`. +/// Calls `pallet_baby_liminal::store_key`. pub async fn store_key( connection: SignedConnection, identifier: VerificationKeyIdentifier, @@ -24,7 +24,7 @@ pub async fn store_key( .map(|_| ()) } -/// Calls `pallet_snarcos::delete_key`. +/// Calls `pallet_baby_liminal::delete_key`. pub async fn delete_key( connection: RootConnection, identifier: VerificationKeyIdentifier, @@ -35,7 +35,7 @@ pub async fn delete_key( .map(|_| ()) } -/// Calls `pallet_snarcos::overwrite_key`. +/// Calls `pallet_baby_liminal::overwrite_key`. pub async fn overwrite_key( connection: RootConnection, identifier: VerificationKeyIdentifier, @@ -48,7 +48,7 @@ pub async fn overwrite_key( .map(|_| ()) } -/// Calls `pallet_snarcos::verify`. +/// Calls `pallet_baby_liminal::verify`. pub async fn verify( connection: SignedConnection, identifier: VerificationKeyIdentifier, diff --git a/bin/cliain/src/commands.rs b/bin/cliain/src/commands.rs index cbe73a819d..36b2461c6b 100644 --- a/bin/cliain/src/commands.rs +++ b/bin/cliain/src/commands.rs @@ -4,8 +4,8 @@ use std::{ }; use aleph_client::{ - pallet_snarcos::systems::ProvingSystem, pallets::snarcos::VerificationKeyIdentifier, AccountId, - TxStatus, + pallet_baby_liminal::systems::ProvingSystem, pallets::baby_liminal::VerificationKeyIdentifier, + AccountId, TxStatus, }; use clap::{clap_derive::ValueEnum, Args, Subcommand}; use primitives::{Balance, BlockNumber, CommitteeSeats, SessionIndex}; @@ -149,7 +149,7 @@ impl From for TxStatus { } #[derive(Debug, Clone, Subcommand)] -pub enum Snarcos { +pub enum BabyLiminal { /// Store a verification key under an identifier in the pallet's storage. StoreKey { /// The key identifier. @@ -506,9 +506,9 @@ pub enum Command { expected_state: ExtrinsicState, }, - /// Interact with `pallet_snarcos`. + /// Interact with `pallet_baby_liminal`. #[clap(subcommand)] - Snarcos(Snarcos), + BabyLiminal(BabyLiminal), /// Interact with `relations` crate. /// @@ -519,7 +519,8 @@ pub enum Command { mod parsing { use aleph_client::{ - pallet_snarcos::systems::ProvingSystem, pallets::snarcos::VerificationKeyIdentifier, + pallet_baby_liminal::systems::ProvingSystem, + pallets::baby_liminal::VerificationKeyIdentifier, }; use anyhow::anyhow; diff --git a/bin/cliain/src/lib.rs b/bin/cliain/src/lib.rs index 54d01feb98..024096097b 100644 --- a/bin/cliain/src/lib.rs +++ b/bin/cliain/src/lib.rs @@ -1,10 +1,10 @@ +mod baby_liminal; mod commands; mod contracts; mod finalization; mod keys; mod runtime; mod secret; -mod snarcos; mod snark_relations; mod staking; mod transfer; @@ -14,7 +14,8 @@ mod version_upgrade; mod vesting; use aleph_client::{keypair_from_string, Connection, RootConnection, SignedConnection}; -pub use commands::{Command, Snarcos, SnarkRelation}; +pub use baby_liminal::{delete_key, overwrite_key, store_key, verify}; +pub use commands::{BabyLiminal, Command, SnarkRelation}; pub use contracts::{ call, instantiate, instantiate_with_code, owner_info, remove_code, upload_code, }; @@ -22,7 +23,6 @@ pub use finalization::{finalize, set_emergency_finalizer}; pub use keys::{next_session_keys, prepare_keys, rotate_keys, set_keys}; pub use runtime::update_runtime; pub use secret::prompt_password_hidden; -pub use snarcos::{delete_key, overwrite_key, store_key, verify}; pub use snark_relations::{ generate_keys, generate_keys_from_srs, generate_proof, generate_srs, verify as verify_proof, NonUniversalProvingSystem, UniversalProvingSystem, diff --git a/bin/cliain/src/main.rs b/bin/cliain/src/main.rs index c36e0220c7..e04ac3a0f1 100644 --- a/bin/cliain/src/main.rs +++ b/bin/cliain/src/main.rs @@ -9,7 +9,7 @@ use cliain::{ remove_code, rotate_keys, schedule_upgrade, set_emergency_finalizer, set_keys, set_staking_limits, store_key, transfer, treasury_approve, treasury_propose, treasury_reject, update_runtime, upload_code, validate, verify, verify_proof, vest, vest_other, vested_transfer, - Command, ConnectionConfig, Snarcos, SnarkRelation, + BabyLiminal, Command, ConnectionConfig, SnarkRelation, }; use log::{error, info}; @@ -248,8 +248,8 @@ async fn main() { Err(why) => error!("Unable to schedule an upgrade {:?}", why), }, - Command::Snarcos(cmd) => match cmd { - Snarcos::StoreKey { + Command::BabyLiminal(cmd) => match cmd { + BabyLiminal::StoreKey { identifier, vk_file, } => { @@ -259,12 +259,12 @@ async fn main() { error!("Unable to store key: {why:?}") } } - Snarcos::DeleteKey { identifier } => { + BabyLiminal::DeleteKey { identifier } => { if let Err(why) = delete_key(cfg.get_root_connection().await, identifier).await { error!("Unable to delete key: {why:?}") } } - Snarcos::OverwriteKey { + BabyLiminal::OverwriteKey { identifier, vk_file, } => { @@ -274,7 +274,7 @@ async fn main() { error!("Unable to overwrite key: {why:?}") } } - Snarcos::Verify { + BabyLiminal::Verify { identifier, proof_file, input_file, diff --git a/bin/runtime/Cargo.toml b/bin/runtime/Cargo.toml index 0b66fe2749..ca3e60fb88 100644 --- a/bin/runtime/Cargo.toml +++ b/bin/runtime/Cargo.toml @@ -63,7 +63,7 @@ frame-benchmarking = { default-features = false, git = "https://github.com/Cardi primitives = { path = "../../primitives", default-features = false } pallet-aleph = { path = "../../pallets/aleph", default-features = false } pallet-elections = { path = "../../pallets/elections", default-features = false } -pallet-snarcos = { path = "../../pallets/snarcos", default-features = false } +pallet-baby-liminal = { path = "../../pallets/baby-liminal", default-features = false } [build-dependencies] substrate-wasm-builder = { git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "liminal-v0.9.32" } @@ -84,7 +84,7 @@ std = [ "pallet-randomness-collective-flip/std", "pallet-session/std", "pallet-staking/std", - "pallet-snarcos/std", + "pallet-baby-liminal/std", "pallet-sudo/std", "pallet-timestamp/std", "pallet-transaction-payment/std", @@ -128,7 +128,7 @@ try-runtime = [ "pallet-authorship/try-runtime", "pallet-balances/try-runtime", "pallet-elections/try-runtime", - "pallet-snarcos/try-runtime", + "pallet-baby-liminal/try-runtime", "pallet-identity/try-runtime", "pallet-randomness-collective-flip/try-runtime", "pallet-session/try-runtime", @@ -146,5 +146,5 @@ enable_treasury_proposals = [] runtime-benchmarks = [ "frame-system/runtime-benchmarks", "frame-benchmarking/runtime-benchmarks", - "pallet-snarcos/runtime-benchmarks", + "pallet-baby-liminal/runtime-benchmarks", ] diff --git a/bin/runtime/src/chain_extension/snarcos-extension/Cargo.lock b/bin/runtime/src/chain_extension/baby-liminal-extension/Cargo.lock similarity index 99% rename from bin/runtime/src/chain_extension/snarcos-extension/Cargo.lock rename to bin/runtime/src/chain_extension/baby-liminal-extension/Cargo.lock index 157323a6f9..0cc9628c44 100644 --- a/bin/runtime/src/chain_extension/snarcos-extension/Cargo.lock +++ b/bin/runtime/src/chain_extension/baby-liminal-extension/Cargo.lock @@ -699,7 +699,7 @@ dependencies = [ ] [[package]] -name = "snarcos-extension" +name = "baby-liminal-extension" version = "0.1.0" dependencies = [ "ink", diff --git a/bin/runtime/src/chain_extension/snarcos-extension/Cargo.toml b/bin/runtime/src/chain_extension/baby-liminal-extension/Cargo.toml similarity index 93% rename from bin/runtime/src/chain_extension/snarcos-extension/Cargo.toml rename to bin/runtime/src/chain_extension/baby-liminal-extension/Cargo.toml index 0ad1148e3d..23efea50db 100644 --- a/bin/runtime/src/chain_extension/snarcos-extension/Cargo.toml +++ b/bin/runtime/src/chain_extension/baby-liminal-extension/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "snarcos-extension" +name = "baby-liminal-extension" version = "0.1.0" authors = ["Cardinal Cryptography"] edition = "2021" @@ -12,7 +12,7 @@ publish = false members = [] [lib] -name = "snarcos_extension" +name = "baby_liminal_extension" path = "lib.rs" crate-type = ["cdylib", "rlib"] diff --git a/bin/runtime/src/chain_extension/snarcos-extension/lib.rs b/bin/runtime/src/chain_extension/baby-liminal-extension/lib.rs similarity index 75% rename from bin/runtime/src/chain_extension/snarcos-extension/lib.rs rename to bin/runtime/src/chain_extension/baby-liminal-extension/lib.rs index bb0622e5b4..dc1d23df53 100644 --- a/bin/runtime/src/chain_extension/snarcos-extension/lib.rs +++ b/bin/runtime/src/chain_extension/baby-liminal-extension/lib.rs @@ -6,18 +6,18 @@ use scale::{Decode, Encode}; use scale_info::TypeInfo; use sp_std::vec::Vec; -/// Gathers all the possible errors that might occur while calling `pallet_snarcos::store_key` or -/// `pallet_snarcos::verify`. +/// Gathers all the possible errors that might occur while calling `pallet_baby_liminal::store_key` or +/// `pallet_baby_liminal::verify`. /// -/// Every variant is already documented in `pallet_snarcos`. +/// Every variant is already documented in `pallet_baby_liminal`. #[derive(Copy, Clone, Eq, PartialEq, Debug, Decode, Encode)] #[cfg_attr(feature = "std", derive(TypeInfo))] -pub enum SnarcosError { - // `pallet_snarcos::store_key` errors +pub enum BabyLiminalError { + // `pallet_baby_liminal::store_key` errors IdentifierAlreadyInUse, VerificationKeyTooLong, - // `pallet_snarcos::verify` errors + // `pallet_baby_liminal::verify` errors UnknownVerificationKeyIdentifier, DeserializingProofFailed, DeserializingPublicInputFailed, @@ -31,17 +31,17 @@ pub enum SnarcosError { UnknownError, } -impl ink::env::chain_extension::FromStatusCode for SnarcosError { +impl ink::env::chain_extension::FromStatusCode for BabyLiminalError { fn from_status_code(status_code: u32) -> Result<(), Self> { match status_code { // Success codes 10_000 | 11_000 => Ok(()), - // `pallet_snarcos::store_key` errors + // `pallet_baby_liminal::store_key` errors 10_001 => Err(Self::VerificationKeyTooLong), 10_002 => Err(Self::IdentifierAlreadyInUse), - // `pallet_snarcos::verify` errors + // `pallet_baby_liminal::verify` errors 11_001 => Err(Self::DeserializingProofFailed), 11_002 => Err(Self::DeserializingPublicInputFailed), 11_003 => Err(Self::UnknownVerificationKeyIdentifier), @@ -54,10 +54,10 @@ impl ink::env::chain_extension::FromStatusCode for SnarcosError { } } -/// Copied from `pallet_snarcos`. +/// Copied from `pallet_baby_liminal`. pub type VerificationKeyIdentifier = [u8; 4]; -/// Copied from `pallet_snarcos`. +/// Copied from `pallet_baby_liminal`. #[derive(Copy, Clone, Eq, PartialEq, Debug, Decode, Encode)] #[cfg_attr(feature = "std", derive(TypeInfo))] pub enum ProvingSystem { @@ -67,18 +67,19 @@ pub enum ProvingSystem { } #[ink::chain_extension] -pub trait SnarcosExtension { - type ErrorCode = SnarcosError; +pub trait BabyLiminalExtension { + type ErrorCode = BabyLiminalError; - /// Directly call `pallet_snarcos::store_key`. + /// Directly call `pallet_baby_liminal::store_key`. /// - /// The extension method ID matches the one declared in runtime: `SNARCOS_STORE_KEY_FUNC_ID`. + /// The extension method ID matches the one declared in runtime: + /// `BABY_LIMINAL_STORE_KEY_FUNC_ID`. #[ink(extension = 41, returns_result = false)] fn store_key(identifier: VerificationKeyIdentifier, key: Vec); - /// Directly call `pallet_snarcos::verify`. + /// Directly call `pallet_baby_liminal::verify`. /// - /// The extension method ID matches the one declared in runtime: `SNARCOS_VERIFY_FUNC_ID`. + /// The extension method ID matches the one declared in runtime: `BABY_LIMINAL_VERIFY_FUNC_ID`. #[ink(extension = 42, returns_result = false)] fn verify( identifier: VerificationKeyIdentifier, @@ -90,7 +91,7 @@ pub trait SnarcosExtension { #[derive(Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "std", derive(scale_info::TypeInfo))] -/// All default, except `ChainExtension`, which is set to `SnarcosExtension`. +/// All default, except `ChainExtension`, which is set to `BabyLiminalExtension`. pub enum DefaultEnvironment {} impl Environment for DefaultEnvironment { @@ -102,5 +103,5 @@ impl Environment for DefaultEnvironment { type Timestamp = ::Timestamp; type BlockNumber = ::BlockNumber; - type ChainExtension = SnarcosExtension; + type ChainExtension = BabyLiminalExtension; } diff --git a/bin/runtime/src/chain_extension/environment.rs b/bin/runtime/src/chain_extension/environment.rs index 354b4755e6..bf45e349da 100644 --- a/bin/runtime/src/chain_extension/environment.rs +++ b/bin/runtime/src/chain_extension/environment.rs @@ -11,8 +11,8 @@ use crate::chain_extension::ByteCount; /// Abstraction around `pallet_contracts::chain_extension::Environment`. Makes testing easier. /// -/// Gathers all the methods that are used by `SnarcosChainExtension`. For now, all operations are -/// performed in the `BufInBufOut` mode, so we don't have to take care of other modes. +/// Gathers all the methods that are used by `BabyLiminalChainExtension`. For now, all operations +/// are performed in the `BufInBufOut` mode, so we don't have to take care of other modes. /// /// Each method is already documented in `pallet_contracts::chain_extension`. pub(super) trait Environment: Sized { diff --git a/bin/runtime/src/chain_extension/executor.rs b/bin/runtime/src/chain_extension/executor.rs index e93288c66c..bafaf15f92 100644 --- a/bin/runtime/src/chain_extension/executor.rs +++ b/bin/runtime/src/chain_extension/executor.rs @@ -1,14 +1,14 @@ use frame_support::dispatch::Weight; -use pallet_snarcos::{Error, Pallet as Snarcos, ProvingSystem, VerificationKeyIdentifier}; +use pallet_baby_liminal::{Error, Pallet as BabyLiminal, ProvingSystem, VerificationKeyIdentifier}; use sp_std::vec::Vec; use crate::Runtime; /// Abstraction around `Runtime`. Makes testing easier. /// -/// Gathers all the methods that are used by `SnarcosChainExtension`. +/// Gathers all the methods that are used by `BabyLiminalChainExtension`. /// -/// Each method is already documented in `pallet_snarcos`. +/// Each method is already documented in `pallet_baby_liminal`. pub(super) trait Executor: Sized { /// The error returned from dispatchables is generic. For most purposes however, it doesn't /// matter what type will be passed there. Normally, `Runtime` will be the generic argument, @@ -36,7 +36,7 @@ impl Executor for Runtime { identifier: VerificationKeyIdentifier, key: Vec, ) -> Result<(), Error> { - Snarcos::::bare_store_key(identifier, key) + BabyLiminal::::bare_store_key(identifier, key) } fn verify( @@ -45,6 +45,11 @@ impl Executor for Runtime { public_input: Vec, system: ProvingSystem, ) -> Result<(), (Error, Option)> { - Snarcos::::bare_verify(verification_key_identifier, proof, public_input, system) + BabyLiminal::::bare_verify( + verification_key_identifier, + proof, + public_input, + system, + ) } } diff --git a/bin/runtime/src/chain_extension/mod.rs b/bin/runtime/src/chain_extension/mod.rs index aaa00b71da..488843b7ed 100644 --- a/bin/runtime/src/chain_extension/mod.rs +++ b/bin/runtime/src/chain_extension/mod.rs @@ -2,10 +2,10 @@ use codec::{Decode, Encode}; use environment::Environment; use executor::Executor; use frame_support::{log::error, weights::Weight}; +use pallet_baby_liminal::{Config, Error, ProvingSystem, VerificationKeyIdentifier, WeightInfo}; use pallet_contracts::chain_extension::{ ChainExtension, Environment as SubstrateEnvironment, Ext, InitState, RetVal, SysConfig, }; -use pallet_snarcos::{Config, Error, ProvingSystem, VerificationKeyIdentifier, WeightInfo}; use sp_core::crypto::UncheckedFrom; use sp_runtime::DispatchError; use sp_std::{mem::size_of, vec::Vec}; @@ -17,29 +17,29 @@ mod executor; #[cfg(test)] mod tests; -pub const SNARCOS_STORE_KEY_FUNC_ID: u32 = 41; -pub const SNARCOS_VERIFY_FUNC_ID: u32 = 42; - -// Return codes for `SNARCOS_STORE_KEY_FUNC_ID`. -pub const SNARCOS_STORE_KEY_OK: u32 = 10_000; -pub const SNARCOS_STORE_KEY_TOO_LONG_KEY: u32 = 10_001; -pub const SNARCOS_STORE_KEY_IDENTIFIER_IN_USE: u32 = 10_002; -pub const SNARCOS_STORE_KEY_ERROR_UNKNOWN: u32 = 10_003; - -// Return codes for `SNARCOS_VERIFY_FUNC_ID`. -pub const SNARCOS_VERIFY_OK: u32 = 11_000; -pub const SNARCOS_VERIFY_DESERIALIZING_PROOF_FAIL: u32 = 11_001; -pub const SNARCOS_VERIFY_DESERIALIZING_INPUT_FAIL: u32 = 11_002; -pub const SNARCOS_VERIFY_UNKNOWN_IDENTIFIER: u32 = 11_003; -pub const SNARCOS_VERIFY_DESERIALIZING_KEY_FAIL: u32 = 11_004; -pub const SNARCOS_VERIFY_VERIFICATION_FAIL: u32 = 11_005; -pub const SNARCOS_VERIFY_INCORRECT_PROOF: u32 = 11_006; -pub const SNARCOS_VERIFY_ERROR_UNKNOWN: u32 = 11_007; +pub const BABY_LIMINAL_STORE_KEY_FUNC_ID: u32 = 41; +pub const BABY_LIMINAL_VERIFY_FUNC_ID: u32 = 42; + +// Return codes for `BABY_LIMINAL_STORE_KEY_FUNC_ID`. +pub const BABY_LIMINAL_STORE_KEY_OK: u32 = 10_000; +pub const BABY_LIMINAL_STORE_KEY_TOO_LONG_KEY: u32 = 10_001; +pub const BABY_LIMINAL_STORE_KEY_IDENTIFIER_IN_USE: u32 = 10_002; +pub const BABY_LIMINAL_STORE_KEY_ERROR_UNKNOWN: u32 = 10_003; + +// Return codes for `BABY_LIMINAL_VERIFY_FUNC_ID`. +pub const BABY_LIMINAL_VERIFY_OK: u32 = 11_000; +pub const BABY_LIMINAL_VERIFY_DESERIALIZING_PROOF_FAIL: u32 = 11_001; +pub const BABY_LIMINAL_VERIFY_DESERIALIZING_INPUT_FAIL: u32 = 11_002; +pub const BABY_LIMINAL_VERIFY_UNKNOWN_IDENTIFIER: u32 = 11_003; +pub const BABY_LIMINAL_VERIFY_DESERIALIZING_KEY_FAIL: u32 = 11_004; +pub const BABY_LIMINAL_VERIFY_VERIFICATION_FAIL: u32 = 11_005; +pub const BABY_LIMINAL_VERIFY_INCORRECT_PROOF: u32 = 11_006; +pub const BABY_LIMINAL_VERIFY_ERROR_UNKNOWN: u32 = 11_007; #[derive(Default)] -pub struct SnarcosChainExtension; +pub struct BabyLiminalChainExtension; -impl ChainExtension for SnarcosChainExtension { +impl ChainExtension for BabyLiminalChainExtension { fn call( &mut self, env: SubstrateEnvironment, @@ -50,10 +50,12 @@ impl ChainExtension for SnarcosChainExtension { let func_id = env.func_id() as u32; match func_id { - SNARCOS_STORE_KEY_FUNC_ID => { - Self::snarcos_store_key::<_, Runtime>(env.buf_in_buf_out()) + BABY_LIMINAL_STORE_KEY_FUNC_ID => { + Self::baby_liminal_store_key::<_, Runtime>(env.buf_in_buf_out()) + } + BABY_LIMINAL_VERIFY_FUNC_ID => { + Self::baby_liminal_verify::<_, Runtime>(env.buf_in_buf_out()) } - SNARCOS_VERIFY_FUNC_ID => Self::snarcos_verify::<_, Runtime>(env.buf_in_buf_out()), _ => { error!("Called an unregistered `func_id`: {}", func_id); Err(DispatchError::Other("Unimplemented func_id")) @@ -112,8 +114,8 @@ fn weight_of_verify(system: Option) -> Weight { } } -impl SnarcosChainExtension { - fn snarcos_store_key( +impl BabyLiminalChainExtension { + fn baby_liminal_store_key( mut env: Env, ) -> Result { // Check if it makes sense to read and decode data. This is only an upperbound for the key @@ -123,7 +125,7 @@ impl SnarcosChainExtension { .in_len() .saturating_sub(size_of::() as ByteCount); if approx_key_length > MaximumVerificationKeyLength::get() { - return Ok(RetVal::Converging(SNARCOS_STORE_KEY_TOO_LONG_KEY)); + return Ok(RetVal::Converging(BABY_LIMINAL_STORE_KEY_TOO_LONG_KEY)); } // We charge now - even if decoding fails and we shouldn't touch storage, we have to incur @@ -148,18 +150,18 @@ impl SnarcosChainExtension { ); let return_status = match Exc::store_key(args.identifier, args.key) { - Ok(_) => SNARCOS_STORE_KEY_OK, + Ok(_) => BABY_LIMINAL_STORE_KEY_OK, // In case `DispatchResultWithPostInfo` was returned (or some simpler equivalent for // `bare_store_key`), we could have adjusted weight. However, for the storing key action // it doesn't make much sense. - Err(VerificationKeyTooLong) => SNARCOS_STORE_KEY_TOO_LONG_KEY, - Err(IdentifierAlreadyInUse) => SNARCOS_STORE_KEY_IDENTIFIER_IN_USE, - _ => SNARCOS_STORE_KEY_ERROR_UNKNOWN, + Err(VerificationKeyTooLong) => BABY_LIMINAL_STORE_KEY_TOO_LONG_KEY, + Err(IdentifierAlreadyInUse) => BABY_LIMINAL_STORE_KEY_IDENTIFIER_IN_USE, + _ => BABY_LIMINAL_STORE_KEY_ERROR_UNKNOWN, }; Ok(RetVal::Converging(return_status)) } - fn snarcos_verify( + fn baby_liminal_verify( mut env: Env, ) -> Result { // We charge optimistically, i.e. assuming that decoding succeeds and the verification @@ -167,7 +169,7 @@ impl SnarcosChainExtension { // possible fee. We will adjust it as soon as possible. let pre_charge = env.charge_weight(weight_of_verify(None))?; - // Parsing is done here for similar reasons as in `Self::snarcos_store_key`. + // Parsing is done here for similar reasons as in `Self::baby_liminal_store_key`. let bytes = env.read(env.in_len())?; let args: VerifyArgs = VerifyArgs::decode(&mut &*bytes) @@ -187,15 +189,15 @@ impl SnarcosChainExtension { }; let return_status = match result { - Ok(_) => SNARCOS_VERIFY_OK, + Ok(_) => BABY_LIMINAL_VERIFY_OK, Err((error, _)) => match error { - DeserializingProofFailed => SNARCOS_VERIFY_DESERIALIZING_PROOF_FAIL, - DeserializingPublicInputFailed => SNARCOS_VERIFY_DESERIALIZING_INPUT_FAIL, - UnknownVerificationKeyIdentifier => SNARCOS_VERIFY_UNKNOWN_IDENTIFIER, - DeserializingVerificationKeyFailed => SNARCOS_VERIFY_DESERIALIZING_KEY_FAIL, - VerificationFailed(_) => SNARCOS_VERIFY_VERIFICATION_FAIL, - IncorrectProof => SNARCOS_VERIFY_INCORRECT_PROOF, - _ => SNARCOS_VERIFY_ERROR_UNKNOWN, + DeserializingProofFailed => BABY_LIMINAL_VERIFY_DESERIALIZING_PROOF_FAIL, + DeserializingPublicInputFailed => BABY_LIMINAL_VERIFY_DESERIALIZING_INPUT_FAIL, + UnknownVerificationKeyIdentifier => BABY_LIMINAL_VERIFY_UNKNOWN_IDENTIFIER, + DeserializingVerificationKeyFailed => BABY_LIMINAL_VERIFY_DESERIALIZING_KEY_FAIL, + VerificationFailed(_) => BABY_LIMINAL_VERIFY_VERIFICATION_FAIL, + IncorrectProof => BABY_LIMINAL_VERIFY_INCORRECT_PROOF, + _ => BABY_LIMINAL_VERIFY_ERROR_UNKNOWN, }, }; Ok(RetVal::Converging(return_status)) diff --git a/bin/runtime/src/chain_extension/tests/environment.rs b/bin/runtime/src/chain_extension/tests/environment.rs index 460c92ea20..18f547103e 100644 --- a/bin/runtime/src/chain_extension/tests/environment.rs +++ b/bin/runtime/src/chain_extension/tests/environment.rs @@ -7,10 +7,10 @@ use super::*; /// Trait serving as a type-level flag indicating which method we are testing. pub(super) trait FunctionMode {} -/// We are testing `pallet_snarcos::store_key`. +/// We are testing `pallet_baby_liminal::store_key`. pub(super) enum StoreKeyMode {} impl FunctionMode for StoreKeyMode {} -/// We are testing `pallet_snarcos::verify`. +/// We are testing `pallet_baby_liminal::verify`. pub(super) enum VerifyMode {} impl FunctionMode for VerifyMode {} @@ -30,7 +30,7 @@ trait _Read { fn _read(&self, max_len: ByteCount) -> Result, DispatchError>; } -/// Testing counterpart for `pallet_snarcos::chain_extension::Environment`. +/// Testing counterpart for `pallet_baby_liminal::chain_extension::Environment`. pub(super) struct MockedEnvironment { /// Channel to report all charges. /// @@ -107,7 +107,7 @@ impl _Read for MockedEnvironment { } } -/// In case we are testing `pallet_snarcos::store_key`, we might want to approximate how long is the +/// In case we are testing `pallet_baby_liminal::store_key`, we might want to approximate how long is the /// verifying key. /// /// The returned value will be an upperbound - it will be the sum of the whole key encoding diff --git a/bin/runtime/src/chain_extension/tests/executor.rs b/bin/runtime/src/chain_extension/tests/executor.rs index bd48c75c43..951c1e5b26 100644 --- a/bin/runtime/src/chain_extension/tests/executor.rs +++ b/bin/runtime/src/chain_extension/tests/executor.rs @@ -1,8 +1,8 @@ -use pallet_snarcos::{Error as SnarcosError, ProvingSystem, VerificationKeyIdentifier}; +use pallet_baby_liminal::{Error as BabyLiminalError, ProvingSystem, VerificationKeyIdentifier}; use crate::{chain_extension::executor::Executor, Weight}; -type Error = SnarcosError<()>; +type Error = BabyLiminalError<()>; /// Describes how the `Executor` should behave when one of its methods is called. #[derive(Clone, Eq, PartialEq)] diff --git a/bin/runtime/src/chain_extension/tests/mod.rs b/bin/runtime/src/chain_extension/tests/mod.rs index 2b80f33436..c72f4cef88 100644 --- a/bin/runtime/src/chain_extension/tests/mod.rs +++ b/bin/runtime/src/chain_extension/tests/mod.rs @@ -2,7 +2,7 @@ use core::iter::Sum; use std::{ops::Neg, sync::mpsc::Receiver}; use environment::{CorruptedMode, MockedEnvironment, StandardMode, StoreKeyMode, VerifyMode}; -use pallet_snarcos::VerificationError; +use pallet_baby_liminal::VerificationError; use super::*; use crate::chain_extension::tests::executor::{ @@ -70,7 +70,7 @@ fn charged(charging_listener: Receiver) -> RevertibleWeight { #[test] fn extension_is_enabled() { - assert!(SnarcosChainExtension::enabled()) + assert!(BabyLiminalChainExtension::enabled()) } #[test] @@ -79,7 +79,7 @@ fn store_key__charges_before_reading() { let (env, charging_listener) = MockedEnvironment::::new(41, None); let key_length = env.approx_key_len(); - let result = SnarcosChainExtension::snarcos_store_key::<_, Panicker>(env); + let result = BabyLiminalChainExtension::baby_liminal_store_key::<_, Panicker>(env); assert!(matches!(result, Err(_))); assert_eq!( @@ -96,11 +96,11 @@ fn store_key__too_much_to_read() { Some(Box::new(|| panic!("Shouldn't read anything at all"))), ); - let result = SnarcosChainExtension::snarcos_store_key::<_, Panicker>(env); + let result = BabyLiminalChainExtension::baby_liminal_store_key::<_, Panicker>(env); assert!(matches!( result, - Ok(RetVal::Converging(SNARCOS_STORE_KEY_TOO_LONG_KEY)) + Ok(RetVal::Converging(BABY_LIMINAL_STORE_KEY_TOO_LONG_KEY)) )); assert_eq!(charged(charging_listener), RevertibleWeight::ZERO); } @@ -109,7 +109,7 @@ fn simulate_store_key(expected_ret_val: u32) { let (env, charging_listener) = MockedEnvironment::::new(store_key_args()); - let result = SnarcosChainExtension::snarcos_store_key::<_, Exc>(env); + let result = BabyLiminalChainExtension::baby_liminal_store_key::<_, Exc>(env); assert!(matches!(result, Ok(RetVal::Converging(ret_val)) if ret_val == expected_ret_val)); assert_eq!( @@ -122,7 +122,7 @@ fn simulate_store_key(expected_ret_val: u32) { #[allow(non_snake_case)] fn store_key__pallet_says_too_long_vk() { simulate_store_key::>( - SNARCOS_STORE_KEY_TOO_LONG_KEY, + BABY_LIMINAL_STORE_KEY_TOO_LONG_KEY, ) } @@ -130,14 +130,14 @@ fn store_key__pallet_says_too_long_vk() { #[allow(non_snake_case)] fn store_key__pallet_says_identifier_in_use() { simulate_store_key::>( - SNARCOS_STORE_KEY_IDENTIFIER_IN_USE, + BABY_LIMINAL_STORE_KEY_IDENTIFIER_IN_USE, ) } #[test] #[allow(non_snake_case)] fn store_key__positive_scenario() { - simulate_store_key::(SNARCOS_STORE_KEY_OK) + simulate_store_key::(BABY_LIMINAL_STORE_KEY_OK) } #[test] @@ -145,7 +145,7 @@ fn store_key__positive_scenario() { fn verify__charges_before_reading() { let (env, charging_listener) = MockedEnvironment::::new(41, None); - let result = SnarcosChainExtension::snarcos_verify::<_, Panicker>(env); + let result = BabyLiminalChainExtension::baby_liminal_verify::<_, Panicker>(env); assert!(matches!(result, Err(_))); assert_eq!(charged(charging_listener), weight_of_verify(None).into()); @@ -159,7 +159,7 @@ fn simulate_verify, const EXPECT let (env, charging_listener) = MockedEnvironment::::new(verify_args()); - let result = SnarcosChainExtension::snarcos_verify::<_, Exc>(env); + let result = BabyLiminalChainExtension::baby_liminal_verify::<_, Exc>(env); assert!(matches!(result, Ok(RetVal::Converging(ret_val)) if ret_val == EXPECTED_RET_VAL)); @@ -177,7 +177,7 @@ fn verify__pallet_says_proof_deserialization_failed() { simulate_verify::< VerifyErrorer<{ DeserializingProofFailed }, { Some(ADJUSTED_WEIGHT) }>, { Some(ADJUSTED_WEIGHT) }, - SNARCOS_VERIFY_DESERIALIZING_PROOF_FAIL, + BABY_LIMINAL_VERIFY_DESERIALIZING_PROOF_FAIL, >() } @@ -187,7 +187,7 @@ fn verify__pallet_says_input_deserialization_failed() { simulate_verify::< VerifyErrorer<{ DeserializingPublicInputFailed }, { Some(ADJUSTED_WEIGHT) }>, { Some(ADJUSTED_WEIGHT) }, - SNARCOS_VERIFY_DESERIALIZING_INPUT_FAIL, + BABY_LIMINAL_VERIFY_DESERIALIZING_INPUT_FAIL, >() } @@ -197,7 +197,7 @@ fn verify__pallet_says_no_such_vk() { simulate_verify::< VerifyErrorer<{ UnknownVerificationKeyIdentifier }, { Some(ADJUSTED_WEIGHT) }>, { Some(ADJUSTED_WEIGHT) }, - SNARCOS_VERIFY_UNKNOWN_IDENTIFIER, + BABY_LIMINAL_VERIFY_UNKNOWN_IDENTIFIER, >() } @@ -207,7 +207,7 @@ fn verify__pallet_says_vk_deserialization_failed() { simulate_verify::< VerifyErrorer<{ DeserializingVerificationKeyFailed }, { Some(ADJUSTED_WEIGHT) }>, { Some(ADJUSTED_WEIGHT) }, - SNARCOS_VERIFY_DESERIALIZING_KEY_FAIL, + BABY_LIMINAL_VERIFY_DESERIALIZING_KEY_FAIL, >() } @@ -217,7 +217,7 @@ fn verify__pallet_says_verification_failed() { simulate_verify::< VerifyErrorer<{ VerificationFailed(VerificationError::MalformedVerifyingKey) }, { None }>, { None }, - SNARCOS_VERIFY_VERIFICATION_FAIL, + BABY_LIMINAL_VERIFY_VERIFICATION_FAIL, >() } @@ -227,12 +227,12 @@ fn verify__pallet_says_incorrect_proof() { simulate_verify::< VerifyErrorer<{ IncorrectProof }, { None }>, { None }, - SNARCOS_VERIFY_INCORRECT_PROOF, + BABY_LIMINAL_VERIFY_INCORRECT_PROOF, >() } #[test] #[allow(non_snake_case)] fn verify__positive_scenario() { - simulate_verify::() + simulate_verify::() } diff --git a/bin/runtime/src/lib.rs b/bin/runtime/src/lib.rs index 6a97053c75..3cd83e478f 100644 --- a/bin/runtime/src/lib.rs +++ b/bin/runtime/src/lib.rs @@ -62,7 +62,7 @@ use sp_std::prelude::*; use sp_version::NativeVersion; use sp_version::RuntimeVersion; -use crate::chain_extension::SnarcosChainExtension; +use crate::chain_extension::BabyLiminalChainExtension; /// An index to a block. pub type BlockNumber = u32; @@ -332,9 +332,9 @@ parameter_types! { pub const MaximumDataLength: u32 = 10_000; } -impl pallet_snarcos::Config for Runtime { +impl pallet_baby_liminal::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type WeightInfo = pallet_snarcos::AlephWeight; + type WeightInfo = pallet_baby_liminal::AlephWeight; type MaximumVerificationKeyLength = MaximumVerificationKeyLength; type MaximumDataLength = MaximumDataLength; } @@ -690,7 +690,7 @@ impl pallet_contracts::Config for Runtime { type DepositPerByte = DepositPerByte; type WeightPrice = pallet_transaction_payment::Pallet; type WeightInfo = pallet_contracts::weights::SubstrateWeight; - type ChainExtension = SnarcosChainExtension; + type ChainExtension = BabyLiminalChainExtension; type DeletionQueueDepth = DeletionQueueDepth; type DeletionWeightLimit = DeletionWeightLimit; type Schedule = Schedule; @@ -754,7 +754,7 @@ construct_runtime!( Contracts: pallet_contracts, NominationPools: pallet_nomination_pools, Identity: pallet_identity, - Snarcos: pallet_snarcos, + BabyLiminal: pallet_baby_liminal, } ); @@ -794,7 +794,7 @@ pub type Executive = frame_executive::Executive< #[cfg(feature = "runtime-benchmarks")] mod benches { - frame_benchmarking::define_benchmarks!([pallet_snarcos, Snarcos]); + frame_benchmarking::define_benchmarks!([pallet_baby_liminal, BabyLiminal]); } impl_runtime_apis! { diff --git a/e2e-tests/Cargo.lock b/e2e-tests/Cargo.lock index 81f7fae761..8b866bb557 100644 --- a/e2e-tests/Cargo.lock +++ b/e2e-tests/Cargo.lock @@ -87,7 +87,7 @@ dependencies = [ "ink_metadata", "log", "pallet-contracts-primitives", - "pallet-snarcos", + "pallet-baby-liminal", "parity-scale-codec", "primitives", "serde", @@ -2504,7 +2504,7 @@ dependencies = [ ] [[package]] -name = "pallet-snarcos" +name = "pallet-baby-liminal" version = "0.1.0" dependencies = [ "ark-bls12-381", diff --git a/pallets/snarcos/Cargo.toml b/pallets/baby-liminal/Cargo.toml similarity index 99% rename from pallets/snarcos/Cargo.toml rename to pallets/baby-liminal/Cargo.toml index c9ec6e64f7..2aac99dc7d 100644 --- a/pallets/snarcos/Cargo.toml +++ b/pallets/baby-liminal/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "pallet-snarcos" +name = "pallet-baby-liminal" version = "0.1.0" authors = ["Cardinal Cryptography"] edition = "2021" diff --git a/pallets/snarcos/LICENSE b/pallets/baby-liminal/LICENSE similarity index 100% rename from pallets/snarcos/LICENSE rename to pallets/baby-liminal/LICENSE diff --git a/pallets/snarcos/src/benchmarking/import.rs b/pallets/baby-liminal/src/benchmarking/import.rs similarity index 98% rename from pallets/snarcos/src/benchmarking/import.rs rename to pallets/baby-liminal/src/benchmarking/import.rs index 60a193a1a9..2a404e5fef 100644 --- a/pallets/snarcos/src/benchmarking/import.rs +++ b/pallets/baby-liminal/src/benchmarking/import.rs @@ -11,7 +11,7 @@ pub(super) struct Artifacts { /// /// Example of usage: /// ```rust, ignore -/// # use pallet_snarcos::get_artifacts; +/// # use pallet_baby_liminal::get_artifacts; /// /// let Artifacts { key, proof, input } = get_artifacts!(Groth16, LinearEquation); /// ``` diff --git a/pallets/snarcos/src/benchmarking/mod.rs b/pallets/baby-liminal/src/benchmarking/mod.rs similarity index 89% rename from pallets/snarcos/src/benchmarking/mod.rs rename to pallets/baby-liminal/src/benchmarking/mod.rs index 0e644d06a7..b284810a0d 100644 --- a/pallets/snarcos/src/benchmarking/mod.rs +++ b/pallets/baby-liminal/src/benchmarking/mod.rs @@ -13,14 +13,14 @@ //! //! cargo run --release -p aleph-node --features runtime-benchmarks -- benchmark pallet \ //! --chain=chainspec.json \ -//! --pallet=pallet_snarcos \ +//! --pallet=pallet_baby_liminal \ //! --extrinsic='*' \ //! --steps=20 \ //! --repeat=50 \ //! --template=.maintain/pallet-weight-template.hbs \ //! --execution=wasm \ //! --wasm-execution=compiled \ -//! --output=pallets/snarcos/src/weights.rs +//! --output=pallets/baby-liminal/src/weights.rs //! ``` mod import; diff --git a/pallets/snarcos/src/benchmarking/suite.rs b/pallets/baby-liminal/src/benchmarking/suite.rs similarity index 100% rename from pallets/snarcos/src/benchmarking/suite.rs rename to pallets/baby-liminal/src/benchmarking/suite.rs diff --git a/pallets/snarcos/src/lib.rs b/pallets/baby-liminal/src/lib.rs similarity index 100% rename from pallets/snarcos/src/lib.rs rename to pallets/baby-liminal/src/lib.rs diff --git a/pallets/snarcos/src/resources/gm17/linear_equation.proof.bytes b/pallets/baby-liminal/src/resources/gm17/linear_equation.proof.bytes similarity index 100% rename from pallets/snarcos/src/resources/gm17/linear_equation.proof.bytes rename to pallets/baby-liminal/src/resources/gm17/linear_equation.proof.bytes diff --git a/pallets/snarcos/src/resources/gm17/linear_equation.public_input.bytes b/pallets/baby-liminal/src/resources/gm17/linear_equation.public_input.bytes similarity index 100% rename from pallets/snarcos/src/resources/gm17/linear_equation.public_input.bytes rename to pallets/baby-liminal/src/resources/gm17/linear_equation.public_input.bytes diff --git a/pallets/snarcos/src/resources/gm17/linear_equation.vk.bytes b/pallets/baby-liminal/src/resources/gm17/linear_equation.vk.bytes similarity index 100% rename from pallets/snarcos/src/resources/gm17/linear_equation.vk.bytes rename to pallets/baby-liminal/src/resources/gm17/linear_equation.vk.bytes diff --git a/pallets/snarcos/src/resources/gm17/merkle_tree_1024.proof.bytes b/pallets/baby-liminal/src/resources/gm17/merkle_tree_1024.proof.bytes similarity index 100% rename from pallets/snarcos/src/resources/gm17/merkle_tree_1024.proof.bytes rename to pallets/baby-liminal/src/resources/gm17/merkle_tree_1024.proof.bytes diff --git a/pallets/snarcos/src/resources/gm17/merkle_tree_1024.public_input.bytes b/pallets/baby-liminal/src/resources/gm17/merkle_tree_1024.public_input.bytes similarity index 100% rename from pallets/snarcos/src/resources/gm17/merkle_tree_1024.public_input.bytes rename to pallets/baby-liminal/src/resources/gm17/merkle_tree_1024.public_input.bytes diff --git a/pallets/snarcos/src/resources/gm17/merkle_tree_1024.vk.bytes b/pallets/baby-liminal/src/resources/gm17/merkle_tree_1024.vk.bytes similarity index 100% rename from pallets/snarcos/src/resources/gm17/merkle_tree_1024.vk.bytes rename to pallets/baby-liminal/src/resources/gm17/merkle_tree_1024.vk.bytes diff --git a/pallets/snarcos/src/resources/gm17/merkle_tree_64.proof.bytes b/pallets/baby-liminal/src/resources/gm17/merkle_tree_64.proof.bytes similarity index 100% rename from pallets/snarcos/src/resources/gm17/merkle_tree_64.proof.bytes rename to pallets/baby-liminal/src/resources/gm17/merkle_tree_64.proof.bytes diff --git a/pallets/snarcos/src/resources/gm17/merkle_tree_64.public_input.bytes b/pallets/baby-liminal/src/resources/gm17/merkle_tree_64.public_input.bytes similarity index 100% rename from pallets/snarcos/src/resources/gm17/merkle_tree_64.public_input.bytes rename to pallets/baby-liminal/src/resources/gm17/merkle_tree_64.public_input.bytes diff --git a/pallets/snarcos/src/resources/gm17/merkle_tree_64.vk.bytes b/pallets/baby-liminal/src/resources/gm17/merkle_tree_64.vk.bytes similarity index 100% rename from pallets/snarcos/src/resources/gm17/merkle_tree_64.vk.bytes rename to pallets/baby-liminal/src/resources/gm17/merkle_tree_64.vk.bytes diff --git a/pallets/snarcos/src/resources/gm17/merkle_tree_8.proof.bytes b/pallets/baby-liminal/src/resources/gm17/merkle_tree_8.proof.bytes similarity index 100% rename from pallets/snarcos/src/resources/gm17/merkle_tree_8.proof.bytes rename to pallets/baby-liminal/src/resources/gm17/merkle_tree_8.proof.bytes diff --git a/pallets/snarcos/src/resources/gm17/merkle_tree_8.public_input.bytes b/pallets/baby-liminal/src/resources/gm17/merkle_tree_8.public_input.bytes similarity index 100% rename from pallets/snarcos/src/resources/gm17/merkle_tree_8.public_input.bytes rename to pallets/baby-liminal/src/resources/gm17/merkle_tree_8.public_input.bytes diff --git a/pallets/snarcos/src/resources/gm17/merkle_tree_8.vk.bytes b/pallets/baby-liminal/src/resources/gm17/merkle_tree_8.vk.bytes similarity index 100% rename from pallets/snarcos/src/resources/gm17/merkle_tree_8.vk.bytes rename to pallets/baby-liminal/src/resources/gm17/merkle_tree_8.vk.bytes diff --git a/pallets/snarcos/src/resources/gm17/xor.proof.bytes b/pallets/baby-liminal/src/resources/gm17/xor.proof.bytes similarity index 100% rename from pallets/snarcos/src/resources/gm17/xor.proof.bytes rename to pallets/baby-liminal/src/resources/gm17/xor.proof.bytes diff --git a/pallets/snarcos/src/resources/gm17/xor.public_input.bytes b/pallets/baby-liminal/src/resources/gm17/xor.public_input.bytes similarity index 100% rename from pallets/snarcos/src/resources/gm17/xor.public_input.bytes rename to pallets/baby-liminal/src/resources/gm17/xor.public_input.bytes diff --git a/pallets/snarcos/src/resources/gm17/xor.vk.bytes b/pallets/baby-liminal/src/resources/gm17/xor.vk.bytes similarity index 100% rename from pallets/snarcos/src/resources/gm17/xor.vk.bytes rename to pallets/baby-liminal/src/resources/gm17/xor.vk.bytes diff --git a/pallets/snarcos/src/resources/groth16/linear_equation.proof.bytes b/pallets/baby-liminal/src/resources/groth16/linear_equation.proof.bytes similarity index 100% rename from pallets/snarcos/src/resources/groth16/linear_equation.proof.bytes rename to pallets/baby-liminal/src/resources/groth16/linear_equation.proof.bytes diff --git a/pallets/snarcos/src/resources/groth16/linear_equation.public_input.bytes b/pallets/baby-liminal/src/resources/groth16/linear_equation.public_input.bytes similarity index 100% rename from pallets/snarcos/src/resources/groth16/linear_equation.public_input.bytes rename to pallets/baby-liminal/src/resources/groth16/linear_equation.public_input.bytes diff --git a/pallets/snarcos/src/resources/groth16/linear_equation.vk.bytes b/pallets/baby-liminal/src/resources/groth16/linear_equation.vk.bytes similarity index 100% rename from pallets/snarcos/src/resources/groth16/linear_equation.vk.bytes rename to pallets/baby-liminal/src/resources/groth16/linear_equation.vk.bytes diff --git a/pallets/snarcos/src/resources/groth16/merkle_tree_1024.proof.bytes b/pallets/baby-liminal/src/resources/groth16/merkle_tree_1024.proof.bytes similarity index 100% rename from pallets/snarcos/src/resources/groth16/merkle_tree_1024.proof.bytes rename to pallets/baby-liminal/src/resources/groth16/merkle_tree_1024.proof.bytes diff --git a/pallets/snarcos/src/resources/groth16/merkle_tree_1024.public_input.bytes b/pallets/baby-liminal/src/resources/groth16/merkle_tree_1024.public_input.bytes similarity index 100% rename from pallets/snarcos/src/resources/groth16/merkle_tree_1024.public_input.bytes rename to pallets/baby-liminal/src/resources/groth16/merkle_tree_1024.public_input.bytes diff --git a/pallets/snarcos/src/resources/groth16/merkle_tree_1024.vk.bytes b/pallets/baby-liminal/src/resources/groth16/merkle_tree_1024.vk.bytes similarity index 100% rename from pallets/snarcos/src/resources/groth16/merkle_tree_1024.vk.bytes rename to pallets/baby-liminal/src/resources/groth16/merkle_tree_1024.vk.bytes diff --git a/pallets/snarcos/src/resources/groth16/merkle_tree_64.proof.bytes b/pallets/baby-liminal/src/resources/groth16/merkle_tree_64.proof.bytes similarity index 100% rename from pallets/snarcos/src/resources/groth16/merkle_tree_64.proof.bytes rename to pallets/baby-liminal/src/resources/groth16/merkle_tree_64.proof.bytes diff --git a/pallets/snarcos/src/resources/groth16/merkle_tree_64.public_input.bytes b/pallets/baby-liminal/src/resources/groth16/merkle_tree_64.public_input.bytes similarity index 100% rename from pallets/snarcos/src/resources/groth16/merkle_tree_64.public_input.bytes rename to pallets/baby-liminal/src/resources/groth16/merkle_tree_64.public_input.bytes diff --git a/pallets/snarcos/src/resources/groth16/merkle_tree_64.vk.bytes b/pallets/baby-liminal/src/resources/groth16/merkle_tree_64.vk.bytes similarity index 100% rename from pallets/snarcos/src/resources/groth16/merkle_tree_64.vk.bytes rename to pallets/baby-liminal/src/resources/groth16/merkle_tree_64.vk.bytes diff --git a/pallets/snarcos/src/resources/groth16/merkle_tree_8.proof.bytes b/pallets/baby-liminal/src/resources/groth16/merkle_tree_8.proof.bytes similarity index 100% rename from pallets/snarcos/src/resources/groth16/merkle_tree_8.proof.bytes rename to pallets/baby-liminal/src/resources/groth16/merkle_tree_8.proof.bytes diff --git a/pallets/snarcos/src/resources/groth16/merkle_tree_8.public_input.bytes b/pallets/baby-liminal/src/resources/groth16/merkle_tree_8.public_input.bytes similarity index 100% rename from pallets/snarcos/src/resources/groth16/merkle_tree_8.public_input.bytes rename to pallets/baby-liminal/src/resources/groth16/merkle_tree_8.public_input.bytes diff --git a/pallets/snarcos/src/resources/groth16/merkle_tree_8.vk.bytes b/pallets/baby-liminal/src/resources/groth16/merkle_tree_8.vk.bytes similarity index 100% rename from pallets/snarcos/src/resources/groth16/merkle_tree_8.vk.bytes rename to pallets/baby-liminal/src/resources/groth16/merkle_tree_8.vk.bytes diff --git a/pallets/snarcos/src/resources/groth16/xor.proof.bytes b/pallets/baby-liminal/src/resources/groth16/xor.proof.bytes similarity index 100% rename from pallets/snarcos/src/resources/groth16/xor.proof.bytes rename to pallets/baby-liminal/src/resources/groth16/xor.proof.bytes diff --git a/pallets/snarcos/src/resources/groth16/xor.public_input.bytes b/pallets/baby-liminal/src/resources/groth16/xor.public_input.bytes similarity index 100% rename from pallets/snarcos/src/resources/groth16/xor.public_input.bytes rename to pallets/baby-liminal/src/resources/groth16/xor.public_input.bytes diff --git a/pallets/snarcos/src/resources/groth16/xor.vk.bytes b/pallets/baby-liminal/src/resources/groth16/xor.vk.bytes similarity index 100% rename from pallets/snarcos/src/resources/groth16/xor.vk.bytes rename to pallets/baby-liminal/src/resources/groth16/xor.vk.bytes diff --git a/pallets/snarcos/src/resources/marlin/linear_equation.proof.bytes b/pallets/baby-liminal/src/resources/marlin/linear_equation.proof.bytes similarity index 100% rename from pallets/snarcos/src/resources/marlin/linear_equation.proof.bytes rename to pallets/baby-liminal/src/resources/marlin/linear_equation.proof.bytes diff --git a/pallets/snarcos/src/resources/marlin/linear_equation.public_input.bytes b/pallets/baby-liminal/src/resources/marlin/linear_equation.public_input.bytes similarity index 100% rename from pallets/snarcos/src/resources/marlin/linear_equation.public_input.bytes rename to pallets/baby-liminal/src/resources/marlin/linear_equation.public_input.bytes diff --git a/pallets/snarcos/src/resources/marlin/linear_equation.vk.bytes b/pallets/baby-liminal/src/resources/marlin/linear_equation.vk.bytes similarity index 100% rename from pallets/snarcos/src/resources/marlin/linear_equation.vk.bytes rename to pallets/baby-liminal/src/resources/marlin/linear_equation.vk.bytes diff --git a/pallets/snarcos/src/resources/marlin/merkle_tree_1024.proof.bytes b/pallets/baby-liminal/src/resources/marlin/merkle_tree_1024.proof.bytes similarity index 100% rename from pallets/snarcos/src/resources/marlin/merkle_tree_1024.proof.bytes rename to pallets/baby-liminal/src/resources/marlin/merkle_tree_1024.proof.bytes diff --git a/pallets/snarcos/src/resources/marlin/merkle_tree_1024.public_input.bytes b/pallets/baby-liminal/src/resources/marlin/merkle_tree_1024.public_input.bytes similarity index 100% rename from pallets/snarcos/src/resources/marlin/merkle_tree_1024.public_input.bytes rename to pallets/baby-liminal/src/resources/marlin/merkle_tree_1024.public_input.bytes diff --git a/pallets/snarcos/src/resources/marlin/merkle_tree_1024.vk.bytes b/pallets/baby-liminal/src/resources/marlin/merkle_tree_1024.vk.bytes similarity index 100% rename from pallets/snarcos/src/resources/marlin/merkle_tree_1024.vk.bytes rename to pallets/baby-liminal/src/resources/marlin/merkle_tree_1024.vk.bytes diff --git a/pallets/snarcos/src/resources/marlin/merkle_tree_64.proof.bytes b/pallets/baby-liminal/src/resources/marlin/merkle_tree_64.proof.bytes similarity index 100% rename from pallets/snarcos/src/resources/marlin/merkle_tree_64.proof.bytes rename to pallets/baby-liminal/src/resources/marlin/merkle_tree_64.proof.bytes diff --git a/pallets/snarcos/src/resources/marlin/merkle_tree_64.public_input.bytes b/pallets/baby-liminal/src/resources/marlin/merkle_tree_64.public_input.bytes similarity index 100% rename from pallets/snarcos/src/resources/marlin/merkle_tree_64.public_input.bytes rename to pallets/baby-liminal/src/resources/marlin/merkle_tree_64.public_input.bytes diff --git a/pallets/snarcos/src/resources/marlin/merkle_tree_64.vk.bytes b/pallets/baby-liminal/src/resources/marlin/merkle_tree_64.vk.bytes similarity index 100% rename from pallets/snarcos/src/resources/marlin/merkle_tree_64.vk.bytes rename to pallets/baby-liminal/src/resources/marlin/merkle_tree_64.vk.bytes diff --git a/pallets/snarcos/src/resources/marlin/merkle_tree_8.proof.bytes b/pallets/baby-liminal/src/resources/marlin/merkle_tree_8.proof.bytes similarity index 100% rename from pallets/snarcos/src/resources/marlin/merkle_tree_8.proof.bytes rename to pallets/baby-liminal/src/resources/marlin/merkle_tree_8.proof.bytes diff --git a/pallets/snarcos/src/resources/marlin/merkle_tree_8.public_input.bytes b/pallets/baby-liminal/src/resources/marlin/merkle_tree_8.public_input.bytes similarity index 100% rename from pallets/snarcos/src/resources/marlin/merkle_tree_8.public_input.bytes rename to pallets/baby-liminal/src/resources/marlin/merkle_tree_8.public_input.bytes diff --git a/pallets/snarcos/src/resources/marlin/merkle_tree_8.vk.bytes b/pallets/baby-liminal/src/resources/marlin/merkle_tree_8.vk.bytes similarity index 100% rename from pallets/snarcos/src/resources/marlin/merkle_tree_8.vk.bytes rename to pallets/baby-liminal/src/resources/marlin/merkle_tree_8.vk.bytes diff --git a/pallets/snarcos/src/resources/marlin/xor.proof.bytes b/pallets/baby-liminal/src/resources/marlin/xor.proof.bytes similarity index 100% rename from pallets/snarcos/src/resources/marlin/xor.proof.bytes rename to pallets/baby-liminal/src/resources/marlin/xor.proof.bytes diff --git a/pallets/snarcos/src/resources/marlin/xor.public_input.bytes b/pallets/baby-liminal/src/resources/marlin/xor.public_input.bytes similarity index 100% rename from pallets/snarcos/src/resources/marlin/xor.public_input.bytes rename to pallets/baby-liminal/src/resources/marlin/xor.public_input.bytes diff --git a/pallets/snarcos/src/resources/marlin/xor.vk.bytes b/pallets/baby-liminal/src/resources/marlin/xor.vk.bytes similarity index 100% rename from pallets/snarcos/src/resources/marlin/xor.vk.bytes rename to pallets/baby-liminal/src/resources/marlin/xor.vk.bytes diff --git a/pallets/snarcos/src/systems.rs b/pallets/baby-liminal/src/systems.rs similarity index 100% rename from pallets/snarcos/src/systems.rs rename to pallets/baby-liminal/src/systems.rs diff --git a/pallets/snarcos/src/tests/mod.rs b/pallets/baby-liminal/src/tests/mod.rs similarity index 100% rename from pallets/snarcos/src/tests/mod.rs rename to pallets/baby-liminal/src/tests/mod.rs diff --git a/pallets/snarcos/src/tests/setup.rs b/pallets/baby-liminal/src/tests/setup.rs similarity index 91% rename from pallets/snarcos/src/tests/setup.rs rename to pallets/baby-liminal/src/tests/setup.rs index f3b5f0d883..71626ba400 100644 --- a/pallets/snarcos/src/tests/setup.rs +++ b/pallets/baby-liminal/src/tests/setup.rs @@ -12,7 +12,7 @@ use frame_system::mocking::{MockBlock, MockUncheckedExtrinsic}; use sp_io::TestExternalities; use sp_runtime::traits::BlakeTwo256; -use crate as pallet_snarcos; +use crate as pallet_baby_liminal; construct_runtime!( pub enum TestRuntime where @@ -21,7 +21,7 @@ construct_runtime!( UncheckedExtrinsic = MockUncheckedExtrinsic, { System: frame_system::{Pallet, Call, Storage, Config, Event}, - Snarcos: pallet_snarcos::{Pallet, Call, Storage, Event}, + BabyLiminal: pallet_baby_liminal::{Pallet, Call, Storage, Event}, } ); @@ -52,7 +52,7 @@ impl frame_system::Config for TestRuntime { type MaxConsumers = ConstU32<16>; } -impl pallet_snarcos::Config for TestRuntime { +impl pallet_baby_liminal::Config for TestRuntime { type RuntimeEvent = RuntimeEvent; type WeightInfo = (); type MaximumVerificationKeyLength = ConstU32<10_000>; diff --git a/pallets/snarcos/src/tests/suite.rs b/pallets/baby-liminal/src/tests/suite.rs similarity index 81% rename from pallets/snarcos/src/tests/suite.rs rename to pallets/baby-liminal/src/tests/suite.rs index bae2bd31ff..686eb20396 100644 --- a/pallets/snarcos/src/tests/suite.rs +++ b/pallets/baby-liminal/src/tests/suite.rs @@ -5,7 +5,7 @@ use sp_runtime::traits::Get; use super::setup::*; use crate::{Error, ProvingSystem, VerificationError, VerificationKeyIdentifier, VerificationKeys}; -type Snarcos = crate::Pallet; +type BabyLiminal = crate::Pallet; const IDENTIFIER: VerificationKeyIdentifier = [0; 4]; const SYSTEM: ProvingSystem = ProvingSystem::Groth16; @@ -37,7 +37,7 @@ fn put_key() { #[test] fn stores_vk_with_fresh_identifier() { new_test_ext().execute_with(|| { - assert_ok!(Snarcos::store_key(caller(), IDENTIFIER, vk())); + assert_ok!(BabyLiminal::store_key(caller(), IDENTIFIER, vk())); let stored_key = VerificationKeys::::get(IDENTIFIER); assert!(stored_key.is_some()); @@ -51,7 +51,7 @@ fn does_not_overwrite_registered_key() { put_key(); assert_err!( - Snarcos::store_key(caller(), IDENTIFIER, vk()), + BabyLiminal::store_key(caller(), IDENTIFIER, vk()), Error::::IdentifierAlreadyInUse ); }); @@ -61,7 +61,7 @@ fn does_not_overwrite_registered_key() { fn caller_cannot_delete_key() { new_test_ext().execute_with(|| { put_key(); - assert_err!(Snarcos::delete_key(caller(), IDENTIFIER), BadOrigin); + assert_err!(BabyLiminal::delete_key(caller(), IDENTIFIER), BadOrigin); }); } @@ -69,7 +69,7 @@ fn caller_cannot_delete_key() { fn sudo_can_delete_key() { new_test_ext().execute_with(|| { put_key(); - assert_ok!(Snarcos::delete_key(root(), IDENTIFIER)); + assert_ok!(BabyLiminal::delete_key(root(), IDENTIFIER)); }); } @@ -78,7 +78,7 @@ fn caller_cannot_overwrite_key() { new_test_ext().execute_with(|| { put_key(); assert_err!( - Snarcos::overwrite_key(caller(), IDENTIFIER, vk()), + BabyLiminal::overwrite_key(caller(), IDENTIFIER, vk()), BadOrigin ); }); @@ -88,7 +88,7 @@ fn caller_cannot_overwrite_key() { fn sudo_can_overwrite_key() { new_test_ext().execute_with(|| { put_key(); - assert_ok!(Snarcos::overwrite_key(root(), IDENTIFIER, vk())); + assert_ok!(BabyLiminal::overwrite_key(root(), IDENTIFIER, vk())); }); } @@ -98,7 +98,7 @@ fn does_not_store_too_long_key() { let limit: u32 = ::MaximumVerificationKeyLength::get(); assert_err!( - Snarcos::store_key(caller(), IDENTIFIER, vec![0; (limit + 1) as usize]), + BabyLiminal::store_key(caller(), IDENTIFIER, vec![0; (limit + 1) as usize]), Error::::VerificationKeyTooLong ); }); @@ -109,7 +109,7 @@ fn verifies_proof() { new_test_ext().execute_with(|| { put_key(); - assert_ok!(Snarcos::verify( + assert_ok!(BabyLiminal::verify( caller(), IDENTIFIER, proof(), @@ -124,7 +124,7 @@ fn verify_shouts_when_data_is_too_long() { new_test_ext().execute_with(|| { let limit: u32 = ::MaximumDataLength::get(); - let result = Snarcos::verify( + let result = BabyLiminal::verify( caller(), IDENTIFIER, vec![0; (limit + 1) as usize], @@ -137,7 +137,7 @@ fn verify_shouts_when_data_is_too_long() { ); assert!(result.unwrap_err().post_info.actual_weight.is_some()); - let result = Snarcos::verify( + let result = BabyLiminal::verify( caller(), IDENTIFIER, proof(), @@ -155,7 +155,7 @@ fn verify_shouts_when_data_is_too_long() { #[test] fn verify_shouts_when_no_key_was_registered() { new_test_ext().execute_with(|| { - let result = Snarcos::verify(caller(), IDENTIFIER, proof(), input(), SYSTEM); + let result = BabyLiminal::verify(caller(), IDENTIFIER, proof(), input(), SYSTEM); assert_err!( result.map_err(|e| e.error), @@ -173,7 +173,7 @@ fn verify_shouts_when_key_is_not_deserializable() { BoundedVec::try_from(vec![0, 1, 2]).unwrap(), ); - let result = Snarcos::verify(caller(), IDENTIFIER, proof(), input(), SYSTEM); + let result = BabyLiminal::verify(caller(), IDENTIFIER, proof(), input(), SYSTEM); assert_err!( result.map_err(|e| e.error), @@ -188,7 +188,7 @@ fn verify_shouts_when_proof_is_not_deserializable() { new_test_ext().execute_with(|| { put_key(); - let result = Snarcos::verify(caller(), IDENTIFIER, input(), input(), SYSTEM); + let result = BabyLiminal::verify(caller(), IDENTIFIER, input(), input(), SYSTEM); assert_err!( result.map_err(|e| e.error), @@ -203,7 +203,7 @@ fn verify_shouts_when_input_is_not_deserializable() { new_test_ext().execute_with(|| { put_key(); - let result = Snarcos::verify(caller(), IDENTIFIER, proof(), proof(), SYSTEM); + let result = BabyLiminal::verify(caller(), IDENTIFIER, proof(), proof(), SYSTEM); assert_err!( result.map_err(|e| e.error), @@ -219,7 +219,8 @@ fn verify_shouts_when_verification_fails() { put_key(); let other_input = include_bytes!("../resources/groth16/linear_equation.public_input.bytes"); - let result = Snarcos::verify(caller(), IDENTIFIER, proof(), other_input.to_vec(), SYSTEM); + let result = + BabyLiminal::verify(caller(), IDENTIFIER, proof(), other_input.to_vec(), SYSTEM); assert_err!( result, @@ -235,7 +236,8 @@ fn verify_shouts_when_proof_is_incorrect() { put_key(); let other_proof = include_bytes!("../resources/groth16/linear_equation.proof.bytes"); - let result = Snarcos::verify(caller(), IDENTIFIER, other_proof.to_vec(), input(), SYSTEM); + let result = + BabyLiminal::verify(caller(), IDENTIFIER, other_proof.to_vec(), input(), SYSTEM); assert_err!(result, Error::::IncorrectProof); assert!(result.unwrap_err().post_info.actual_weight.is_none()); diff --git a/pallets/snarcos/src/weights.rs b/pallets/baby-liminal/src/weights.rs similarity index 85% rename from pallets/snarcos/src/weights.rs rename to pallets/baby-liminal/src/weights.rs index 1ca648a900..bd2c13618d 100644 --- a/pallets/snarcos/src/weights.rs +++ b/pallets/baby-liminal/src/weights.rs @@ -1,4 +1,4 @@ -//! Autogenerated weights for pallet_snarcos +//! Autogenerated weights for pallet_baby_liminal //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev //! DATE: 2022-12-15, STEPS: `20`, REPEAT: 50, LOW RANGE: `[]`, HIGH RANGE: `[]` @@ -9,14 +9,14 @@ // benchmark // pallet // --chain=chainspec.json -// --pallet=pallet_snarcos +// --pallet=pallet_baby_liminal // --extrinsic=* // --steps=20 // --repeat=50 // --template=.maintain/pallet-weight-template.hbs // --execution=wasm // --wasm-execution=compiled -// --output=pallets/snarcos/src/weights.rs +// --output=pallets/baby-liminal/src/weights.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -25,7 +25,7 @@ use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; use sp_std::marker::PhantomData; -/// Weight functions needed for pallet_snarcos. +/// Weight functions needed for pallet_baby_liminal. pub trait WeightInfo { fn store_key(key_length: u32) -> Weight; fn overwrite_key(key_length: u32) -> Weight; @@ -83,7 +83,7 @@ impl WeightInfo for I { } } -/// Benchmark results for pallet_snarcos. +/// Benchmark results for pallet_baby_liminal. trait BenchmarkInfo { fn store_key(l: u32, ) -> Weight; fn overwrite_key(l: u32, ) -> Weight; @@ -107,10 +107,10 @@ trait BenchmarkInfo { fn verify_key_deserializing_fails(l: u32, ) -> Weight; } -/// Weights for pallet_snarcos using the Substrate node and recommended hardware. +/// Weights for pallet_baby_liminal using the Substrate node and recommended hardware. pub struct AlephWeight(PhantomData); impl BenchmarkInfo for AlephWeight { - // Storage: Snarcos VerificationKeys (r:1 w:1) + // Storage: BabyLiminal VerificationKeys (r:1 w:1) /// The range of component `l` is `[1, 10000]`. fn store_key(l: u32, ) -> Weight { // Minimum execution time: 13_474 nanoseconds. @@ -120,7 +120,7 @@ impl BenchmarkInfo for AlephWeight { .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } - // Storage: Snarcos VerificationKeys (r:1 w:1) + // Storage: BabyLiminal VerificationKeys (r:1 w:1) /// The range of component `l` is `[1, 10000]`. fn overwrite_key(l: u32, ) -> Weight { // Minimum execution time: 12_801 nanoseconds. @@ -130,91 +130,91 @@ impl BenchmarkInfo for AlephWeight { .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } - // Storage: Snarcos VerificationKeys (r:1 w:0) + // Storage: BabyLiminal VerificationKeys (r:1 w:0) fn verify_groth16_xor() -> Weight { // Minimum execution time: 40_835_989 nanoseconds. Weight::from_ref_time(41_360_423_000_u64) .saturating_add(T::DbWeight::get().reads(1_u64)) } - // Storage: Snarcos VerificationKeys (r:1 w:0) + // Storage: BabyLiminal VerificationKeys (r:1 w:0) fn verify_groth16_linear_equation() -> Weight { // Minimum execution time: 32_639_940 nanoseconds. Weight::from_ref_time(33_183_542_000_u64) .saturating_add(T::DbWeight::get().reads(1_u64)) } - // Storage: Snarcos VerificationKeys (r:1 w:0) + // Storage: BabyLiminal VerificationKeys (r:1 w:0) fn verify_groth16_merkle_tree_8() -> Weight { // Minimum execution time: 43_535_647 nanoseconds. Weight::from_ref_time(44_534_826_000_u64) .saturating_add(T::DbWeight::get().reads(1_u64)) } - // Storage: Snarcos VerificationKeys (r:1 w:0) + // Storage: BabyLiminal VerificationKeys (r:1 w:0) fn verify_groth16_merkle_tree_64() -> Weight { // Minimum execution time: 43_736_277 nanoseconds. Weight::from_ref_time(44_928_816_000_u64) .saturating_add(T::DbWeight::get().reads(1_u64)) } - // Storage: Snarcos VerificationKeys (r:1 w:0) + // Storage: BabyLiminal VerificationKeys (r:1 w:0) fn verify_groth16_merkle_tree_1024() -> Weight { // Minimum execution time: 44_398_502 nanoseconds. Weight::from_ref_time(45_404_315_000_u64) .saturating_add(T::DbWeight::get().reads(1_u64)) } - // Storage: Snarcos VerificationKeys (r:1 w:0) + // Storage: BabyLiminal VerificationKeys (r:1 w:0) fn verify_gm17_xor() -> Weight { // Minimum execution time: 47_317_978 nanoseconds. Weight::from_ref_time(48_630_811_000_u64) .saturating_add(T::DbWeight::get().reads(1_u64)) } - // Storage: Snarcos VerificationKeys (r:1 w:0) + // Storage: BabyLiminal VerificationKeys (r:1 w:0) fn verify_gm17_linear_equation() -> Weight { // Minimum execution time: 37_869_011 nanoseconds. Weight::from_ref_time(39_424_421_000_u64) .saturating_add(T::DbWeight::get().reads(1_u64)) } - // Storage: Snarcos VerificationKeys (r:1 w:0) + // Storage: BabyLiminal VerificationKeys (r:1 w:0) fn verify_gm17_merkle_tree_8() -> Weight { // Minimum execution time: 50_106_274 nanoseconds. Weight::from_ref_time(50_982_596_000_u64) .saturating_add(T::DbWeight::get().reads(1_u64)) } - // Storage: Snarcos VerificationKeys (r:1 w:0) + // Storage: BabyLiminal VerificationKeys (r:1 w:0) fn verify_gm17_merkle_tree_64() -> Weight { // Minimum execution time: 50_371_264 nanoseconds. Weight::from_ref_time(51_318_930_000_u64) .saturating_add(T::DbWeight::get().reads(1_u64)) } - // Storage: Snarcos VerificationKeys (r:1 w:0) + // Storage: BabyLiminal VerificationKeys (r:1 w:0) fn verify_gm17_merkle_tree_1024() -> Weight { // Minimum execution time: 51_354_405 nanoseconds. Weight::from_ref_time(55_320_255_000_u64) .saturating_add(T::DbWeight::get().reads(1_u64)) } - // Storage: Snarcos VerificationKeys (r:1 w:0) + // Storage: BabyLiminal VerificationKeys (r:1 w:0) fn verify_marlin_xor() -> Weight { // Minimum execution time: 72_380_865 nanoseconds. Weight::from_ref_time(76_175_990_000_u64) .saturating_add(T::DbWeight::get().reads(1_u64)) } - // Storage: Snarcos VerificationKeys (r:1 w:0) + // Storage: BabyLiminal VerificationKeys (r:1 w:0) fn verify_marlin_linear_equation() -> Weight { // Minimum execution time: 74_249_936 nanoseconds. Weight::from_ref_time(75_255_309_000_u64) .saturating_add(T::DbWeight::get().reads(1_u64)) } - // Storage: Snarcos VerificationKeys (r:1 w:0) + // Storage: BabyLiminal VerificationKeys (r:1 w:0) fn verify_marlin_merkle_tree_8() -> Weight { // Minimum execution time: 74_818_479 nanoseconds. Weight::from_ref_time(76_062_257_000_u64) .saturating_add(T::DbWeight::get().reads(1_u64)) } - // Storage: Snarcos VerificationKeys (r:1 w:0) + // Storage: BabyLiminal VerificationKeys (r:1 w:0) fn verify_marlin_merkle_tree_64() -> Weight { // Minimum execution time: 74_803_724 nanoseconds. Weight::from_ref_time(75_804_037_000_u64) .saturating_add(T::DbWeight::get().reads(1_u64)) } - // Storage: Snarcos VerificationKeys (r:1 w:0) + // Storage: BabyLiminal VerificationKeys (r:1 w:0) fn verify_marlin_merkle_tree_1024() -> Weight { // Minimum execution time: 81_667_728 nanoseconds. Weight::from_ref_time(83_228_545_000_u64) @@ -230,7 +230,7 @@ impl BenchmarkInfo for AlephWeight { // Minimum execution time: 5_548 nanoseconds. Weight::from_ref_time(8_972_482_u64) } - // Storage: Snarcos VerificationKeys (r:1 w:0) + // Storage: BabyLiminal VerificationKeys (r:1 w:0) /// The range of component `l` is `[1, 10000]`. fn verify_key_deserializing_fails(l: u32, ) -> Weight { // Minimum execution time: 5_305_992 nanoseconds. @@ -243,7 +243,7 @@ impl BenchmarkInfo for AlephWeight { // For backwards compatibility and tests impl BenchmarkInfo for () { - // Storage: Snarcos VerificationKeys (r:1 w:1) + // Storage: BabyLiminal VerificationKeys (r:1 w:1) /// The range of component `l` is `[1, 10000]`. fn store_key(l: u32, ) -> Weight { // Minimum execution time: 13_474 nanoseconds. @@ -253,7 +253,7 @@ impl BenchmarkInfo for () { .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } - // Storage: Snarcos VerificationKeys (r:1 w:1) + // Storage: BabyLiminal VerificationKeys (r:1 w:1) /// The range of component `l` is `[1, 10000]`. fn overwrite_key(l: u32, ) -> Weight { // Minimum execution time: 12_801 nanoseconds. @@ -263,91 +263,91 @@ impl BenchmarkInfo for () { .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } - // Storage: Snarcos VerificationKeys (r:1 w:0) + // Storage: BabyLiminal VerificationKeys (r:1 w:0) fn verify_groth16_xor() -> Weight { // Minimum execution time: 40_835_989 nanoseconds. Weight::from_ref_time(41_360_423_000_u64) .saturating_add(RocksDbWeight::get().reads(1_u64)) } - // Storage: Snarcos VerificationKeys (r:1 w:0) + // Storage: BabyLiminal VerificationKeys (r:1 w:0) fn verify_groth16_linear_equation() -> Weight { // Minimum execution time: 32_639_940 nanoseconds. Weight::from_ref_time(33_183_542_000_u64) .saturating_add(RocksDbWeight::get().reads(1_u64)) } - // Storage: Snarcos VerificationKeys (r:1 w:0) + // Storage: BabyLiminal VerificationKeys (r:1 w:0) fn verify_groth16_merkle_tree_8() -> Weight { // Minimum execution time: 43_535_647 nanoseconds. Weight::from_ref_time(44_534_826_000_u64) .saturating_add(RocksDbWeight::get().reads(1_u64)) } - // Storage: Snarcos VerificationKeys (r:1 w:0) + // Storage: BabyLiminal VerificationKeys (r:1 w:0) fn verify_groth16_merkle_tree_64() -> Weight { // Minimum execution time: 43_736_277 nanoseconds. Weight::from_ref_time(44_928_816_000_u64) .saturating_add(RocksDbWeight::get().reads(1_u64)) } - // Storage: Snarcos VerificationKeys (r:1 w:0) + // Storage: BabyLiminal VerificationKeys (r:1 w:0) fn verify_groth16_merkle_tree_1024() -> Weight { // Minimum execution time: 44_398_502 nanoseconds. Weight::from_ref_time(45_404_315_000_u64) .saturating_add(RocksDbWeight::get().reads(1_u64)) } - // Storage: Snarcos VerificationKeys (r:1 w:0) + // Storage: BabyLiminal VerificationKeys (r:1 w:0) fn verify_gm17_xor() -> Weight { // Minimum execution time: 47_317_978 nanoseconds. Weight::from_ref_time(48_630_811_000_u64) .saturating_add(RocksDbWeight::get().reads(1_u64)) } - // Storage: Snarcos VerificationKeys (r:1 w:0) + // Storage: BabyLiminal VerificationKeys (r:1 w:0) fn verify_gm17_linear_equation() -> Weight { // Minimum execution time: 37_869_011 nanoseconds. Weight::from_ref_time(39_424_421_000_u64) .saturating_add(RocksDbWeight::get().reads(1_u64)) } - // Storage: Snarcos VerificationKeys (r:1 w:0) + // Storage: BabyLiminal VerificationKeys (r:1 w:0) fn verify_gm17_merkle_tree_8() -> Weight { // Minimum execution time: 50_106_274 nanoseconds. Weight::from_ref_time(50_982_596_000_u64) .saturating_add(RocksDbWeight::get().reads(1_u64)) } - // Storage: Snarcos VerificationKeys (r:1 w:0) + // Storage: BabyLiminal VerificationKeys (r:1 w:0) fn verify_gm17_merkle_tree_64() -> Weight { // Minimum execution time: 50_371_264 nanoseconds. Weight::from_ref_time(51_318_930_000_u64) .saturating_add(RocksDbWeight::get().reads(1_u64)) } - // Storage: Snarcos VerificationKeys (r:1 w:0) + // Storage: BabyLiminal VerificationKeys (r:1 w:0) fn verify_gm17_merkle_tree_1024() -> Weight { // Minimum execution time: 51_354_405 nanoseconds. Weight::from_ref_time(55_320_255_000_u64) .saturating_add(RocksDbWeight::get().reads(1_u64)) } - // Storage: Snarcos VerificationKeys (r:1 w:0) + // Storage: BabyLiminal VerificationKeys (r:1 w:0) fn verify_marlin_xor() -> Weight { // Minimum execution time: 72_380_865 nanoseconds. Weight::from_ref_time(76_175_990_000_u64) .saturating_add(RocksDbWeight::get().reads(1_u64)) } - // Storage: Snarcos VerificationKeys (r:1 w:0) + // Storage: BabyLiminal VerificationKeys (r:1 w:0) fn verify_marlin_linear_equation() -> Weight { // Minimum execution time: 74_249_936 nanoseconds. Weight::from_ref_time(75_255_309_000_u64) .saturating_add(RocksDbWeight::get().reads(1_u64)) } - // Storage: Snarcos VerificationKeys (r:1 w:0) + // Storage: BabyLiminal VerificationKeys (r:1 w:0) fn verify_marlin_merkle_tree_8() -> Weight { // Minimum execution time: 74_818_479 nanoseconds. Weight::from_ref_time(76_062_257_000_u64) .saturating_add(RocksDbWeight::get().reads(1_u64)) } - // Storage: Snarcos VerificationKeys (r:1 w:0) + // Storage: BabyLiminal VerificationKeys (r:1 w:0) fn verify_marlin_merkle_tree_64() -> Weight { // Minimum execution time: 74_803_724 nanoseconds. Weight::from_ref_time(75_804_037_000_u64) .saturating_add(RocksDbWeight::get().reads(1_u64)) } - // Storage: Snarcos VerificationKeys (r:1 w:0) + // Storage: BabyLiminal VerificationKeys (r:1 w:0) fn verify_marlin_merkle_tree_1024() -> Weight { // Minimum execution time: 81_667_728 nanoseconds. Weight::from_ref_time(83_228_545_000_u64) @@ -363,7 +363,7 @@ impl BenchmarkInfo for () { // Minimum execution time: 5_548 nanoseconds. Weight::from_ref_time(8_972_482_u64) } - // Storage: Snarcos VerificationKeys (r:1 w:0) + // Storage: BabyLiminal VerificationKeys (r:1 w:0) /// The range of component `l` is `[1, 10000]`. fn verify_key_deserializing_fails(l: u32, ) -> Weight { // Minimum execution time: 5_305_992 nanoseconds. diff --git a/relations/src/proc_macro/Cargo.toml b/relations/src/proc_macro/Cargo.toml index 550b3d1120..218e0c7ba2 100644 --- a/relations/src/proc_macro/Cargo.toml +++ b/relations/src/proc_macro/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" authors = ["Cardinal"] documentation = "https://docs.rs/?" homepage = "https://alephzero.org" -license = "Apache 2.0" +license = "Apache-2.0" categories = ["cryptography"] repository = "https://github.com/Cardinal-Cryptography/aleph-node" description = "Procedural macro for concise defining SNARK relations."