From 0b44afa4f6b3a4e294d4300a010f21f5c440553c Mon Sep 17 00:00:00 2001 From: Sergio Chouhy Date: Fri, 17 Oct 2025 15:29:09 -0300 Subject: [PATCH 01/17] remove unused code --- common/src/transaction.rs | 109 +------------------------------------- 1 file changed, 1 insertion(+), 108 deletions(-) diff --git a/common/src/transaction.rs b/common/src/transaction.rs index 3a2bda1..4820300 100644 --- a/common/src/transaction.rs +++ b/common/src/transaction.rs @@ -1,15 +1,10 @@ use borsh::{BorshDeserialize, BorshSerialize}; -use k256::ecdsa::{Signature, SigningKey, VerifyingKey}; use log::info; use serde::{Deserialize, Serialize}; use sha2::{Digest, digest::FixedOutput}; -use elliptic_curve::{ - consts::{B0, B1}, - generic_array::GenericArray, -}; -use sha2::digest::typenum::{UInt, UTerm}; +pub type TreeHashType = [u8; 32]; #[derive(Debug, Clone, PartialEq, Eq)] pub enum NSSATransaction { @@ -29,12 +24,6 @@ impl From for NSSATransaction { } } -use crate::TreeHashType; - -pub type CipherText = Vec; -pub type Nonce = GenericArray, B1>, B0>, B0>>; -pub type Tag = u8; - #[derive( Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq, BorshSerialize, BorshDeserialize, )] @@ -81,99 +70,6 @@ impl TryFrom<&EncodedTransaction> for NSSATransaction { } } -#[derive(Debug, Serialize, Deserialize)] -pub struct MintMoneyPublicTx { - pub acc: [u8; 32], - pub amount: u128, -} - -#[derive(Debug, Serialize, Deserialize)] -pub struct SendMoneyShieldedTx { - pub acc_sender: [u8; 32], - pub amount: u128, -} - -#[derive(Debug, Serialize, Deserialize)] -pub struct SendMoneyDeshieldedTx { - pub receiver_data: Vec<(u128, [u8; 32])>, -} - -#[derive(Debug, Serialize, Deserialize)] -pub struct OwnedUTXO { - pub hash: [u8; 32], - pub owner: [u8; 32], - pub amount: u128, -} - -#[derive(Debug, Serialize, Deserialize)] -pub struct OwnedUTXOForPublication { - pub hash: String, - pub owner: String, - pub amount: u128, -} - -impl From for OwnedUTXOForPublication { - fn from(value: OwnedUTXO) -> Self { - Self { - hash: hex::encode(value.hash), - owner: hex::encode(value.owner), - amount: value.amount, - } - } -} - -#[derive(Debug, Serialize, Deserialize)] -pub struct UTXOPublication { - pub utxos: Vec, -} - -#[derive(Debug, Serialize, Deserialize)] -pub enum ActionData { - MintMoneyPublicTx(MintMoneyPublicTx), - SendMoneyShieldedTx(SendMoneyShieldedTx), - SendMoneyDeshieldedTx(SendMoneyDeshieldedTx), - UTXOPublication(UTXOPublication), -} - -impl ActionData { - pub fn into_hexed_print(self) -> String { - match self { - ActionData::MintMoneyPublicTx(action) => { - format!( - "Account {:?} minted {:?} balance", - hex::encode(action.acc), - action.amount - ) - } - ActionData::SendMoneyDeshieldedTx(action) => { - format!( - "Receivers receipt {:?}", - action - .receiver_data - .into_iter() - .map(|(amount, rec)| (amount, hex::encode(rec))) - .collect::>() - ) - } - ActionData::SendMoneyShieldedTx(action) => { - format!( - "Shielded send from {:?} for {:?} balance", - hex::encode(action.acc_sender), - action.amount - ) - } - ActionData::UTXOPublication(action) => { - let pub_own_utxo: Vec = action - .utxos - .into_iter() - .map(|owned_utxo| owned_utxo.into()) - .collect(); - format!("Published utxos {pub_own_utxo:?}") - } - } - } -} - impl EncodedTransaction { /// Computes and returns the SHA-256 hash of the JSON-serialized representation of `self`. pub fn hash(&self) -> TreeHashType { @@ -189,9 +85,6 @@ impl EncodedTransaction { } } -pub type TransactionSignature = Signature; -pub type SignaturePublicKey = VerifyingKey; -pub type SignaturePrivateKey = SigningKey; #[cfg(test)] mod tests { From e0fd94152ada7926fb613dd9e76881072b907141 Mon Sep 17 00:00:00 2001 From: Sergio Chouhy Date: Fri, 17 Oct 2025 15:35:06 -0300 Subject: [PATCH 02/17] remove outdated common/sec/nullifier.rs file --- common/src/lib.rs | 1 - common/src/nullifier.rs | 10 ---------- common/src/transaction.rs | 6 +++--- 3 files changed, 3 insertions(+), 14 deletions(-) delete mode 100644 common/src/nullifier.rs diff --git a/common/src/lib.rs b/common/src/lib.rs index 67d628d..59b384b 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -5,7 +5,6 @@ use sha2::{Digest, Sha256, digest::FixedOutput}; pub mod block; pub mod commitment; pub mod execution_input; -pub mod nullifier; pub mod rpc_primitives; pub mod sequencer_client; pub mod transaction; diff --git a/common/src/nullifier.rs b/common/src/nullifier.rs deleted file mode 100644 index f277efd..0000000 --- a/common/src/nullifier.rs +++ /dev/null @@ -1,10 +0,0 @@ -use serde::{Deserialize, Serialize}; - -use crate::TreeHashType; - -//ToDo: Update Nullifier model, when it is clear -#[derive(Debug, Serialize, Deserialize, Clone, Default, PartialEq, Eq, Hash)] -///General nullifier object -pub struct UTXONullifier { - pub utxo_hash: TreeHashType, -} diff --git a/common/src/transaction.rs b/common/src/transaction.rs index 4820300..610b229 100644 --- a/common/src/transaction.rs +++ b/common/src/transaction.rs @@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize}; use sha2::{Digest, digest::FixedOutput}; -pub type TreeHashType = [u8; 32]; +pub type HashType = [u8; 32]; #[derive(Debug, Clone, PartialEq, Eq)] pub enum NSSATransaction { @@ -72,11 +72,11 @@ impl TryFrom<&EncodedTransaction> for NSSATransaction { impl EncodedTransaction { /// Computes and returns the SHA-256 hash of the JSON-serialized representation of `self`. - pub fn hash(&self) -> TreeHashType { + pub fn hash(&self) -> HashType { let bytes_to_hash = borsh::to_vec(&self).unwrap(); let mut hasher = sha2::Sha256::new(); hasher.update(&bytes_to_hash); - TreeHashType::from(hasher.finalize_fixed()) + HashType::from(hasher.finalize_fixed()) } pub fn log(&self) { From 983865d31f8cc4f4812cc3524ba733c0e1a93d4a Mon Sep 17 00:00:00 2001 From: Sergio Chouhy Date: Fri, 17 Oct 2025 15:36:04 -0300 Subject: [PATCH 03/17] remove outdated common/src/commitment.rs file --- common/src/commitment.rs | 8 -------- common/src/lib.rs | 1 - 2 files changed, 9 deletions(-) delete mode 100644 common/src/commitment.rs diff --git a/common/src/commitment.rs b/common/src/commitment.rs deleted file mode 100644 index a905ad1..0000000 --- a/common/src/commitment.rs +++ /dev/null @@ -1,8 +0,0 @@ -use serde::{Deserialize, Serialize}; - -use crate::CommitmentHashType; - -#[derive(Debug, Serialize, Deserialize, Clone, Default, PartialEq, Eq)] -pub struct Commitment { - pub commitment_hash: CommitmentHashType, -} diff --git a/common/src/lib.rs b/common/src/lib.rs index 59b384b..cb9617d 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -3,7 +3,6 @@ use serde::Deserialize; use sha2::{Digest, Sha256, digest::FixedOutput}; pub mod block; -pub mod commitment; pub mod execution_input; pub mod rpc_primitives; pub mod sequencer_client; From f669f10d9ebd443697d1f23bd6a8aaa37c63c689 Mon Sep 17 00:00:00 2001 From: Sergio Chouhy Date: Fri, 17 Oct 2025 15:37:57 -0300 Subject: [PATCH 04/17] remove outdated common/src/execution_input.rs file --- common/src/execution_input.rs | 11 ----------- common/src/lib.rs | 1 - 2 files changed, 12 deletions(-) delete mode 100644 common/src/execution_input.rs diff --git a/common/src/execution_input.rs b/common/src/execution_input.rs deleted file mode 100644 index 08ff598..0000000 --- a/common/src/execution_input.rs +++ /dev/null @@ -1,11 +0,0 @@ -use serde::{Deserialize, Serialize}; - -use crate::TreeHashType; - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct PublicNativeTokenSend { - pub from: TreeHashType, - pub nonce: u64, - pub to: TreeHashType, - pub balance_to_move: u64, -} diff --git a/common/src/lib.rs b/common/src/lib.rs index cb9617d..cfed539 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -3,7 +3,6 @@ use serde::Deserialize; use sha2::{Digest, Sha256, digest::FixedOutput}; pub mod block; -pub mod execution_input; pub mod rpc_primitives; pub mod sequencer_client; pub mod transaction; From c3ca1c480401334d0a0552093c45ba17ab3eb4b9 Mon Sep 17 00:00:00 2001 From: Sergio Chouhy Date: Fri, 17 Oct 2025 15:39:17 -0300 Subject: [PATCH 05/17] remove unused common/src/utxo_commitment.rs file --- common/src/lib.rs | 1 - common/src/utxo_commitment.rs | 10 ---------- 2 files changed, 11 deletions(-) delete mode 100644 common/src/utxo_commitment.rs diff --git a/common/src/lib.rs b/common/src/lib.rs index cfed539..c73b7a9 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -6,7 +6,6 @@ pub mod block; pub mod rpc_primitives; pub mod sequencer_client; pub mod transaction; -pub mod utxo_commitment; //Module for tests utility functions pub mod test_utils; diff --git a/common/src/utxo_commitment.rs b/common/src/utxo_commitment.rs deleted file mode 100644 index 1b42421..0000000 --- a/common/src/utxo_commitment.rs +++ /dev/null @@ -1,10 +0,0 @@ -use serde::{Deserialize, Serialize}; - -use crate::TreeHashType; - -//ToDo: Update UTXO Commitment model, when it is clear -#[derive(Debug, Serialize, Deserialize, Clone)] -///General commitment object -pub struct UTXOCommitment { - pub hash: TreeHashType, -} From b3822c4b75f97fdf80303bdb12899a6176c6f7e6 Mon Sep 17 00:00:00 2001 From: Sergio Chouhy Date: Fri, 17 Oct 2025 15:52:00 -0300 Subject: [PATCH 06/17] remove outdated sc methods in rocksdb --- storage/src/lib.rs | 75 +--------------------------------------------- 1 file changed, 1 insertion(+), 74 deletions(-) diff --git a/storage/src/lib.rs b/storage/src/lib.rs index 37d5971..d69c521 100644 --- a/storage/src/lib.rs +++ b/storage/src/lib.rs @@ -26,8 +26,6 @@ pub const DB_META_FIRST_BLOCK_IN_DB_KEY: &str = "first_block_in_db"; pub const DB_META_LAST_BLOCK_IN_DB_KEY: &str = "last_block_in_db"; ///Key base for storing metainformation which describe if first block has been set pub const DB_META_FIRST_BLOCK_SET_KEY: &str = "first_block_set"; -///Key to list of all known smart contract addresses -pub const DB_META_SC_LIST: &str = "sc_list"; ///Key base for storing snapshot which describe block id pub const DB_SNAPSHOT_BLOCK_ID_KEY: &str = "block_id"; @@ -36,8 +34,6 @@ pub const DB_SNAPSHOT_BLOCK_ID_KEY: &str = "block_id"; pub const CF_BLOCK_NAME: &str = "cf_block"; ///Name of meta column family pub const CF_META_NAME: &str = "cf_meta"; -///Name of smart contract column family -pub const CF_SC_NAME: &str = "cf_sc"; ///Name of snapshot column family pub const CF_SNAPSHOT_NAME: &str = "cf_snapshot"; @@ -54,7 +50,6 @@ impl RocksDBIO { //ToDo: Add more column families for different data let cfb = ColumnFamilyDescriptor::new(CF_BLOCK_NAME, cf_opts.clone()); let cfmeta = ColumnFamilyDescriptor::new(CF_META_NAME, cf_opts.clone()); - let cfsc = ColumnFamilyDescriptor::new(CF_SC_NAME, cf_opts.clone()); let cfsnapshot = ColumnFamilyDescriptor::new(CF_SNAPSHOT_NAME, cf_opts.clone()); let mut db_opts = Options::default(); @@ -63,7 +58,7 @@ impl RocksDBIO { let db = DBWithThreadMode::::open_cf_descriptors( &db_opts, path, - vec![cfb, cfmeta, cfsc, cfsnapshot], + vec![cfb, cfmeta, cfsnapshot], ); let dbio = Self { @@ -82,8 +77,6 @@ impl RocksDBIO { dbio.put_meta_last_block_in_db(block_id)?; - dbio.put_meta_sc_list(vec![])?; - Ok(dbio) } else { // Here we are trying to start a DB without a block, one should not do it. @@ -114,10 +107,6 @@ impl RocksDBIO { self.db.cf_handle(CF_BLOCK_NAME).unwrap() } - pub fn sc_column(&self) -> Arc> { - self.db.cf_handle(CF_SC_NAME).unwrap() - } - pub fn snapshot_column(&self) -> Arc> { self.db.cf_handle(CF_SNAPSHOT_NAME).unwrap() } @@ -244,29 +233,6 @@ impl RocksDBIO { Ok(()) } - ///Setting list of known smart contracts in a DB as a `sc_list` - pub fn put_meta_sc_list(&self, sc_list: Vec) -> DbResult<()> { - let cf_meta = self.meta_column(); - self.db - .put_cf( - &cf_meta, - borsh::to_vec(&DB_META_SC_LIST).map_err(|err| { - DbError::borsh_cast_message( - err, - Some("Failed to serialize DB_META_SC_LIST".to_string()), - ) - })?, - borsh::to_vec(&sc_list).map_err(|err| { - DbError::borsh_cast_message( - err, - Some("Failed to serialize list of sc".to_string()), - ) - })?, - ) - .map_err(|rerr| DbError::rocksdb_cast_message(rerr, None))?; - Ok(()) - } - pub fn put_meta_is_first_block_set(&self) -> DbResult<()> { let cf_meta = self.meta_column(); self.db @@ -346,45 +312,6 @@ impl RocksDBIO { } } - ///Getting list of known smart contracts in a DB - pub fn get_meta_sc_list(&self) -> DbResult> { - let cf_meta = self.meta_column(); - let sc_list = self - .db - .get_cf( - &cf_meta, - borsh::to_vec(&DB_META_SC_LIST).map_err(|err| { - DbError::borsh_cast_message( - err, - Some("Failed to serialize DB_META_SC_LIST".to_string()), - ) - })?, - ) - .map_err(|rerr| DbError::rocksdb_cast_message(rerr, None))?; - if let Some(data) = sc_list { - Ok(borsh::from_slice::>(&data).map_err(|serr| { - DbError::borsh_cast_message( - serr, - Some("List of Sc Deserialization failed".to_string()), - ) - })?) - } else { - Err(DbError::db_interaction_error( - "Sc list not found".to_string(), - )) - } - } - - ///Push additional contract into list of known contracts in a DB - pub fn put_meta_sc(&self, sc_addr: String) -> DbResult<()> { - let mut sc_list = self.get_meta_sc_list()?; - if !sc_list.contains(&sc_addr) { - sc_list.push(sc_addr); - } - self.put_meta_sc_list(sc_list)?; - Ok(()) - } - pub fn get_snapshot_block_id(&self) -> DbResult { let cf_snapshot = self.snapshot_column(); let res = self From 9e03507dd437111008d2ea514b40cd3197a6674b Mon Sep 17 00:00:00 2001 From: Sergio Chouhy Date: Fri, 17 Oct 2025 15:56:26 -0300 Subject: [PATCH 07/17] remove unused error codes --- sequencer_core/src/lib.rs | 34 +++++++++++------------------- sequencer_rpc/src/types/err_rpc.rs | 4 ++-- 2 files changed, 14 insertions(+), 24 deletions(-) diff --git a/sequencer_core/src/lib.rs b/sequencer_core/src/lib.rs index 7da9fab..454faec 100644 --- a/sequencer_core/src/lib.rs +++ b/sequencer_core/src/lib.rs @@ -23,29 +23,19 @@ pub struct SequencerCore { } #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] -pub enum TransactionMalformationErrorKind { - PublicTransactionChangedPrivateData { tx: TreeHashType }, - PrivateTransactionChangedPublicData { tx: TreeHashType }, - TxHashAlreadyPresentInTree { tx: TreeHashType }, - NullifierAlreadyPresentInTree { tx: TreeHashType }, - UTXOCommitmentAlreadyPresentInTree { tx: TreeHashType }, +pub enum TransactionMalformationError { MempoolFullForRound, - ChainStateFurtherThanTransactionState { tx: TreeHashType }, - FailedToInsert { tx: TreeHashType, details: String }, InvalidSignature, - IncorrectSender, - BalanceMismatch { tx: TreeHashType }, - NonceMismatch { tx: TreeHashType }, FailedToDecode { tx: TreeHashType }, } -impl Display for TransactionMalformationErrorKind { +impl Display for TransactionMalformationError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{self:#?}") } } -impl std::error::Error for TransactionMalformationErrorKind {} +impl std::error::Error for TransactionMalformationError {} impl SequencerCore { pub fn start_from_config(config: SequencerConfig) -> Self { @@ -81,21 +71,21 @@ impl SequencerCore { pub fn transaction_pre_check( &mut self, tx: NSSATransaction, - ) -> Result { + ) -> Result { // Stateless checks here match tx { NSSATransaction::Public(tx) => { if tx.witness_set().is_valid_for(tx.message()) { Ok(NSSATransaction::Public(tx)) } else { - Err(TransactionMalformationErrorKind::InvalidSignature) + Err(TransactionMalformationError::InvalidSignature) } } NSSATransaction::PrivacyPreserving(tx) => { if tx.witness_set().signatures_are_valid_for(tx.message()) { Ok(NSSATransaction::PrivacyPreserving(tx)) } else { - Err(TransactionMalformationErrorKind::InvalidSignature) + Err(TransactionMalformationError::InvalidSignature) } } } @@ -104,16 +94,16 @@ impl SequencerCore { pub fn push_tx_into_mempool_pre_check( &mut self, transaction: EncodedTransaction, - ) -> Result<(), TransactionMalformationErrorKind> { + ) -> Result<(), TransactionMalformationError> { let transaction = NSSATransaction::try_from(&transaction).map_err(|_| { - TransactionMalformationErrorKind::FailedToDecode { + TransactionMalformationError::FailedToDecode { tx: transaction.hash(), } })?; let mempool_size = self.mempool.len(); if mempool_size >= self.sequencer_config.max_num_tx_in_block { - return Err(TransactionMalformationErrorKind::MempoolFullForRound); + return Err(TransactionMalformationError::MempoolFullForRound); } let authenticated_tx = self @@ -156,7 +146,7 @@ impl SequencerCore { while let Some(tx) = self.mempool.pop_last() { let nssa_transaction = NSSATransaction::try_from(&tx) - .map_err(|_| TransactionMalformationErrorKind::FailedToDecode { tx: tx.hash() })?; + .map_err(|_| TransactionMalformationError::FailedToDecode { tx: tx.hash() })?; if let Ok(valid_tx) = self.execute_check_transaction_on_state(nssa_transaction) { valid_transactions.push(valid_tx.into()); @@ -205,7 +195,7 @@ mod tests { fn parse_unwrap_tx_body_into_nssa_tx(tx_body: EncodedTransaction) -> NSSATransaction { NSSATransaction::try_from(&tx_body) - .map_err(|_| TransactionMalformationErrorKind::FailedToDecode { tx: tx_body.hash() }) + .map_err(|_| TransactionMalformationError::FailedToDecode { tx: tx_body.hash() }) .unwrap() } @@ -530,7 +520,7 @@ mod tests { assert!(matches!( result, - Err(TransactionMalformationErrorKind::MempoolFullForRound) + Err(TransactionMalformationError::MempoolFullForRound) )); } diff --git a/sequencer_rpc/src/types/err_rpc.rs b/sequencer_rpc/src/types/err_rpc.rs index a8759fc..d217571 100644 --- a/sequencer_rpc/src/types/err_rpc.rs +++ b/sequencer_rpc/src/types/err_rpc.rs @@ -1,7 +1,7 @@ use log::debug; use common::rpc_primitives::errors::{RpcError, RpcParseError}; -use sequencer_core::TransactionMalformationErrorKind; +use sequencer_core::TransactionMalformationError; pub struct RpcErr(pub RpcError); @@ -41,7 +41,7 @@ impl RpcErrKind for RpcErrInternal { } } -impl RpcErrKind for TransactionMalformationErrorKind { +impl RpcErrKind for TransactionMalformationError { fn into_rpc_err(self) -> RpcError { RpcError::new_internal_error( Some(serde_json::to_value(self).unwrap()), From 217551f960bdd05b5d193e0fe3e7d4521671efa9 Mon Sep 17 00:00:00 2001 From: Sergio Chouhy Date: Fri, 17 Oct 2025 15:58:28 -0300 Subject: [PATCH 08/17] remove outdated env.sh file --- ci_scripts/build-macos.sh | 3 +-- ci_scripts/build-ubuntu.sh | 3 +-- ci_scripts/lint-ubuntu.sh | 1 - ci_scripts/test-ubuntu.sh | 1 - env.sh | 2 -- 5 files changed, 2 insertions(+), 8 deletions(-) delete mode 100644 env.sh diff --git a/ci_scripts/build-macos.sh b/ci_scripts/build-macos.sh index 03fe54b..3d39af0 100644 --- a/ci_scripts/build-macos.sh +++ b/ci_scripts/build-macos.sh @@ -1,5 +1,4 @@ set -e curl -L https://risczero.com/install | bash /Users/runner/.risc0/bin/rzup install -source env.sh -RUSTFLAGS="-D warnings" cargo build \ No newline at end of file +RUSTFLAGS="-D warnings" cargo build diff --git a/ci_scripts/build-ubuntu.sh b/ci_scripts/build-ubuntu.sh index 9c9aa37..0da057d 100644 --- a/ci_scripts/build-ubuntu.sh +++ b/ci_scripts/build-ubuntu.sh @@ -1,5 +1,4 @@ set -e curl -L https://risczero.com/install | bash /home/runner/.risc0/bin/rzup install -source env.sh -RUSTFLAGS="-D warnings" cargo build \ No newline at end of file +RUSTFLAGS="-D warnings" cargo build diff --git a/ci_scripts/lint-ubuntu.sh b/ci_scripts/lint-ubuntu.sh index 8c60825..16d46a2 100755 --- a/ci_scripts/lint-ubuntu.sh +++ b/ci_scripts/lint-ubuntu.sh @@ -1,6 +1,5 @@ set -e -source env.sh cargo install taplo-cli --locked cargo fmt -- --check diff --git a/ci_scripts/test-ubuntu.sh b/ci_scripts/test-ubuntu.sh index 5c19b36..c16ba1d 100755 --- a/ci_scripts/test-ubuntu.sh +++ b/ci_scripts/test-ubuntu.sh @@ -2,7 +2,6 @@ set -e curl -L https://risczero.com/install | bash /home/runner/.risc0/bin/rzup install -source env.sh RISC0_DEV_MODE=1 cargo test --release diff --git a/env.sh b/env.sh deleted file mode 100644 index 6989084..0000000 --- a/env.sh +++ /dev/null @@ -1,2 +0,0 @@ -export NULLIFIER_SECRET_CONST="261d61d294ac4bdc24f91b6f490efa263757a4a95f65871cd4f16b2ea23c3b5d" -export VIEWING_SECRET_CONST="6117af750b30d7a296672ec3b3b25d3489beca3cfe5770fa39f275cec395d5ce" \ No newline at end of file From b93c0aa390e737d9b1ed012aff770682f0ea0745 Mon Sep 17 00:00:00 2001 From: Sergio Chouhy Date: Fri, 17 Oct 2025 16:04:09 -0300 Subject: [PATCH 09/17] rename TreeHashType to HashType --- common/src/lib.rs | 11 ++++------- common/src/transaction.rs | 4 ++-- key_protocol/src/key_management/secret_holders.rs | 8 ++++---- sequencer_core/src/lib.rs | 4 ++-- sequencer_core/src/sequencer_store/block_store.rs | 8 ++++---- sequencer_rpc/src/process.rs | 4 ++-- 6 files changed, 18 insertions(+), 21 deletions(-) diff --git a/common/src/lib.rs b/common/src/lib.rs index c73b7a9..a2f9156 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -12,7 +12,7 @@ pub mod test_utils; use rpc_primitives::errors::RpcError; -pub type TreeHashType = [u8; 32]; +pub type HashType = [u8; 32]; pub type CommitmentHashType = Vec; #[derive(Debug, Clone)] @@ -21,19 +21,16 @@ pub type CommitmentHashType = Vec; pub struct OwnHasher {} impl Hasher for OwnHasher { - type Hash = TreeHashType; + type Hash = HashType; - fn hash(data: &[u8]) -> TreeHashType { + fn hash(data: &[u8]) -> HashType { let mut hasher = Sha256::new(); hasher.update(data); - ::from(hasher.finalize_fixed()) + ::from(hasher.finalize_fixed()) } } -///Account id on blockchain -pub type AccountId = TreeHashType; - #[derive(Debug, Clone, Deserialize)] pub struct SequencerRpcError { pub jsonrpc: String, diff --git a/common/src/transaction.rs b/common/src/transaction.rs index 610b229..3d49556 100644 --- a/common/src/transaction.rs +++ b/common/src/transaction.rs @@ -91,7 +91,7 @@ mod tests { use sha2::{Digest, digest::FixedOutput}; use crate::{ - TreeHashType, + HashType, transaction::{EncodedTransaction, TxKind}, }; @@ -109,7 +109,7 @@ mod tests { let data = borsh::to_vec(&body).unwrap(); let mut hasher = sha2::Sha256::new(); hasher.update(&data); - TreeHashType::from(hasher.finalize_fixed()) + HashType::from(hasher.finalize_fixed()) }; let hash = body.hash(); diff --git a/key_protocol/src/key_management/secret_holders.rs b/key_protocol/src/key_management/secret_holders.rs index 89da95c..57dea90 100644 --- a/key_protocol/src/key_management/secret_holders.rs +++ b/key_protocol/src/key_management/secret_holders.rs @@ -1,5 +1,5 @@ use bip39::Mnemonic; -use common::TreeHashType; +use common::HashType; use nssa_core::{ NullifierPublicKey, NullifierSecretKey, encryption::{IncomingViewingPublicKey, Scalar}, @@ -44,7 +44,7 @@ impl SeedHolder { } } - pub fn generate_secret_spending_key_hash(&self) -> TreeHashType { + pub fn generate_secret_spending_key_hash(&self) -> HashType { let mut hash = hmac_sha512::HMAC::mac(&self.seed, "NSSA_seed"); for _ in 1..2048 { @@ -80,7 +80,7 @@ impl SecretSpendingKey { hasher.update([2u8]); hasher.update([0u8; 22]); - ::from(hasher.finalize_fixed()) + ::from(hasher.finalize_fixed()) } pub fn generate_outgoing_viewing_secret_key(&self) -> OutgoingViewingSecretKey { @@ -91,7 +91,7 @@ impl SecretSpendingKey { hasher.update([3u8]); hasher.update([0u8; 22]); - ::from(hasher.finalize_fixed()) + ::from(hasher.finalize_fixed()) } pub fn produce_private_key_holder(&self) -> PrivateKeyHolder { diff --git a/sequencer_core/src/lib.rs b/sequencer_core/src/lib.rs index 454faec..4459371 100644 --- a/sequencer_core/src/lib.rs +++ b/sequencer_core/src/lib.rs @@ -2,7 +2,7 @@ use std::fmt::Display; use anyhow::Result; use common::{ - TreeHashType, + HashType, block::HashableBlockData, transaction::{EncodedTransaction, NSSATransaction}, }; @@ -26,7 +26,7 @@ pub struct SequencerCore { pub enum TransactionMalformationError { MempoolFullForRound, InvalidSignature, - FailedToDecode { tx: TreeHashType }, + FailedToDecode { tx: HashType }, } impl Display for TransactionMalformationError { diff --git a/sequencer_core/src/sequencer_store/block_store.rs b/sequencer_core/src/sequencer_store/block_store.rs index 42e4ec5..e1dbb2b 100644 --- a/sequencer_core/src/sequencer_store/block_store.rs +++ b/sequencer_core/src/sequencer_store/block_store.rs @@ -1,13 +1,13 @@ use std::{collections::HashMap, path::Path}; use anyhow::Result; -use common::{TreeHashType, block::Block, transaction::EncodedTransaction}; +use common::{HashType, block::Block, transaction::EncodedTransaction}; use storage::RocksDBIO; pub struct SequecerBlockStore { dbio: RocksDBIO, // TODO: Consider adding the hashmap to the database for faster recovery. - tx_hash_to_block_map: HashMap, + tx_hash_to_block_map: HashMap, pub genesis_id: u64, pub signing_key: nssa::PrivateKey, } @@ -57,7 +57,7 @@ impl SequecerBlockStore { } /// Returns the transaction corresponding to the given hash, if it exists in the blockchain. - pub fn get_transaction_by_hash(&self, hash: TreeHashType) -> Option { + pub fn get_transaction_by_hash(&self, hash: HashType) -> Option { let block_id = self.tx_hash_to_block_map.get(&hash); let block = block_id.map(|&id| self.get_block_at_id(id)); if let Some(Ok(block)) = block { @@ -71,7 +71,7 @@ impl SequecerBlockStore { } } -fn block_to_transactions_map(block: &Block) -> HashMap { +fn block_to_transactions_map(block: &Block) -> HashMap { block .body .transactions diff --git a/sequencer_rpc/src/process.rs b/sequencer_rpc/src/process.rs index f376f94..584b097 100644 --- a/sequencer_rpc/src/process.rs +++ b/sequencer_rpc/src/process.rs @@ -5,7 +5,7 @@ use sequencer_core::config::AccountInitialData; use serde_json::Value; use common::{ - TreeHashType, + HashType, block::HashableBlockData, rpc_primitives::{ errors::RpcError, @@ -233,7 +233,7 @@ impl JsonHandler { let get_transaction_req = GetTransactionByHashRequest::parse(Some(request.params))?; let bytes: Vec = hex::decode(get_transaction_req.hash) .map_err(|_| RpcError::invalid_params("invalid hex".to_string()))?; - let hash: TreeHashType = bytes + let hash: HashType = bytes .try_into() .map_err(|_| RpcError::invalid_params("invalid length".to_string()))?; From 7d854249487c748111d2097e4d240e90827aa1fa Mon Sep 17 00:00:00 2001 From: Sergio Chouhy Date: Fri, 17 Oct 2025 16:07:59 -0300 Subject: [PATCH 10/17] remove unnecessary rs_merkle dep --- Cargo.toml | 1 - common/Cargo.toml | 1 - common/src/block.rs | 20 ++++++++++++++++++-- common/src/lib.rs | 19 ------------------- 4 files changed, 18 insertions(+), 23 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 11e3144..d23053c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,6 @@ env_logger = "0.10" log = "0.4.28" lru = "0.7.8" thiserror = "2.0.12" -rs_merkle = "1.4" sha2 = "0.10.8" hex = "0.4.3" aes-gcm = "0.10.3" diff --git a/common/Cargo.toml b/common/Cargo.toml index d235246..668ffbd 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -11,7 +11,6 @@ serde.workspace = true reqwest.workspace = true k256.workspace = true -rs_merkle.workspace = true sha2.workspace = true log.workspace = true elliptic-curve.workspace = true diff --git a/common/src/block.rs b/common/src/block.rs index 20f3aa7..456c879 100644 --- a/common/src/block.rs +++ b/common/src/block.rs @@ -1,7 +1,23 @@ use borsh::{BorshDeserialize, BorshSerialize}; -use rs_merkle::Hasher; +use sha2::{Digest, Sha256, digest::FixedOutput}; -use crate::{OwnHasher, transaction::EncodedTransaction}; +use crate::transaction::EncodedTransaction; + +pub type HashType = [u8; 32]; + +#[derive(Debug, Clone)] +///Our own hasher. +/// Currently it is SHA256 hasher wrapper. May change in a future. +pub struct OwnHasher {} + +impl OwnHasher { + fn hash(data: &[u8]) -> HashType { + let mut hasher = Sha256::new(); + + hasher.update(data); + ::from(hasher.finalize_fixed()) + } +} pub type BlockHash = [u8; 32]; pub type BlockId = u64; diff --git a/common/src/lib.rs b/common/src/lib.rs index a2f9156..5a96dc1 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -1,6 +1,4 @@ -use rs_merkle::Hasher; use serde::Deserialize; -use sha2::{Digest, Sha256, digest::FixedOutput}; pub mod block; pub mod rpc_primitives; @@ -13,23 +11,6 @@ pub mod test_utils; use rpc_primitives::errors::RpcError; pub type HashType = [u8; 32]; -pub type CommitmentHashType = Vec; - -#[derive(Debug, Clone)] -///Our own hasher. -/// Currently it is SHA256 hasher wrapper. May change in a future. -pub struct OwnHasher {} - -impl Hasher for OwnHasher { - type Hash = HashType; - - fn hash(data: &[u8]) -> HashType { - let mut hasher = Sha256::new(); - - hasher.update(data); - ::from(hasher.finalize_fixed()) - } -} #[derive(Debug, Clone, Deserialize)] pub struct SequencerRpcError { From 93fd485622806aee6fbdf63a42265de3a4ab4fca Mon Sep 17 00:00:00 2001 From: Sergio Chouhy Date: Fri, 17 Oct 2025 16:16:11 -0300 Subject: [PATCH 11/17] move common errors to own module. Remove unused ExecutionFailureKind variants --- common/src/error.rs | 59 ++++++++++++++++ common/src/lib.rs | 90 +----------------------- common/src/sequencer_client/mod.rs | 2 +- wallet/src/lib.rs | 2 +- wallet/src/token_transfers/deshielded.rs | 2 +- wallet/src/token_transfers/private.rs | 2 +- wallet/src/token_transfers/public.rs | 2 +- wallet/src/token_transfers/shielded.rs | 2 +- 8 files changed, 66 insertions(+), 95 deletions(-) create mode 100644 common/src/error.rs diff --git a/common/src/error.rs b/common/src/error.rs new file mode 100644 index 0000000..825eb7e --- /dev/null +++ b/common/src/error.rs @@ -0,0 +1,59 @@ +use serde::Deserialize; + +use crate::rpc_primitives::errors::RpcError; + +#[derive(Debug, Clone, Deserialize)] +pub struct SequencerRpcError { + pub jsonrpc: String, + pub error: RpcError, + pub id: u64, +} + +#[derive(thiserror::Error, Debug)] +pub enum SequencerClientError { + #[error("HTTP error")] + HTTPError(reqwest::Error), + #[error("Serde error")] + SerdeError(serde_json::Error), + #[error("Internal error")] + InternalError(SequencerRpcError), +} + +impl From for SequencerClientError { + fn from(value: reqwest::Error) -> Self { + SequencerClientError::HTTPError(value) + } +} + +impl From for SequencerClientError { + fn from(value: serde_json::Error) -> Self { + SequencerClientError::SerdeError(value) + } +} + +impl From for SequencerClientError { + fn from(value: SequencerRpcError) -> Self { + SequencerClientError::InternalError(value) + } +} + +#[derive(Debug, thiserror::Error)] +pub enum ExecutionFailureKind { + #[error("Failed to get account data from sequencer")] + SequencerError, + #[error("Inputs amounts does not match outputs")] + AmountMismatchError, + #[error("Accounts key not found")] + KeyNotFoundError, + #[error("Sequencer client error: {0:?}")] + SequencerClientError(#[from] SequencerClientError), + #[error("Can not pay for operation")] + InsufficientFundsError, +} + +#[derive(Debug, thiserror::Error)] +pub enum TransactionSignatureError { + #[error("invalid signature for transaction body")] + InvalidSignature, +} + diff --git a/common/src/lib.rs b/common/src/lib.rs index 5a96dc1..3c02565 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -1,98 +1,10 @@ -use serde::Deserialize; - pub mod block; pub mod rpc_primitives; pub mod sequencer_client; pub mod transaction; +pub mod error; //Module for tests utility functions pub mod test_utils; - -use rpc_primitives::errors::RpcError; - pub type HashType = [u8; 32]; -#[derive(Debug, Clone, Deserialize)] -pub struct SequencerRpcError { - pub jsonrpc: String, - pub error: RpcError, - pub id: u64, -} - -#[derive(thiserror::Error, Debug)] -pub enum SequencerClientError { - #[error("HTTP error")] - HTTPError(reqwest::Error), - #[error("Serde error")] - SerdeError(serde_json::Error), - #[error("Internal error")] - InternalError(SequencerRpcError), -} - -impl From for SequencerClientError { - fn from(value: reqwest::Error) -> Self { - SequencerClientError::HTTPError(value) - } -} - -impl From for SequencerClientError { - fn from(value: serde_json::Error) -> Self { - SequencerClientError::SerdeError(value) - } -} - -impl From for SequencerClientError { - fn from(value: SequencerRpcError) -> Self { - SequencerClientError::InternalError(value) - } -} - -#[derive(Debug, thiserror::Error)] -pub enum ExecutionFailureKind { - #[error("Failed to write into builder err: {0:?}")] - WriteError(anyhow::Error), - #[error("Failed to interact with a db err: {0:?}")] - DBError(anyhow::Error), - #[error("Failed to build builder err: {0:?}")] - BuilderError(anyhow::Error), - #[error("Failed prove execution err: {0:?}")] - ProveError(anyhow::Error), - #[error("Failed to decode data from VM: {0:?}")] - DecodeError(String), - #[error("Failed to get account data from sequencer")] - SequencerError, - #[error("Inputs amounts does not match outputs")] - AmountMismatchError, - #[error("Accounts key not found")] - KeyNotFoundError, - #[error("Sequencer client error: {0:?}")] - SequencerClientError(#[from] SequencerClientError), - #[error("Insufficient gas for operation")] - InsufficientGasError, - #[error("Can not pay for operation")] - InsufficientFundsError, -} - -impl ExecutionFailureKind { - pub fn write_error(err: anyhow::Error) -> Self { - Self::WriteError(err) - } - - pub fn builder_error(err: anyhow::Error) -> Self { - Self::BuilderError(err) - } - - pub fn prove_error(err: anyhow::Error) -> Self { - Self::ProveError(err) - } - - pub fn db_error(err: anyhow::Error) -> Self { - Self::DBError(err) - } -} - -#[derive(Debug, thiserror::Error)] -pub enum TransactionSignatureError { - #[error("invalid signature for transaction body")] - InvalidSignature, -} diff --git a/common/src/sequencer_client/mod.rs b/common/src/sequencer_client/mod.rs index 1aec903..cbcd077 100644 --- a/common/src/sequencer_client/mod.rs +++ b/common/src/sequencer_client/mod.rs @@ -14,7 +14,7 @@ use crate::rpc_primitives::requests::{ }; use crate::sequencer_client::json::AccountInitialData; use crate::transaction::{EncodedTransaction, NSSATransaction}; -use crate::{SequencerClientError, SequencerRpcError}; +use crate::error::{SequencerClientError, SequencerRpcError}; pub mod json; diff --git a/wallet/src/lib.rs b/wallet/src/lib.rs index 0e8b1cb..079e47d 100644 --- a/wallet/src/lib.rs +++ b/wallet/src/lib.rs @@ -2,7 +2,7 @@ use std::{fs::File, io::Write, path::PathBuf, str::FromStr, sync::Arc}; use base64::{Engine, engine::general_purpose::STANDARD as BASE64}; use common::{ - ExecutionFailureKind, + error::ExecutionFailureKind, sequencer_client::{SequencerClient, json::SendTxResponse}, transaction::{EncodedTransaction, NSSATransaction}, }; diff --git a/wallet/src/token_transfers/deshielded.rs b/wallet/src/token_transfers/deshielded.rs index 6bc812b..d270728 100644 --- a/wallet/src/token_transfers/deshielded.rs +++ b/wallet/src/token_transfers/deshielded.rs @@ -1,4 +1,4 @@ -use common::{ExecutionFailureKind, sequencer_client::json::SendTxResponse}; +use common::{error::ExecutionFailureKind, sequencer_client::json::SendTxResponse}; use key_protocol::key_management::ephemeral_key_holder::EphemeralKeyHolder; use nssa::{ Address, PrivacyPreservingTransaction, diff --git a/wallet/src/token_transfers/private.rs b/wallet/src/token_transfers/private.rs index 5253acd..0673d17 100644 --- a/wallet/src/token_transfers/private.rs +++ b/wallet/src/token_transfers/private.rs @@ -1,4 +1,4 @@ -use common::{ExecutionFailureKind, sequencer_client::json::SendTxResponse}; +use common::{error::ExecutionFailureKind, sequencer_client::json::SendTxResponse}; use key_protocol::key_management::ephemeral_key_holder::EphemeralKeyHolder; use nssa::{ Address, PrivacyPreservingTransaction, diff --git a/wallet/src/token_transfers/public.rs b/wallet/src/token_transfers/public.rs index 22d50eb..86651e8 100644 --- a/wallet/src/token_transfers/public.rs +++ b/wallet/src/token_transfers/public.rs @@ -1,4 +1,4 @@ -use common::{ExecutionFailureKind, sequencer_client::json::SendTxResponse}; +use common::{error::ExecutionFailureKind, sequencer_client::json::SendTxResponse}; use nssa::{ Address, PublicTransaction, program::Program, diff --git a/wallet/src/token_transfers/shielded.rs b/wallet/src/token_transfers/shielded.rs index 1cf1cb7..6435bfe 100644 --- a/wallet/src/token_transfers/shielded.rs +++ b/wallet/src/token_transfers/shielded.rs @@ -1,4 +1,4 @@ -use common::{ExecutionFailureKind, sequencer_client::json::SendTxResponse}; +use common::{error::ExecutionFailureKind, sequencer_client::json::SendTxResponse}; use key_protocol::key_management::ephemeral_key_holder::EphemeralKeyHolder; use nssa::{ Account, Address, PrivacyPreservingTransaction, From fd0e7831762a539821fe47df568d8defe1438e29 Mon Sep 17 00:00:00 2001 From: Sergio Chouhy Date: Fri, 17 Oct 2025 16:16:54 -0300 Subject: [PATCH 12/17] remove unused error type --- common/src/error.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/common/src/error.rs b/common/src/error.rs index 825eb7e..f8a3e3e 100644 --- a/common/src/error.rs +++ b/common/src/error.rs @@ -51,9 +51,3 @@ pub enum ExecutionFailureKind { InsufficientFundsError, } -#[derive(Debug, thiserror::Error)] -pub enum TransactionSignatureError { - #[error("invalid signature for transaction body")] - InvalidSignature, -} - From 6447f8fbf7090f90ea7fc1e293ef4692b944d48d Mon Sep 17 00:00:00 2001 From: Sergio Chouhy Date: Fri, 17 Oct 2025 16:17:15 -0300 Subject: [PATCH 13/17] remove unused dependencies --- common/Cargo.toml | 2 -- key_protocol/Cargo.toml | 1 - storage/Cargo.toml | 1 - wallet/Cargo.toml | 1 - 4 files changed, 5 deletions(-) diff --git a/common/Cargo.toml b/common/Cargo.toml index 668ffbd..999c731 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -9,11 +9,9 @@ thiserror.workspace = true serde_json.workspace = true serde.workspace = true reqwest.workspace = true -k256.workspace = true sha2.workspace = true log.workspace = true -elliptic-curve.workspace = true hex.workspace = true nssa-core = { path = "../nssa/core", features = ["host"] } borsh.workspace = true diff --git a/key_protocol/Cargo.toml b/key_protocol/Cargo.toml index 6addf41..544a2f8 100644 --- a/key_protocol/Cargo.toml +++ b/key_protocol/Cargo.toml @@ -5,7 +5,6 @@ edition = "2024" [dependencies] anyhow.workspace = true -log.workspace = true serde.workspace = true k256.workspace = true sha2.workspace = true diff --git a/storage/Cargo.toml b/storage/Cargo.toml index 1bc9d07..2fd4628 100644 --- a/storage/Cargo.toml +++ b/storage/Cargo.toml @@ -4,7 +4,6 @@ version = "0.1.0" edition = "2024" [dependencies] -anyhow.workspace = true thiserror.workspace = true borsh.workspace = true diff --git a/wallet/Cargo.toml b/wallet/Cargo.toml index ebd0dc5..48d79e2 100644 --- a/wallet/Cargo.toml +++ b/wallet/Cargo.toml @@ -14,7 +14,6 @@ tempfile.workspace = true clap.workspace = true nssa-core = { path = "../nssa/core" } base64.workspace = true -k256 = { version = "0.13.3" } bytemuck = "1.23.2" borsh.workspace = true hex.workspace = true From e1085e1907927b51444fe03e319677061c8d1acc Mon Sep 17 00:00:00 2001 From: Sergio Chouhy Date: Fri, 17 Oct 2025 16:20:31 -0300 Subject: [PATCH 14/17] fmt --- common/src/error.rs | 1 - common/src/lib.rs | 4 ++-- common/src/sequencer_client/mod.rs | 2 +- common/src/transaction.rs | 1 - 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/common/src/error.rs b/common/src/error.rs index f8a3e3e..e1634a6 100644 --- a/common/src/error.rs +++ b/common/src/error.rs @@ -50,4 +50,3 @@ pub enum ExecutionFailureKind { #[error("Can not pay for operation")] InsufficientFundsError, } - diff --git a/common/src/lib.rs b/common/src/lib.rs index 3c02565..c44d03f 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -1,10 +1,10 @@ pub mod block; +pub mod error; pub mod rpc_primitives; pub mod sequencer_client; pub mod transaction; -pub mod error; //Module for tests utility functions +//TODO: Compile only for tests pub mod test_utils; pub type HashType = [u8; 32]; - diff --git a/common/src/sequencer_client/mod.rs b/common/src/sequencer_client/mod.rs index cbcd077..9c5e782 100644 --- a/common/src/sequencer_client/mod.rs +++ b/common/src/sequencer_client/mod.rs @@ -7,6 +7,7 @@ use json::{SendTxRequest, SendTxResponse, SequencerRpcRequest, SequencerRpcRespo use reqwest::Client; use serde_json::Value; +use crate::error::{SequencerClientError, SequencerRpcError}; use crate::rpc_primitives::requests::{ GetAccountRequest, GetAccountResponse, GetAccountsNoncesRequest, GetAccountsNoncesResponse, GetProofForCommitmentRequest, GetProofForCommitmentResponse, GetTransactionByHashRequest, @@ -14,7 +15,6 @@ use crate::rpc_primitives::requests::{ }; use crate::sequencer_client::json::AccountInitialData; use crate::transaction::{EncodedTransaction, NSSATransaction}; -use crate::error::{SequencerClientError, SequencerRpcError}; pub mod json; diff --git a/common/src/transaction.rs b/common/src/transaction.rs index 3d49556..31486b3 100644 --- a/common/src/transaction.rs +++ b/common/src/transaction.rs @@ -85,7 +85,6 @@ impl EncodedTransaction { } } - #[cfg(test)] mod tests { use sha2::{Digest, digest::FixedOutput}; From 7724b7a2dbfccb5ffdd36ab11ff7fb4d04b27702 Mon Sep 17 00:00:00 2001 From: Sergio Chouhy Date: Fri, 17 Oct 2025 17:39:03 -0300 Subject: [PATCH 15/17] remove dup test --- ci_scripts/test-ubuntu.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/ci_scripts/test-ubuntu.sh b/ci_scripts/test-ubuntu.sh index c16ba1d..2ee4aa3 100755 --- a/ci_scripts/test-ubuntu.sh +++ b/ci_scripts/test-ubuntu.sh @@ -8,7 +8,6 @@ RISC0_DEV_MODE=1 cargo test --release cd integration_tests export NSSA_WALLET_HOME_DIR=$(pwd)/configs/debug/wallet/ export RUST_LOG=info -cargo run $(pwd)/configs/debug all echo "Try test valid proof at least once" cargo run $(pwd)/configs/debug test_success_private_transfer_to_another_owned_account echo "Continuing in dev mode" From 3b3493df94b456db16c1a4d41e35e391c595e171 Mon Sep 17 00:00:00 2001 From: Sergio Chouhy Date: Tue, 21 Oct 2025 09:14:29 -0300 Subject: [PATCH 16/17] add await --- integration_tests/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_tests/src/lib.rs b/integration_tests/src/lib.rs index a170564..ec04130 100644 --- a/integration_tests/src/lib.rs +++ b/integration_tests/src/lib.rs @@ -1410,7 +1410,7 @@ pub async fn test_program_deployment() { let message = nssa::program_deployment_transaction::Message::new(bytecode.clone()); let transaction = ProgramDeploymentTransaction::new(message); - let wallet_config = fetch_config().unwrap(); + let wallet_config = fetch_config().await.unwrap(); let seq_client = SequencerClient::new(wallet_config.sequencer_addr.clone()).unwrap(); let _response = seq_client.send_tx_program(transaction).await.unwrap(); From 32b7780ff3caa679b87c2d91198e33ce12529e07 Mon Sep 17 00:00:00 2001 From: Sergio Chouhy Date: Tue, 21 Oct 2025 09:28:00 -0300 Subject: [PATCH 17/17] remove unused dep --- common/Cargo.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/common/Cargo.toml b/common/Cargo.toml index dc19a33..999c731 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -16,9 +16,5 @@ hex.workspace = true nssa-core = { path = "../nssa/core", features = ["host"] } borsh.workspace = true -[dependencies.generic-array] -version = "1.3.3" -features = ["zeroize"] - [dependencies.nssa] path = "../nssa"