diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index e84f1a3..c43a237 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -8,13 +8,13 @@ moat-core={ path = "../moat-core" } license-provider = { path = "../license-provider" } [dev-dependencies] -dusk-wallet = "0.18" -zk-citadel = "0.4" -phoenix-core = { version = "0.20.0-rc.0", features = ["alloc"] } -poseidon-merkle = { version = "0.2.1-rc.0", features = ["rkyv-impl"] } -dusk-pki = { version = "0.12", default-features = false, features = ["rkyv-impl"] } -dusk-plonk = { version = "0.14", default-features = false, features = ["rkyv-impl", "alloc"] } -dusk-bls12_381 = "0.11" +dusk-wallet = "0.20.0-rc.0" +zk-citadel = "0.5" +phoenix-core = { version = "0.21", features = ["alloc"] } +poseidon-merkle = { version = "0.3", features = ["rkyv-impl"] } +dusk-pki = { version = "0.13", default-features = false, features = ["rkyv-impl"] } +dusk-plonk = { version = "0.16", default-features = false, features = ["rkyv-impl", "alloc"] } +dusk-bls12_381 = "0.12" wallet-accessor = { path = "../wallet-accessor" } rkyv = { version = "=0.7.39" } tokio = { version = "1.15", features = ["rt-multi-thread", "time", "fs", "macros"] } diff --git a/integration-tests/tests/citadel/int_test_user.rs b/integration-tests/tests/citadel/int_test_user.rs index 6d09d0e..2781f37 100644 --- a/integration-tests/tests/citadel/int_test_user.rs +++ b/integration-tests/tests/citadel/int_test_user.rs @@ -22,7 +22,7 @@ use bytecheck::CheckBytes; use bytes::Bytes; use dusk_bls12_381::BlsScalar; -use dusk_bytes::{DeserializableSlice, Serializable}; +use dusk_bytes::DeserializableSlice; use dusk_pki::{PublicSpendKey, SecretSpendKey}; use dusk_plonk::prelude::*; use dusk_wallet::{RuskHttpClient, WalletPath}; @@ -142,12 +142,14 @@ async fn prove_and_send_use_license( verifier .verify(&proof, &public_inputs) .expect("Verifying the circuit should succeed"); + info!("proof validated locally"); let use_license_arg = UseLicenseArg { proof, public_inputs, }; + info!("calling license contract's use_license"); let tx_id = PayloadSender::execute_contract_method( use_license_arg, &blockchain_config, @@ -243,10 +245,11 @@ async fn user_round_trip() -> Result<(), Error> { // initialize // NOTE: it is important that the seed is the same as in the recovery // PUB_PARAMS initialization code - let rng = &mut StdRng::seed_from_u64(0xbeef); + let mut rng = StdRng::seed_from_u64(0xbeef); info!("performing setup"); - let pp = PublicParameters::setup(1 << CAPACITY, rng).unwrap(); + let pp = PublicParameters::setup(1 << CAPACITY, &mut rng) + .expect("Initializing public parameters should succeed"); info!("compiling circuit"); let (prover, verifier) = Compiler::compile::(&pp, LABEL) @@ -279,7 +282,7 @@ async fn user_round_trip() -> Result<(), Error> { let request = RequestCreator::create_from_hex_args( request_json.user_ssk, request_json.provider_psk, - rng, + &mut rng, )?; // as a User, submit request to blockchain @@ -297,7 +300,7 @@ async fn user_round_trip() -> Result<(), Error> { // as a LP, retrieve request from blockchain info!("retrieving request from blockchain (as an LP)"); - let tx_id = format!("{:X}", tx_id); + let tx_id = hex::encode(tx_id.to_bytes()); let request: Request = PayloadRetriever::retrieve_payload(tx_id, &client).await?; @@ -309,7 +312,7 @@ async fn user_round_trip() -> Result<(), Error> { &blockchain_config, &wallet_path, &request, - rng, + &mut rng, ) .await?; show_state(&client, "after issue_license").await?; @@ -358,7 +361,7 @@ async fn user_round_trip() -> Result<(), Error> { &verifier, &license, opening.unwrap(), - rng, + &mut rng, &challenge, ) .await?; diff --git a/integration-tests/tests/citadel/send_request.rs b/integration-tests/tests/citadel/send_request.rs index 06d7429..258c3fe 100644 --- a/integration-tests/tests/citadel/send_request.rs +++ b/integration-tests/tests/citadel/send_request.rs @@ -70,7 +70,7 @@ async fn send_request() -> Result<(), Error> { let client = RuskHttpClient::new(config.rusk_address); TxAwaiter::wait_for(&client, tx_id).await?; - let tx_id_hex = format!("{:x}", tx_id); + let tx_id_hex = hex::encode(tx_id.to_bytes()); let retrieved_request = get_request_from_blockchain(tx_id_hex, &client).await?; diff --git a/license-provider/Cargo.toml b/license-provider/Cargo.toml index 56a05bd..f1edc26 100644 --- a/license-provider/Cargo.toml +++ b/license-provider/Cargo.toml @@ -4,15 +4,15 @@ version = "0.1.0" edition = "2021" [dependencies] -dusk-wallet = "0.18" -zk-citadel = "0.4" +dusk-wallet = "0.20.0-rc.0" +zk-citadel = "0.5" moat-core={ path = "../moat-core" } wallet-accessor = { path = "../wallet-accessor" } -dusk-poseidon = { version = "0.30", default-features = false, features = ["rkyv-impl", "alloc"] } -dusk-jubjub = { version = "0.12", default-features = false } -dusk-bls12_381 = "0.11" -dusk-pki = { version = "0.12", default-features = false, features = ["rkyv-impl"] } -rusk-abi = { version = "0.10.0-piecrust.0.6", default-features = false } +dusk-poseidon = { version = "0.31", default-features = false, features = ["rkyv-impl", "alloc"] } +dusk-jubjub = { version = "0.13", default-features = false } +dusk-bls12_381 = "0.12" +dusk-pki = { version = "0.13", default-features = false, features = ["rkyv-impl"] } +rusk-abi = { version = "0.11", default-features = false } rkyv = { version = "=0.7.39" } serde = { version = "1", features = ["derive"] } serde_json = "1.0" diff --git a/license-provider/src/license_issuer.rs b/license-provider/src/license_issuer.rs index 2b6a01b..475fc6f 100644 --- a/license-provider/src/license_issuer.rs +++ b/license-provider/src/license_issuer.rs @@ -57,7 +57,7 @@ impl LicenseIssuer { .expect("License should serialize correctly") .to_vec(); let lpk = JubJubAffine::from(license.lsa.pk_r().as_ref()); - let license_hash = sponge::hash(&[lpk.get_x(), lpk.get_y()]); + let license_hash = sponge::hash(&[lpk.get_u(), lpk.get_v()]); let tuple = (license_blob, license_hash); trace!( "sending issue license with license blob size={}", diff --git a/macros/code-hasher/Cargo.toml b/macros/code-hasher/Cargo.toml index 24823e3..fb2ae54 100644 --- a/macros/code-hasher/Cargo.toml +++ b/macros/code-hasher/Cargo.toml @@ -20,4 +20,4 @@ darling = "0.14" semver = "1.0" [dev-dependencies] -dusk-plonk = "0.14" +dusk-plonk = "0.16" diff --git a/moat-cli/Cargo.toml b/moat-cli/Cargo.toml index 068a602..81d71fb 100644 --- a/moat-cli/Cargo.toml +++ b/moat-cli/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -dusk-wallet = "0.18" +dusk-wallet = "0.20.0-rc.0" wallet-accessor = { path = "../wallet-accessor" } moat-core = { path = "../moat-core" } toml-base-config = "0.1" diff --git a/moat-core/Cargo.toml b/moat-core/Cargo.toml index 48391ce..1c6c6ab 100644 --- a/moat-core/Cargo.toml +++ b/moat-core/Cargo.toml @@ -9,17 +9,17 @@ tokio-tungstenite = { version = "0.19", default-features = false, features = ["c futures = "0.3" futures-core = "0.3" futures-util = { version = "0.3.28", default-features = false, features = ["sink", "std"] } -dusk-wallet = "0.18" +dusk-wallet = "0.20.0-rc.0" wallet-accessor = { path = "../wallet-accessor" } -zk-citadel = "0.4" -dusk-plonk = { version = "0.14", default-features = false, features = ["rkyv-impl", "alloc"] } -phoenix-core = { version = "0.20.0-rc.0", features = ["alloc"] } -dusk-poseidon = { version = "0.30", default-features = false, features = ["rkyv-impl", "alloc"] } -poseidon-merkle = { version = "0.2.1-rc.0", features = ["rkyv-impl"] } -dusk-jubjub = { version = "0.12", default-features = false } -dusk-bls12_381 = "0.11" -dusk-pki = { version = "0.12", default-features = false, features = ["rkyv-impl"] } -rusk-abi = { version = "0.10.0-piecrust.0.6", default-features = false } +zk-citadel = "0.5" +dusk-plonk = { version = "0.16", default-features = false, features = ["rkyv-impl", "alloc"] } +phoenix-core = { version = "0.21", features = ["alloc"] } +dusk-poseidon = { version = "0.31", default-features = false, features = ["rkyv-impl", "alloc"] } +poseidon-merkle = { version = "0.3", features = ["rkyv-impl"] } +dusk-jubjub = { version = "0.13", default-features = false } +dusk-bls12_381 = "0.12" +dusk-pki = { version = "0.13", default-features = false, features = ["rkyv-impl"] } +rusk-abi = { version = "0.11", default-features = false } rkyv = { version = "=0.7.39" } serde = { version = "1", features = ["derive"] } serde_json = "1.0" diff --git a/moat-core/src/blockchain_queries/tx_awaiter.rs b/moat-core/src/blockchain_queries/tx_awaiter.rs index 8998077..e8f1276 100644 --- a/moat-core/src/blockchain_queries/tx_awaiter.rs +++ b/moat-core/src/blockchain_queries/tx_awaiter.rs @@ -58,7 +58,7 @@ impl TxAwaiter { client: &RuskHttpClient, tx_id: BlsScalar, ) -> Result<(), Error> { - let tx_id = format!("{:x}", tx_id); + let tx_id = hex::encode(tx_id.to_bytes()); Self::wait_for_tx(client, tx_id).await } diff --git a/wallet-accessor/Cargo.toml b/wallet-accessor/Cargo.toml index 29ce3d6..bd41872 100644 --- a/wallet-accessor/Cargo.toml +++ b/wallet-accessor/Cargo.toml @@ -4,11 +4,11 @@ version = "0.1.0" edition = "2021" [dependencies] -dusk-wallet = "0.18" -dusk-wallet-core = "0.20.0-piecrust.0.6" -phoenix-core = { version = "0.20.0-rc.0", features = ["alloc"] } -dusk-bls12_381 = "0.11" -rusk-abi = { version = "0.10.0-piecrust.0.6", default-features = false } +dusk-wallet = "0.20.0-rc.0" +dusk-wallet-core = "0.22.0-plonk.0.16" +phoenix-core = { version = "0.21", features = ["alloc"] } +dusk-bls12_381 = "0.12" +rusk-abi = { version = "0.11", default-features = false } rkyv = { version = "=0.7.39" } tracing = "0.1" serde = { version = "1", features = ["derive"] } diff --git a/wallet-accessor/src/wallet_accessor.rs b/wallet-accessor/src/wallet_accessor.rs index 2623bcc..b2018e9 100644 --- a/wallet-accessor/src/wallet_accessor.rs +++ b/wallet-accessor/src/wallet_accessor.rs @@ -84,8 +84,9 @@ impl WalletAccessor { }, ) .await?; + wallet.sync().await?; - assert!(wallet.is_online(), "Wallet should be online"); + assert!(wallet.is_online().await, "Wallet should be online"); debug!( "Sending tx with a call to method '{}' of contract='{}'",