Merge 4bcffafe274151617975b7afe16c61b8a08d6b97 into d3390efc6db215cef35ba1d6d1f5e13277fe9597

This commit is contained in:
Sergio Chouhy 2026-06-01 17:12:08 -03:00 committed by GitHub
commit 422ad19ea6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
305 changed files with 1985 additions and 1915 deletions

View File

@ -13,8 +13,7 @@ ignore = [
{ id = "RUSTSEC-2025-0055", reason = "`tracing-subscriber` v0.2.25 pulled in by ark-relations v0.4.0 - will be addressed before mainnet" }, { id = "RUSTSEC-2025-0055", reason = "`tracing-subscriber` v0.2.25 pulled in by ark-relations v0.4.0 - will be addressed before mainnet" },
{ id = "RUSTSEC-2025-0141", reason = "`bincode` is unmaintained but continuing to use it." }, { id = "RUSTSEC-2025-0141", reason = "`bincode` is unmaintained but continuing to use it." },
{ id = "RUSTSEC-2023-0089", reason = "atomic-polyfill is pulled transitively via risc0-zkvm; waiting on upstream fix (see https://github.com/risc0/risc0/issues/3453)" }, { id = "RUSTSEC-2023-0089", reason = "atomic-polyfill is pulled transitively via risc0-zkvm; waiting on upstream fix (see https://github.com/risc0/risc0/issues/3453)" },
{ id = "RUSTSEC-2026-0097", reason = "`rand` v0.8.5 is present transitively from logos crates, modification may break integration" }, { id = "RUSTSEC-2026-0118", reason = "`hickory-proto` v0.25.0-alpha.5 is present transitively from logos crates, modification may break integration" },
{ id = "RUSTSEC-2026-0118", reason = "`hickory-proto` v0.25.0-alpha.5 is present transitively from logos crates, modification may break integration" },
{ id = "RUSTSEC-2026-0119", reason = "`hickory-proto` v0.25.0-alpha.5 is present transitively from logos crates, modification may break integration" }, { id = "RUSTSEC-2026-0119", reason = "`hickory-proto` v0.25.0-alpha.5 is present transitively from logos crates, modification may break integration" },
{ id = "RUSTSEC-2024-0370", reason = "transitive dependency of `logos-blockchain-http-api-common`, can't do anything than wait for upstream fix" }, { id = "RUSTSEC-2024-0370", reason = "transitive dependency of `logos-blockchain-http-api-common`, can't do anything than wait for upstream fix" },
] ]

View File

@ -16,4 +16,4 @@ runs:
env: env:
GITHUB_TOKEN: ${{ inputs.github-token }} GITHUB_TOKEN: ${{ inputs.github-token }}
run: | run: |
curl -sSL https://raw.githubusercontent.com/logos-blockchain/logos-blockchain/main/scripts/setup-logos-blockchain-circuits.sh | bash curl -sSL https://raw.githubusercontent.com/logos-blockchain/logos-blockchain/6ac348bea4160ca708b70a86b3964e9f1ce82fff/scripts/setup-logos-blockchain-circuits.sh | bash

View File

@ -3,7 +3,7 @@ on:
paths: paths:
- "tools/crypto_primitives_bench/**" - "tools/crypto_primitives_bench/**"
- "key_protocol/**" - "key_protocol/**"
- "nssa/core/**" - "lee/core/**"
- ".github/workflows/bench-regression.yml" - ".github/workflows/bench-regression.yml"
permissions: permissions:

View File

@ -27,9 +27,9 @@ Allowed `type` values:
- `revert` - `revert`
Examples: Examples:
- `feat(nssa): add private PDA support` - `feat(lee): add private PDA support`
- `fix(wallet): correct fee calculation` - `fix(wallet): correct fee calculation`
- `feat(nssa)!: rename AccountId::from((prog, seed)) to AccountId::for_public_pda` - `feat(lee)!: rename AccountId::from((prog, seed)) to AccountId::for_public_pda`
Breaking changes: Breaking changes:
- Mark with `!` in the title. - Mark with `!` in the title.

1426
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -6,13 +6,13 @@ resolver = "3"
members = [ members = [
"integration_tests", "integration_tests",
"storage", "storage",
"key_protocol", "lee/key_protocol",
"mempool", "mempool",
"wallet", "wallet",
"wallet-ffi", "wallet-ffi",
"common", "common",
"nssa", "lee/state_machine",
"nssa/core", "lee/state_machine/core",
"programs/amm/core", "programs/amm/core",
"programs/amm", "programs/amm",
"programs/clock/core", "programs/clock/core",
@ -50,12 +50,12 @@ members = [
] ]
[workspace.dependencies] [workspace.dependencies]
nssa = { path = "nssa" } lee = { path = "lee/state_machine" }
nssa_core = { path = "nssa/core" } lee_core = { path = "lee/state_machine/core" }
common = { path = "common" } common = { path = "common" }
mempool = { path = "mempool" } mempool = { path = "mempool" }
storage = { path = "storage" } storage = { path = "storage" }
key_protocol = { path = "key_protocol" } key_protocol = { path = "lee/key_protocol" }
sequencer_core = { path = "sequencer/core" } sequencer_core = { path = "sequencer/core" }
sequencer_service_protocol = { path = "sequencer/service/protocol" } sequencer_service_protocol = { path = "sequencer/service/protocol" }
sequencer_service_rpc = { path = "sequencer/service/rpc" } sequencer_service_rpc = { path = "sequencer/service/rpc" }

View File

@ -63,7 +63,7 @@ run-explorer:
[working-directory: 'wallet'] [working-directory: 'wallet']
run-wallet +args: run-wallet +args:
@echo "🔑 Running wallet" @echo "🔑 Running wallet"
NSSA_WALLET_HOME_DIR=$(pwd)/configs/debug cargo run --release -p wallet -- {{args}} LEE_WALLET_HOME_DIR=$(pwd)/configs/debug cargo run --release -p wallet -- {{args}}
# Clean runtime data # Clean runtime data
clean: clean:

View File

@ -80,7 +80,7 @@ For each tag we publish docker images of our services.
If you depend on this project you can pin your rust dependency to a git tag like this: If you depend on this project you can pin your rust dependency to a git tag like this:
```toml ```toml
nssa_core = { git = "https://github.com/logos-blockchain/logos-execution-zone.git", tag = "v0.1.0" } lee_core = { git = "https://github.com/logos-blockchain/logos-execution-zone.git", tag = "v0.1.0" }
``` ```
# Install dependencies # Install dependencies
@ -134,7 +134,7 @@ RISC0_DEV_MODE=1 cargo test --release
### Integration tests ### Integration tests
```bash ```bash
export NSSA_WALLET_HOME_DIR=$(pwd)/integration_tests/configs/debug/wallet/ export LEE_WALLET_HOME_DIR=$(pwd)/integration_tests/configs/debug/wallet/
cd integration_tests cd integration_tests
# RISC0_DEV_MODE=1 skips proof generation; RUST_LOG=info enables runtime logs # RISC0_DEV_MODE=1 skips proof generation; RUST_LOG=info enables runtime logs
RUST_LOG=info RISC0_DEV_MODE=1 cargo run $(pwd)/configs/debug all RUST_LOG=info RISC0_DEV_MODE=1 cargo run $(pwd)/configs/debug all

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -8,8 +8,8 @@ license = { workspace = true }
workspace = true workspace = true
[dependencies] [dependencies]
nssa.workspace = true lee.workspace = true
nssa_core.workspace = true lee_core.workspace = true
authenticated_transfer_core.workspace = true authenticated_transfer_core.workspace = true
clock_core.workspace = true clock_core.workspace = true

View File

@ -1,10 +1,10 @@
use borsh::{BorshDeserialize, BorshSerialize}; use borsh::{BorshDeserialize, BorshSerialize};
use nssa_core::BlockId; use lee_core::BlockId;
pub use nssa_core::Timestamp; pub use lee_core::Timestamp;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use sha2::{Digest as _, Sha256, digest::FixedOutput as _}; use sha2::{Digest as _, Sha256, digest::FixedOutput as _};
use crate::{HashType, transaction::NSSATransaction}; use crate::{HashType, transaction::LeeTransaction};
pub type MantleMsgId = [u8; 32]; pub type MantleMsgId = [u8; 32];
pub type BlockHash = HashType; pub type BlockHash = HashType;
@ -35,12 +35,12 @@ pub struct BlockHeader {
pub prev_block_hash: BlockHash, pub prev_block_hash: BlockHash,
pub hash: BlockHash, pub hash: BlockHash,
pub timestamp: Timestamp, pub timestamp: Timestamp,
pub signature: nssa::Signature, pub signature: lee::Signature,
} }
#[derive(Debug, Clone, BorshSerialize, BorshDeserialize)] #[derive(Debug, Clone, BorshSerialize, BorshDeserialize)]
pub struct BlockBody { pub struct BlockBody {
pub transactions: Vec<NSSATransaction>, pub transactions: Vec<LeeTransaction>,
} }
#[derive(Debug, Clone, BorshSerialize, BorshDeserialize)] #[derive(Debug, Clone, BorshSerialize, BorshDeserialize)]
@ -75,14 +75,14 @@ pub struct HashableBlockData {
pub block_id: BlockId, pub block_id: BlockId,
pub prev_block_hash: BlockHash, pub prev_block_hash: BlockHash,
pub timestamp: Timestamp, pub timestamp: Timestamp,
pub transactions: Vec<NSSATransaction>, pub transactions: Vec<LeeTransaction>,
} }
impl HashableBlockData { impl HashableBlockData {
#[must_use] #[must_use]
pub fn into_pending_block( pub fn into_pending_block(
self, self,
signing_key: &nssa::PrivateKey, signing_key: &lee::PrivateKey,
bedrock_parent_id: MantleMsgId, bedrock_parent_id: MantleMsgId,
) -> Block { ) -> Block {
const PREFIX: &[u8; 32] = b"/LEE/v0.3/Message/Block/\x00\x00\x00\x00\x00\x00\x00\x00"; const PREFIX: &[u8; 32] = b"/LEE/v0.3/Message/Block/\x00\x00\x00\x00\x00\x00\x00\x00";
@ -98,7 +98,7 @@ impl HashableBlockData {
bytes.extend_from_slice(&data_bytes); bytes.extend_from_slice(&data_bytes);
let hash = OwnHasher::hash(&bytes); let hash = OwnHasher::hash(&bytes);
let signature = nssa::Signature::new(signing_key, &hash.0); let signature = lee::Signature::new(signing_key, &hash.0);
Block { Block {
header: BlockHeader { header: BlockHeader {
block_id: self.block_id, block_id: self.block_id,

View File

@ -1,16 +1,16 @@
use nssa::AccountId; use lee::AccountId;
use crate::{ use crate::{
HashType, HashType,
block::{Block, HashableBlockData}, block::{Block, HashableBlockData},
transaction::{NSSATransaction, clock_invocation}, transaction::{LeeTransaction, clock_invocation},
}; };
// Helpers // Helpers
#[must_use] #[must_use]
pub fn sequencer_sign_key_for_testing() -> nssa::PrivateKey { pub fn sequencer_sign_key_for_testing() -> lee::PrivateKey {
nssa::PrivateKey::try_new([37; 32]).unwrap() lee::PrivateKey::try_new([37; 32]).unwrap()
} }
// Dummy producers // Dummy producers
@ -26,9 +26,9 @@ pub fn sequencer_sign_key_for_testing() -> nssa::PrivateKey {
pub fn produce_dummy_block( pub fn produce_dummy_block(
id: u64, id: u64,
prev_hash: Option<HashType>, prev_hash: Option<HashType>,
mut transactions: Vec<NSSATransaction>, mut transactions: Vec<LeeTransaction>,
) -> Block { ) -> Block {
transactions.push(NSSATransaction::Public(clock_invocation( transactions.push(LeeTransaction::Public(clock_invocation(
id.saturating_mul(100), id.saturating_mul(100),
))); )));
@ -43,23 +43,23 @@ pub fn produce_dummy_block(
} }
#[must_use] #[must_use]
pub fn produce_dummy_empty_transaction() -> NSSATransaction { pub fn produce_dummy_empty_transaction() -> LeeTransaction {
let program_id = nssa::program::Program::authenticated_transfer_program().id(); let program_id = lee::program::Program::authenticated_transfer_program().id();
let account_ids = vec![]; let account_ids = vec![];
let nonces = vec![]; let nonces = vec![];
let message = nssa::public_transaction::Message::try_new( let message = lee::public_transaction::Message::try_new(
program_id, program_id,
account_ids, account_ids,
nonces, nonces,
authenticated_transfer_core::Instruction::Initialize, authenticated_transfer_core::Instruction::Initialize,
) )
.unwrap(); .unwrap();
let private_key = nssa::PrivateKey::try_new([1; 32]).unwrap(); let private_key = lee::PrivateKey::try_new([1; 32]).unwrap();
let witness_set = nssa::public_transaction::WitnessSet::for_message(&message, &[&private_key]); let witness_set = lee::public_transaction::WitnessSet::for_message(&message, &[&private_key]);
let nssa_tx = nssa::PublicTransaction::new(message, witness_set); let lee_tx = lee::PublicTransaction::new(message, witness_set);
NSSATransaction::Public(nssa_tx) LeeTransaction::Public(lee_tx)
} }
#[must_use] #[must_use]
@ -68,12 +68,12 @@ pub fn create_transaction_native_token_transfer(
nonce: u128, nonce: u128,
to: AccountId, to: AccountId,
balance_to_move: u128, balance_to_move: u128,
signing_key: &nssa::PrivateKey, signing_key: &lee::PrivateKey,
) -> NSSATransaction { ) -> LeeTransaction {
let account_ids = vec![from, to]; let account_ids = vec![from, to];
let nonces = vec![nonce.into()]; let nonces = vec![nonce.into()];
let program_id = nssa::program::Program::authenticated_transfer_program().id(); let program_id = lee::program::Program::authenticated_transfer_program().id();
let message = nssa::public_transaction::Message::try_new( let message = lee::public_transaction::Message::try_new(
program_id, program_id,
account_ids, account_ids,
nonces, nonces,
@ -82,9 +82,9 @@ pub fn create_transaction_native_token_transfer(
}, },
) )
.unwrap(); .unwrap();
let witness_set = nssa::public_transaction::WitnessSet::for_message(&message, &[signing_key]); let witness_set = lee::public_transaction::WitnessSet::for_message(&message, &[signing_key]);
let nssa_tx = nssa::PublicTransaction::new(message, witness_set); let lee_tx = lee::PublicTransaction::new(message, witness_set);
NSSATransaction::Public(nssa_tx) LeeTransaction::Public(lee_tx)
} }

View File

@ -1,31 +1,31 @@
use borsh::{BorshDeserialize, BorshSerialize}; use borsh::{BorshDeserialize, BorshSerialize};
use lee::{AccountId, V03State, ValidatedStateDiff};
use lee_core::{BlockId, Timestamp};
use log::warn; use log::warn;
use nssa::{AccountId, V03State, ValidatedStateDiff};
use nssa_core::{BlockId, Timestamp};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use crate::HashType; use crate::HashType;
#[derive(Debug, Clone, PartialEq, Eq, BorshSerialize, BorshDeserialize)] #[derive(Debug, Clone, PartialEq, Eq, BorshSerialize, BorshDeserialize)]
pub enum NSSATransaction { pub enum LeeTransaction {
Public(nssa::PublicTransaction), Public(lee::PublicTransaction),
PrivacyPreserving(nssa::PrivacyPreservingTransaction), PrivacyPreserving(lee::PrivacyPreservingTransaction),
ProgramDeployment(nssa::ProgramDeploymentTransaction), ProgramDeployment(lee::ProgramDeploymentTransaction),
} }
impl Serialize for NSSATransaction { impl Serialize for LeeTransaction {
fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> { fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
crate::borsh_base64::serialize(self, serializer) crate::borsh_base64::serialize(self, serializer)
} }
} }
impl<'de> Deserialize<'de> for NSSATransaction { impl<'de> Deserialize<'de> for LeeTransaction {
fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> { fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
crate::borsh_base64::deserialize(deserializer) crate::borsh_base64::deserialize(deserializer)
} }
} }
impl NSSATransaction { impl LeeTransaction {
#[must_use] #[must_use]
pub fn hash(&self) -> HashType { pub fn hash(&self) -> HashType {
HashType(match self { HashType(match self {
@ -77,7 +77,7 @@ impl NSSATransaction {
state: &V03State, state: &V03State,
block_id: BlockId, block_id: BlockId,
timestamp: Timestamp, timestamp: Timestamp,
) -> Result<ValidatedStateDiff, nssa::error::NssaError> { ) -> Result<ValidatedStateDiff, lee::error::LeeError> {
let diff = match self { let diff = match self {
Self::Public(tx) => { Self::Public(tx) => {
ValidatedStateDiff::from_public_transaction(tx, state, block_id, timestamp) ValidatedStateDiff::from_public_transaction(tx, state, block_id, timestamp)
@ -90,9 +90,9 @@ impl NSSATransaction {
} }
}?; }?;
let system_accounts = nssa::CLOCK_PROGRAM_ACCOUNT_IDS.iter().copied().chain([ let system_accounts = lee::CLOCK_PROGRAM_ACCOUNT_IDS.iter().copied().chain([
nssa::system_faucet_account_id(), lee::system_faucet_account_id(),
nssa::system_bridge_account_id(), lee::system_bridge_account_id(),
]); ]);
for account_id in system_accounts { for account_id in system_accounts {
validate_doesnt_modify_account(state, &diff, account_id)?; validate_doesnt_modify_account(state, &diff, account_id)?;
@ -108,7 +108,7 @@ impl NSSATransaction {
state: &mut V03State, state: &mut V03State,
block_id: BlockId, block_id: BlockId,
timestamp: Timestamp, timestamp: Timestamp,
) -> Result<Self, nssa::error::NssaError> { ) -> Result<Self, lee::error::LeeError> {
let diff = self let diff = self
.validate_on_state(state, block_id, timestamp) .validate_on_state(state, block_id, timestamp)
.inspect_err(|err| warn!("Error at transition {err:#?}"))?; .inspect_err(|err| warn!("Error at transition {err:#?}"))?;
@ -117,20 +117,20 @@ impl NSSATransaction {
} }
} }
impl From<nssa::PublicTransaction> for NSSATransaction { impl From<lee::PublicTransaction> for LeeTransaction {
fn from(value: nssa::PublicTransaction) -> Self { fn from(value: lee::PublicTransaction) -> Self {
Self::Public(value) Self::Public(value)
} }
} }
impl From<nssa::PrivacyPreservingTransaction> for NSSATransaction { impl From<lee::PrivacyPreservingTransaction> for LeeTransaction {
fn from(value: nssa::PrivacyPreservingTransaction) -> Self { fn from(value: lee::PrivacyPreservingTransaction) -> Self {
Self::PrivacyPreserving(value) Self::PrivacyPreserving(value)
} }
} }
impl From<nssa::ProgramDeploymentTransaction> for NSSATransaction { impl From<lee::ProgramDeploymentTransaction> for LeeTransaction {
fn from(value: nssa::ProgramDeploymentTransaction) -> Self { fn from(value: lee::ProgramDeploymentTransaction) -> Self {
Self::ProgramDeployment(value) Self::ProgramDeployment(value)
} }
} }
@ -157,17 +157,17 @@ pub enum TransactionMalformationError {
/// Returns the canonical Clock Program invocation transaction for the given block timestamp. /// Returns the canonical Clock Program invocation transaction for the given block timestamp.
/// Every valid block must end with exactly one occurrence of this transaction. /// Every valid block must end with exactly one occurrence of this transaction.
#[must_use] #[must_use]
pub fn clock_invocation(timestamp: clock_core::Instruction) -> nssa::PublicTransaction { pub fn clock_invocation(timestamp: clock_core::Instruction) -> lee::PublicTransaction {
let message = nssa::public_transaction::Message::try_new( let message = lee::public_transaction::Message::try_new(
nssa::program::Program::clock().id(), lee::program::Program::clock().id(),
clock_core::CLOCK_PROGRAM_ACCOUNT_IDS.to_vec(), clock_core::CLOCK_PROGRAM_ACCOUNT_IDS.to_vec(),
vec![], vec![],
timestamp, timestamp,
) )
.expect("Clock invocation message should always be constructable"); .expect("Clock invocation message should always be constructable");
nssa::PublicTransaction::new( lee::PublicTransaction::new(
message, message,
nssa::public_transaction::WitnessSet::from_raw_parts(vec![]), lee::public_transaction::WitnessSet::from_raw_parts(vec![]),
) )
} }
@ -175,13 +175,13 @@ fn validate_doesnt_modify_account(
state: &V03State, state: &V03State,
diff: &ValidatedStateDiff, diff: &ValidatedStateDiff,
account_id: AccountId, account_id: AccountId,
) -> Result<(), nssa::error::NssaError> { ) -> Result<(), lee::error::LeeError> {
if diff if diff
.public_diff() .public_diff()
.get(&account_id) .get(&account_id)
.is_some_and(|post| *post != state.get_account_by_id(account_id)) .is_some_and(|post| *post != state.get_account_by_id(account_id))
{ {
Err(nssa::error::NssaError::InvalidInput(format!( Err(lee::error::LeeError::InvalidInput(format!(
"Transaction modifies restricted system account {account_id}" "Transaction modifies restricted system account {account_id}"
))) )))
} else { } else {

View File

@ -9,8 +9,8 @@ workspace = true
[dependencies] [dependencies]
common.workspace = true common.workspace = true
nssa.workspace = true lee.workspace = true
nssa_core.workspace = true lee_core.workspace = true
sequencer_service_rpc = { workspace = true, features = ["client"] } sequencer_service_rpc = { workspace = true, features = ["client"] }
wallet.workspace = true wallet.workspace = true

View File

@ -134,7 +134,7 @@ echo -n SG9sYSBtdW5kbyE= | base64 -d
You should see `Hola mundo!`. You should see `Hola mundo!`.
# 5. Understanding the code in `hello_world.rs`. # 5. Understanding the code in `hello_world.rs`.
The Hello world example demonstrates the minimal structure of an NSSA program. The Hello world example demonstrates the minimal structure of a LEE program.
Its purpose is very simple: append the instruction bytes to the data field of a single account. Its purpose is very simple: append the instruction bytes to the data field of a single account.
### What this program does in a nutshell ### What this program does in a nutshell
@ -145,7 +145,7 @@ Its purpose is very simple: append the instruction bytes to the data field of a
2. Checks that there is exactly one input account: this example operates on a single account, so it expects `pre_states` to contain exactly one entry. 2. Checks that there is exactly one input account: this example operates on a single account, so it expects `pre_states` to contain exactly one entry.
3. Builds the post-state: It clones the input account and appends the instruction bytes to its data field. 3. Builds the post-state: It clones the input account and appends the instruction bytes to its data field.
4. Handles account claiming logic: If the account is uninitialized (i.e. not yet claimed by any program), its program_owner will equal `DEFAULT_PROGRAM_ID`. In that case, the program issues a claim request, meaning: "This program now owns this account." 4. Handles account claiming logic: If the account is uninitialized (i.e. not yet claimed by any program), its program_owner will equal `DEFAULT_PROGRAM_ID`. In that case, the program issues a claim request, meaning: "This program now owns this account."
5. Outputs the proposed state transition: `write_nssa_outputs` emits: 5. Outputs the proposed state transition: `write_lee_outputs` emits:
- The original instruction data - The original instruction data
- The original pre-states - The original pre-states
- The new post-states - The new post-states
@ -154,7 +154,7 @@ Its purpose is very simple: append the instruction bytes to the data field of a
1. Reading inputs: 1. Reading inputs:
```rust ```rust
let (ProgramInput { pre_states, instruction: greeting }, instruction_data) let (ProgramInput { pre_states, instruction: greeting }, instruction_data)
= read_nssa_inputs::<Instruction>(); = read_lee_inputs::<Instruction>();
``` ```
2. Extracting the single account: 2. Extracting the single account:
```rust ```rust
@ -179,7 +179,7 @@ let post_state = if post_account.program_owner == DEFAULT_PROGRAM_ID {
``` ```
5. Emmiting the output 5. Emmiting the output
```rust ```rust
write_nssa_outputs(instruction_data, vec![pre_state], vec![post_state]); write_lee_outputs(instruction_data, vec![pre_state], vec![post_state]);
``` ```
# 6. Understanding the runner script `run_hello_world.rs` # 6. Understanding the runner script `run_hello_world.rs`
@ -348,7 +348,7 @@ Check the `run_hello_world_private.rs` file to see how it is used.
# 8. Account authorization mechanism # 8. Account authorization mechanism
The Hello world example does not enforce any authorization on the input account. This means any user can execute it on any account, regardless of ownership. The Hello world example does not enforce any authorization on the input account. This means any user can execute it on any account, regardless of ownership.
NSSA provides a mechanism for programs to enforce proper authorization before an execution can succeed. The meaning of authorization differs between public and private accounts: LEE provides a mechanism for programs to enforce proper authorization before an execution can succeed. The meaning of authorization differs between public and private accounts:
- Public accounts: authorization requires that the transaction is signed with the accounts signing key. - Public accounts: authorization requires that the transaction is signed with the accounts signing key.
- Private accounts: authorization requires that the circuit verifies knowledge of the accounts nullifier secret key. - Private accounts: authorization requires that the circuit verifies knowledge of the accounts nullifier secret key.
@ -594,7 +594,7 @@ wallet account get --account-id Private/8vzkK7vsdrS2gdPhLk72La8X4FJkgJ5kJLUBRbEV
## Digression: account authority vs account program ownership ## Digression: account authority vs account program ownership
In NSSA there are two distinct concepts that control who can modify an account: In LEE there are two distinct concepts that control who can modify an account:
**Program Ownership:** Each account has a field: `program_owner: ProgramId`. **Program Ownership:** Each account has a field: `program_owner: ProgramId`.
This indicates which program is allowed to update the accounts state during execution. This indicates which program is allowed to update the accounts state during execution.
- If a program is the program_owner of an account, it can freely mutate its fields. - If a program is the program_owner of an account, it can freely mutate its fields.

View File

@ -8,7 +8,7 @@ license = { workspace = true }
workspace = true workspace = true
[dependencies] [dependencies]
nssa_core.workspace = true lee_core.workspace = true
hex.workspace = true hex.workspace = true
bytemuck.workspace = true bytemuck.workspace = true

View File

@ -1,4 +1,4 @@
use nssa_core::program::{AccountPostState, Claim, ProgramInput, ProgramOutput, read_nssa_inputs}; use lee_core::program::{AccountPostState, Claim, ProgramInput, ProgramOutput, read_lee_inputs};
// Hello-world example program. // Hello-world example program.
// //
@ -25,7 +25,7 @@ fn main() {
instruction: greeting, instruction: greeting,
}, },
instruction_data, instruction_data,
) = read_nssa_inputs::<Instruction>(); ) = read_lee_inputs::<Instruction>();
// Unpack the input account pre state // Unpack the input account pre state
let [pre_state] = pre_states let [pre_state] = pre_states
@ -49,7 +49,7 @@ fn main() {
// The output is a proposed state difference. It will only succeed if the pre states coincide // The output is a proposed state difference. It will only succeed if the pre states coincide
// with the previous values of the accounts, and the transition to the post states conforms // with the previous values of the accounts, and the transition to the post states conforms
// with the NSSA program rules. // with the LEE program rules.
// WARNING: constructing a `ProgramOutput` has no effect on its own. `.write()` must be // WARNING: constructing a `ProgramOutput` has no effect on its own. `.write()` must be
// called to commit the output. // called to commit the output.
ProgramOutput::new( ProgramOutput::new(

View File

@ -1,4 +1,4 @@
use nssa_core::program::{AccountPostState, Claim, ProgramInput, ProgramOutput, read_nssa_inputs}; use lee_core::program::{AccountPostState, Claim, ProgramInput, ProgramOutput, read_lee_inputs};
// Hello-world with authorization example program. // Hello-world with authorization example program.
// //
@ -25,7 +25,7 @@ fn main() {
instruction: greeting, instruction: greeting,
}, },
instruction_data, instruction_data,
) = read_nssa_inputs::<Instruction>(); ) = read_lee_inputs::<Instruction>();
// Unpack the input account pre state // Unpack the input account pre state
let [pre_state] = pre_states let [pre_state] = pre_states
@ -56,7 +56,7 @@ fn main() {
// The output is a proposed state difference. It will only succeed if the pre states coincide // The output is a proposed state difference. It will only succeed if the pre states coincide
// with the previous values of the accounts, and the transition to the post states conforms // with the previous values of the accounts, and the transition to the post states conforms
// with the NSSA program rules. // with the LEE program rules.
// WARNING: constructing a `ProgramOutput` has no effect on its own. `.write()` must be // WARNING: constructing a `ProgramOutput` has no effect on its own. `.write()` must be
// called to commit the output. // called to commit the output.
ProgramOutput::new( ProgramOutput::new(

View File

@ -1,6 +1,6 @@
use nssa_core::{ use lee_core::{
account::{AccountWithMetadata, Data}, account::{AccountWithMetadata, Data},
program::{AccountPostState, Claim, ProgramInput, ProgramOutput, read_nssa_inputs}, program::{AccountPostState, Claim, ProgramInput, ProgramOutput, read_lee_inputs},
}; };
// Hello-world with write + move_data example program. // Hello-world with write + move_data example program.
@ -72,7 +72,7 @@ fn main() {
instruction: (function_id, data), instruction: (function_id, data),
}, },
instruction_words, instruction_words,
) = read_nssa_inputs::<Instruction>(); ) = read_lee_inputs::<Instruction>();
let post_states = match (pre_states.as_slice(), function_id, data.len()) { let post_states = match (pre_states.as_slice(), function_id, data.len()) {
([account_pre], WRITE_FUNCTION_ID, _) => { ([account_pre], WRITE_FUNCTION_ID, _) => {

View File

@ -1,5 +1,5 @@
use nssa_core::program::{ use lee_core::program::{
AccountPostState, ChainedCall, ProgramId, ProgramInput, ProgramOutput, read_nssa_inputs, AccountPostState, ChainedCall, ProgramId, ProgramInput, ProgramOutput, read_lee_inputs,
}; };
// Tail Call example program. // Tail Call example program.
@ -33,7 +33,7 @@ fn main() {
instruction: (), instruction: (),
}, },
instruction_data, instruction_data,
) = read_nssa_inputs::<()>(); ) = read_lee_inputs::<()>();
// Unpack the input account pre state // Unpack the input account pre state
let [pre_state] = pre_states let [pre_state] = pre_states

View File

@ -1,6 +1,5 @@
use nssa_core::program::{ use lee_core::program::{
AccountPostState, ChainedCall, PdaSeed, ProgramId, ProgramInput, ProgramOutput, AccountPostState, ChainedCall, PdaSeed, ProgramId, ProgramInput, ProgramOutput, read_lee_inputs,
read_nssa_inputs,
}; };
// Tail Call with PDA example program. // Tail Call with PDA example program.
@ -39,7 +38,7 @@ fn main() {
instruction: (), instruction: (),
}, },
instruction_data, instruction_data,
) = read_nssa_inputs::<()>(); ) = read_lee_inputs::<()>();
// Unpack the input account pre state // Unpack the input account pre state
let [pre_state] = pre_states let [pre_state] = pre_states

View File

@ -1,5 +1,5 @@
use common::transaction::NSSATransaction; use common::transaction::LeeTransaction;
use nssa::{ use lee::{
AccountId, PublicTransaction, AccountId, PublicTransaction,
program::Program, program::Program,
public_transaction::{Message, WitnessSet}, public_transaction::{Message, WitnessSet},
@ -60,7 +60,7 @@ async fn main() {
// Submit the transaction // Submit the transaction
let _response = wallet_core let _response = wallet_core
.sequencer_client .sequencer_client
.send_transaction(NSSATransaction::Public(tx)) .send_transaction(LeeTransaction::Public(tx))
.await .await
.unwrap(); .unwrap();
} }

View File

@ -1,4 +1,4 @@
use nssa::{AccountId, program::Program}; use lee::{AccountId, program::Program};
use wallet::{AccountIdentity, WalletCore}; use wallet::{AccountIdentity, WalletCore};
// Before running this example, compile the `hello_world.rs` guest program with: // Before running this example, compile the `hello_world.rs` guest program with:

View File

@ -1,5 +1,5 @@
use common::transaction::NSSATransaction; use common::transaction::LeeTransaction;
use nssa::{ use lee::{
AccountId, PublicTransaction, AccountId, PublicTransaction,
program::Program, program::Program,
public_transaction::{Message, WitnessSet}, public_transaction::{Message, WitnessSet},
@ -56,7 +56,7 @@ async fn main() {
// Submit the transaction // Submit the transaction
let _response = wallet_core let _response = wallet_core
.sequencer_client .sequencer_client
.send_transaction(NSSATransaction::Public(tx)) .send_transaction(LeeTransaction::Public(tx))
.await .await
.unwrap(); .unwrap();
} }

View File

@ -1,6 +1,6 @@
use std::collections::HashMap; use std::collections::HashMap;
use nssa::{ use lee::{
AccountId, ProgramId, privacy_preserving_transaction::circuit::ProgramWithDependencies, AccountId, ProgramId, privacy_preserving_transaction::circuit::ProgramWithDependencies,
program::Program, program::Program,
}; };

View File

@ -1,5 +1,5 @@
use common::transaction::NSSATransaction; use common::transaction::LeeTransaction;
use nssa::{ use lee::{
AccountId, PublicTransaction, AccountId, PublicTransaction,
program::Program, program::Program,
public_transaction::{Message, WitnessSet}, public_transaction::{Message, WitnessSet},
@ -73,7 +73,7 @@ async fn main() {
// Submit the transaction // Submit the transaction
let _response = wallet_core let _response = wallet_core
.sequencer_client .sequencer_client
.send_transaction(NSSATransaction::Public(tx)) .send_transaction(LeeTransaction::Public(tx))
.await .await
.unwrap(); .unwrap();
} }

View File

@ -3,13 +3,13 @@
reason = "This is an example program, it's fine to print to stdout" reason = "This is an example program, it's fine to print to stdout"
)] )]
use common::transaction::NSSATransaction; use common::transaction::LeeTransaction;
use nssa::{ use lee::{
AccountId, PublicTransaction, AccountId, PublicTransaction,
program::Program, program::Program,
public_transaction::{Message, WitnessSet}, public_transaction::{Message, WitnessSet},
}; };
use nssa_core::program::PdaSeed; use lee_core::program::PdaSeed;
use sequencer_service_rpc::RpcClient as _; use sequencer_service_rpc::RpcClient as _;
use wallet::WalletCore; use wallet::WalletCore;
@ -58,7 +58,7 @@ async fn main() {
// Submit the transaction // Submit the transaction
let _response = wallet_core let _response = wallet_core
.sequencer_client .sequencer_client
.send_transaction(NSSATransaction::Public(tx)) .send_transaction(LeeTransaction::Public(tx))
.await .await
.unwrap(); .unwrap();

View File

@ -1,6 +1,6 @@
use clap::{Parser, Subcommand}; use clap::{Parser, Subcommand};
use common::transaction::NSSATransaction; use common::transaction::LeeTransaction;
use nssa::{PublicTransaction, program::Program, public_transaction}; use lee::{PublicTransaction, program::Program, public_transaction};
use sequencer_service_rpc::RpcClient as _; use sequencer_service_rpc::RpcClient as _;
use wallet::{AccountIdentity, WalletCore}; use wallet::{AccountIdentity, WalletCore};
@ -89,7 +89,7 @@ async fn main() {
// Submit the transaction // Submit the transaction
let _response = wallet_core let _response = wallet_core
.sequencer_client .sequencer_client
.send_transaction(NSSATransaction::Public(tx)) .send_transaction(LeeTransaction::Public(tx))
.await .await
.unwrap(); .unwrap();
} }
@ -128,7 +128,7 @@ async fn main() {
// Submit the transaction // Submit the transaction
let _response = wallet_core let _response = wallet_core
.sequencer_client .sequencer_client
.send_transaction(NSSATransaction::Public(tx)) .send_transaction(LeeTransaction::Public(tx))
.await .await
.unwrap(); .unwrap();
} }

View File

@ -10,8 +10,8 @@ workspace = true
[dependencies] [dependencies]
common.workspace = true common.workspace = true
logos-blockchain-zone-sdk.workspace = true logos-blockchain-zone-sdk.workspace = true
nssa.workspace = true lee.workspace = true
nssa_core.workspace = true lee_core.workspace = true
storage.workspace = true storage.workspace = true
testnet_initial_state.workspace = true testnet_initial_state.workspace = true

View File

@ -3,13 +3,13 @@ use std::{path::Path, sync::Arc};
use anyhow::{Context as _, Result}; use anyhow::{Context as _, Result};
use common::{ use common::{
block::{BedrockStatus, Block}, block::{BedrockStatus, Block},
transaction::{NSSATransaction, clock_invocation}, transaction::{LeeTransaction, clock_invocation},
}; };
use lee::{Account, AccountId, V03State};
use lee_core::BlockId;
use log::info; use log::info;
use logos_blockchain_core::header::HeaderId; use logos_blockchain_core::header::HeaderId;
use logos_blockchain_zone_sdk::Slot; use logos_blockchain_zone_sdk::Slot;
use nssa::{Account, AccountId, V03State};
use nssa_core::BlockId;
use storage::indexer::RocksDBIO; use storage::indexer::RocksDBIO;
use tokio::sync::RwLock; use tokio::sync::RwLock;
@ -53,7 +53,7 @@ impl IndexerStore {
Ok(self.dbio.get_block_batch(before, limit)?) Ok(self.dbio.get_block_batch(before, limit)?)
} }
pub fn get_transaction_by_hash(&self, tx_hash: [u8; 32]) -> Result<Option<NSSATransaction>> { pub fn get_transaction_by_hash(&self, tx_hash: [u8; 32]) -> Result<Option<LeeTransaction>> {
let Some(block_id) = self.dbio.get_block_id_by_tx_hash(tx_hash)? else { let Some(block_id) = self.dbio.get_block_id_by_tx_hash(tx_hash)? else {
return Ok(None); return Ok(None);
}; };
@ -79,7 +79,7 @@ impl IndexerStore {
acc_id: [u8; 32], acc_id: [u8; 32],
offset: u64, offset: u64,
limit: u64, limit: u64,
) -> Result<Vec<NSSATransaction>> { ) -> Result<Vec<LeeTransaction>> {
Ok(self.dbio.get_acc_transactions(acc_id, offset, limit)?) Ok(self.dbio.get_acc_transactions(acc_id, offset, limit)?)
} }
@ -146,7 +146,7 @@ impl IndexerStore {
.ok_or_else(|| anyhow::anyhow!("Block has no transactions"))?; .ok_or_else(|| anyhow::anyhow!("Block has no transactions"))?;
anyhow::ensure!( anyhow::ensure!(
*clock_tx == NSSATransaction::Public(clock_invocation(block.header.timestamp)), *clock_tx == LeeTransaction::Public(clock_invocation(block.header.timestamp)),
"Last transaction in block must be the clock invocation for the block timestamp" "Last transaction in block must be the clock invocation for the block timestamp"
); );
@ -154,9 +154,9 @@ impl IndexerStore {
for transaction in user_txs { for transaction in user_txs {
if is_genesis { if is_genesis {
let genesis_tx = match transaction { let genesis_tx = match transaction {
NSSATransaction::Public(public_tx) => public_tx, LeeTransaction::Public(public_tx) => public_tx,
NSSATransaction::PrivacyPreserving(_) LeeTransaction::PrivacyPreserving(_)
| NSSATransaction::ProgramDeployment(_) => { | LeeTransaction::ProgramDeployment(_) => {
anyhow::bail!("Genesis block should contain only public transactions") anyhow::bail!("Genesis block should contain only public transactions")
} }
}; };
@ -180,7 +180,7 @@ impl IndexerStore {
} }
// Apply the clock invocation directly (it is expected to modify clock accounts). // Apply the clock invocation directly (it is expected to modify clock accounts).
let NSSATransaction::Public(clock_public_tx) = clock_tx else { let LeeTransaction::Public(clock_public_tx) = clock_tx else {
anyhow::bail!("Clock invocation must be a public transaction"); anyhow::bail!("Clock invocation must be a public transaction");
}; };
state_guard.transition_from_public_transaction( state_guard.transition_from_public_transaction(
@ -231,7 +231,7 @@ mod tests {
let sign_key = initial_accounts[0].pub_sign_key.clone(); let sign_key = initial_accounts[0].pub_sign_key.clone();
// Submit genesis block // Submit genesis block
let clock_tx = NSSATransaction::Public(clock_invocation(0)); let clock_tx = LeeTransaction::Public(clock_invocation(0));
let genesis_block_data = HashableBlockData { let genesis_block_data = HashableBlockData {
block_id: 1, block_id: 1,
prev_block_hash: HashType::default(), prev_block_hash: HashType::default(),

View File

@ -5,7 +5,7 @@ name = "indexer_ffi"
version = "0.1.0" version = "0.1.0"
[dependencies] [dependencies]
nssa.workspace = true lee.workspace = true
indexer_service.workspace = true indexer_service.workspace = true
indexer_service_rpc = { workspace = true, features = ["client"] } indexer_service_rpc = { workspace = true, features = ["client"] }
indexer_service_protocol.workspace = true indexer_service_protocol.workspace = true

View File

@ -194,7 +194,7 @@ typedef struct FfiPublicTransactionBody {
} FfiPublicTransactionBody; } FfiPublicTransactionBody;
/** /**
* Account data structure - C-compatible version of nssa Account. * Account data structure - C-compatible version of lee Account.
* *
* Note: `balance` and `nonce` are u128 values represented as little-endian * Note: `balance` and `nonce` are u128 values represented as little-endian
* byte arrays since C doesn't have native u128 support. * byte arrays since C doesn't have native u128 support.

View File

@ -184,9 +184,8 @@ pub unsafe extern "C" fn query_account(
.map_or_else( .map_or_else(
|_| PointerResult::from_error(OperationStatus::ClientError), |_| PointerResult::from_error(OperationStatus::ClientError),
|acc| { |acc| {
let acc_nssa: nssa::Account = let acc_lee: lee::Account = acc.try_into().expect("Source is in blocks, must fit");
acc.try_into().expect("Source is in blocks, must fit"); PointerResult::from_value(acc_lee.into())
PointerResult::from_value(acc_nssa.into())
}, },
) )
} }

View File

@ -2,7 +2,7 @@ use indexer_service_protocol::ProgramId;
use crate::api::types::{FfiBytes32, FfiProgramId, FfiU128}; use crate::api::types::{FfiBytes32, FfiProgramId, FfiU128};
/// Account data structure - C-compatible version of nssa Account. /// Account data structure - C-compatible version of lee Account.
/// ///
/// Note: `balance` and `nonce` are u128 values represented as little-endian /// Note: `balance` and `nonce` are u128 values represented as little-endian
/// byte arrays since C doesn't have native u128 support. /// byte arrays since C doesn't have native u128 support.
@ -23,15 +23,15 @@ pub struct FfiAccount {
// Helper functions to convert between Rust and FFI types // Helper functions to convert between Rust and FFI types
impl From<&nssa::AccountId> for FfiBytes32 { impl From<&lee::AccountId> for FfiBytes32 {
fn from(id: &nssa::AccountId) -> Self { fn from(id: &lee::AccountId) -> Self {
Self::from_account_id(id) Self::from_account_id(id)
} }
} }
impl From<nssa::Account> for FfiAccount { impl From<lee::Account> for FfiAccount {
fn from(value: nssa::Account) -> Self { fn from(value: lee::Account) -> Self {
let nssa::Account { let lee::Account {
program_owner, program_owner,
balance, balance,
data, data,

View File

@ -48,7 +48,7 @@ impl FfiBytes32 {
/// Create from an `AccountId`. /// Create from an `AccountId`.
#[must_use] #[must_use]
pub const fn from_account_id(id: &nssa::AccountId) -> Self { pub const fn from_account_id(id: &lee::AccountId) -> Self {
Self { data: *id.value() } Self { data: *id.value() }
} }
} }

View File

@ -267,7 +267,7 @@ impl From<PrivacyPreservingMessage> for FfiPrivacyPreservingMessage {
.into(), .into(),
public_post_states: public_post_states public_post_states: public_post_states
.into_iter() .into_iter()
.map(|acc_ind| -> nssa::Account { .map(|acc_ind| -> lee::Account {
acc_ind.try_into().expect("Source is in blocks, must fit") acc_ind.try_into().expect("Source is in blocks, must fit")
}) })
.map(Into::into) .map(Into::into)

View File

@ -8,8 +8,8 @@ license = { workspace = true }
workspace = true workspace = true
[dependencies] [dependencies]
nssa_core = { workspace = true, optional = true, features = ["host"] } lee_core = { workspace = true, optional = true, features = ["host"] }
nssa = { workspace = true, optional = true } lee = { workspace = true, optional = true }
common = { workspace = true, optional = true } common = { workspace = true, optional = true }
serde = { workspace = true, features = ["derive"] } serde = { workspace = true, features = ["derive"] }
@ -21,5 +21,5 @@ hex.workspace = true
anyhow.workspace = true anyhow.workspace = true
[features] [features]
# Enable conversion to/from NSSA core types # Enable conversion to/from LEE core types
convert = ["dep:nssa_core", "dep:nssa", "dep:common"] convert = ["dep:lee_core", "dep:lee", "dep:common"]

View File

@ -1,6 +1,6 @@
//! Conversions between `indexer_service_protocol` types and `nssa/nssa_core` types. //! Conversions between `indexer_service_protocol` types and `lee/lee_core` types.
use nssa_core::account::Nonce; use lee_core::account::Nonce;
use crate::{ use crate::{
Account, AccountId, BedrockStatus, Block, BlockBody, BlockHeader, Ciphertext, Commitment, Account, AccountId, BedrockStatus, Block, BlockBody, BlockHeader, Ciphertext, Commitment,
@ -26,24 +26,24 @@ impl From<ProgramId> for [u32; 8] {
} }
} }
impl From<nssa_core::account::AccountId> for AccountId { impl From<lee_core::account::AccountId> for AccountId {
fn from(value: nssa_core::account::AccountId) -> Self { fn from(value: lee_core::account::AccountId) -> Self {
Self { Self {
value: value.into_value(), value: value.into_value(),
} }
} }
} }
impl From<AccountId> for nssa_core::account::AccountId { impl From<AccountId> for lee_core::account::AccountId {
fn from(value: AccountId) -> Self { fn from(value: AccountId) -> Self {
let AccountId { value } = value; let AccountId { value } = value;
Self::new(value) Self::new(value)
} }
} }
impl From<nssa_core::account::Account> for Account { impl From<lee_core::account::Account> for Account {
fn from(value: nssa_core::account::Account) -> Self { fn from(value: lee_core::account::Account) -> Self {
let nssa_core::account::Account { let lee_core::account::Account {
program_owner, program_owner,
balance, balance,
data, data,
@ -59,8 +59,8 @@ impl From<nssa_core::account::Account> for Account {
} }
} }
impl TryFrom<Account> for nssa_core::account::Account { impl TryFrom<Account> for lee_core::account::Account {
type Error = nssa_core::account::data::DataTooBigError; type Error = lee_core::account::data::DataTooBigError;
fn try_from(value: Account) -> Result<Self, Self::Error> { fn try_from(value: Account) -> Result<Self, Self::Error> {
let Account { let Account {
@ -79,14 +79,14 @@ impl TryFrom<Account> for nssa_core::account::Account {
} }
} }
impl From<nssa_core::account::Data> for Data { impl From<lee_core::account::Data> for Data {
fn from(value: nssa_core::account::Data) -> Self { fn from(value: lee_core::account::Data) -> Self {
Self(value.into_inner()) Self(value.into_inner())
} }
} }
impl TryFrom<Data> for nssa_core::account::Data { impl TryFrom<Data> for lee_core::account::Data {
type Error = nssa_core::account::data::DataTooBigError; type Error = lee_core::account::data::DataTooBigError;
fn try_from(value: Data) -> Result<Self, Self::Error> { fn try_from(value: Data) -> Result<Self, Self::Error> {
Self::try_from(value.0) Self::try_from(value.0)
@ -97,37 +97,37 @@ impl TryFrom<Data> for nssa_core::account::Data {
// Commitment and Nullifier conversions // Commitment and Nullifier conversions
// ============================================================================ // ============================================================================
impl From<nssa_core::Commitment> for Commitment { impl From<lee_core::Commitment> for Commitment {
fn from(value: nssa_core::Commitment) -> Self { fn from(value: lee_core::Commitment) -> Self {
Self(value.to_byte_array()) Self(value.to_byte_array())
} }
} }
impl From<Commitment> for nssa_core::Commitment { impl From<Commitment> for lee_core::Commitment {
fn from(value: Commitment) -> Self { fn from(value: Commitment) -> Self {
Self::from_byte_array(value.0) Self::from_byte_array(value.0)
} }
} }
impl From<nssa_core::Nullifier> for Nullifier { impl From<lee_core::Nullifier> for Nullifier {
fn from(value: nssa_core::Nullifier) -> Self { fn from(value: lee_core::Nullifier) -> Self {
Self(value.to_byte_array()) Self(value.to_byte_array())
} }
} }
impl From<Nullifier> for nssa_core::Nullifier { impl From<Nullifier> for lee_core::Nullifier {
fn from(value: Nullifier) -> Self { fn from(value: Nullifier) -> Self {
Self::from_byte_array(value.0) Self::from_byte_array(value.0)
} }
} }
impl From<nssa_core::CommitmentSetDigest> for CommitmentSetDigest { impl From<lee_core::CommitmentSetDigest> for CommitmentSetDigest {
fn from(value: nssa_core::CommitmentSetDigest) -> Self { fn from(value: lee_core::CommitmentSetDigest) -> Self {
Self(value) Self(value)
} }
} }
impl From<CommitmentSetDigest> for nssa_core::CommitmentSetDigest { impl From<CommitmentSetDigest> for lee_core::CommitmentSetDigest {
fn from(value: CommitmentSetDigest) -> Self { fn from(value: CommitmentSetDigest) -> Self {
value.0 value.0
} }
@ -137,25 +137,25 @@ impl From<CommitmentSetDigest> for nssa_core::CommitmentSetDigest {
// Encryption-related conversions // Encryption-related conversions
// ============================================================================ // ============================================================================
impl From<nssa_core::encryption::Ciphertext> for Ciphertext { impl From<lee_core::encryption::Ciphertext> for Ciphertext {
fn from(value: nssa_core::encryption::Ciphertext) -> Self { fn from(value: lee_core::encryption::Ciphertext) -> Self {
Self(value.into_inner()) Self(value.into_inner())
} }
} }
impl From<Ciphertext> for nssa_core::encryption::Ciphertext { impl From<Ciphertext> for lee_core::encryption::Ciphertext {
fn from(value: Ciphertext) -> Self { fn from(value: Ciphertext) -> Self {
Self::from_inner(value.0) Self::from_inner(value.0)
} }
} }
impl From<nssa_core::encryption::EphemeralPublicKey> for EphemeralPublicKey { impl From<lee_core::encryption::EphemeralPublicKey> for EphemeralPublicKey {
fn from(value: nssa_core::encryption::EphemeralPublicKey) -> Self { fn from(value: lee_core::encryption::EphemeralPublicKey) -> Self {
Self(value.0) Self(value.0)
} }
} }
impl From<EphemeralPublicKey> for nssa_core::encryption::EphemeralPublicKey { impl From<EphemeralPublicKey> for lee_core::encryption::EphemeralPublicKey {
fn from(value: EphemeralPublicKey) -> Self { fn from(value: EphemeralPublicKey) -> Self {
Self(value.0) Self(value.0)
} }
@ -165,28 +165,28 @@ impl From<EphemeralPublicKey> for nssa_core::encryption::EphemeralPublicKey {
// Signature and PublicKey conversions // Signature and PublicKey conversions
// ============================================================================ // ============================================================================
impl From<nssa::Signature> for Signature { impl From<lee::Signature> for Signature {
fn from(value: nssa::Signature) -> Self { fn from(value: lee::Signature) -> Self {
let nssa::Signature { value } = value; let lee::Signature { value } = value;
Self(value) Self(value)
} }
} }
impl From<Signature> for nssa::Signature { impl From<Signature> for lee::Signature {
fn from(value: Signature) -> Self { fn from(value: Signature) -> Self {
let Signature(sig_value) = value; let Signature(sig_value) = value;
Self { value: sig_value } Self { value: sig_value }
} }
} }
impl From<nssa::PublicKey> for PublicKey { impl From<lee::PublicKey> for PublicKey {
fn from(value: nssa::PublicKey) -> Self { fn from(value: lee::PublicKey) -> Self {
Self(*value.value()) Self(*value.value())
} }
} }
impl TryFrom<PublicKey> for nssa::PublicKey { impl TryFrom<PublicKey> for lee::PublicKey {
type Error = nssa::error::NssaError; type Error = lee::error::LeeError;
fn try_from(value: PublicKey) -> Result<Self, Self::Error> { fn try_from(value: PublicKey) -> Result<Self, Self::Error> {
Self::try_new(value.0) Self::try_new(value.0)
@ -197,13 +197,13 @@ impl TryFrom<PublicKey> for nssa::PublicKey {
// Proof conversions // Proof conversions
// ============================================================================ // ============================================================================
impl From<nssa::privacy_preserving_transaction::circuit::Proof> for Proof { impl From<lee::privacy_preserving_transaction::circuit::Proof> for Proof {
fn from(value: nssa::privacy_preserving_transaction::circuit::Proof) -> Self { fn from(value: lee::privacy_preserving_transaction::circuit::Proof) -> Self {
Self(value.into_inner()) Self(value.into_inner())
} }
} }
impl From<Proof> for nssa::privacy_preserving_transaction::circuit::Proof { impl From<Proof> for lee::privacy_preserving_transaction::circuit::Proof {
fn from(value: Proof) -> Self { fn from(value: Proof) -> Self {
Self::from_inner(value.0) Self::from_inner(value.0)
} }
@ -213,10 +213,10 @@ impl From<Proof> for nssa::privacy_preserving_transaction::circuit::Proof {
// EncryptedAccountData conversions // EncryptedAccountData conversions
// ============================================================================ // ============================================================================
impl From<nssa::privacy_preserving_transaction::message::EncryptedAccountData> impl From<lee::privacy_preserving_transaction::message::EncryptedAccountData>
for EncryptedAccountData for EncryptedAccountData
{ {
fn from(value: nssa::privacy_preserving_transaction::message::EncryptedAccountData) -> Self { fn from(value: lee::privacy_preserving_transaction::message::EncryptedAccountData) -> Self {
Self { Self {
ciphertext: value.ciphertext.into(), ciphertext: value.ciphertext.into(),
epk: value.epk.into(), epk: value.epk.into(),
@ -226,7 +226,7 @@ impl From<nssa::privacy_preserving_transaction::message::EncryptedAccountData>
} }
impl From<EncryptedAccountData> impl From<EncryptedAccountData>
for nssa::privacy_preserving_transaction::message::EncryptedAccountData for lee::privacy_preserving_transaction::message::EncryptedAccountData
{ {
fn from(value: EncryptedAccountData) -> Self { fn from(value: EncryptedAccountData) -> Self {
Self { Self {
@ -241,9 +241,9 @@ impl From<EncryptedAccountData>
// Transaction Message conversions // Transaction Message conversions
// ============================================================================ // ============================================================================
impl From<nssa::public_transaction::Message> for PublicMessage { impl From<lee::public_transaction::Message> for PublicMessage {
fn from(value: nssa::public_transaction::Message) -> Self { fn from(value: lee::public_transaction::Message) -> Self {
let nssa::public_transaction::Message { let lee::public_transaction::Message {
program_id, program_id,
account_ids, account_ids,
nonces, nonces,
@ -258,7 +258,7 @@ impl From<nssa::public_transaction::Message> for PublicMessage {
} }
} }
impl From<PublicMessage> for nssa::public_transaction::Message { impl From<PublicMessage> for lee::public_transaction::Message {
fn from(value: PublicMessage) -> Self { fn from(value: PublicMessage) -> Self {
let PublicMessage { let PublicMessage {
program_id, program_id,
@ -271,16 +271,16 @@ impl From<PublicMessage> for nssa::public_transaction::Message {
account_ids.into_iter().map(Into::into).collect(), account_ids.into_iter().map(Into::into).collect(),
nonces nonces
.iter() .iter()
.map(|x| nssa_core::account::Nonce(*x)) .map(|x| lee_core::account::Nonce(*x))
.collect(), .collect(),
instruction_data, instruction_data,
) )
} }
} }
impl From<nssa::privacy_preserving_transaction::message::Message> for PrivacyPreservingMessage { impl From<lee::privacy_preserving_transaction::message::Message> for PrivacyPreservingMessage {
fn from(value: nssa::privacy_preserving_transaction::message::Message) -> Self { fn from(value: lee::privacy_preserving_transaction::message::Message) -> Self {
let nssa::privacy_preserving_transaction::message::Message { let lee::privacy_preserving_transaction::message::Message {
public_account_ids, public_account_ids,
nonces, nonces,
public_post_states, public_post_states,
@ -309,8 +309,8 @@ impl From<nssa::privacy_preserving_transaction::message::Message> for PrivacyPre
} }
} }
impl TryFrom<PrivacyPreservingMessage> for nssa::privacy_preserving_transaction::message::Message { impl TryFrom<PrivacyPreservingMessage> for lee::privacy_preserving_transaction::message::Message {
type Error = nssa::error::NssaError; type Error = lee::error::LeeError;
fn try_from(value: PrivacyPreservingMessage) -> Result<Self, Self::Error> { fn try_from(value: PrivacyPreservingMessage) -> Result<Self, Self::Error> {
let PrivacyPreservingMessage { let PrivacyPreservingMessage {
@ -327,13 +327,13 @@ impl TryFrom<PrivacyPreservingMessage> for nssa::privacy_preserving_transaction:
public_account_ids: public_account_ids.into_iter().map(Into::into).collect(), public_account_ids: public_account_ids.into_iter().map(Into::into).collect(),
nonces: nonces nonces: nonces
.iter() .iter()
.map(|x| nssa_core::account::Nonce(*x)) .map(|x| lee_core::account::Nonce(*x))
.collect(), .collect(),
public_post_states: public_post_states public_post_states: public_post_states
.into_iter() .into_iter()
.map(TryInto::try_into) .map(TryInto::try_into)
.collect::<Result<Vec<_>, _>>() .collect::<Result<Vec<_>, _>>()
.map_err(|e| nssa::error::NssaError::InvalidInput(format!("{e}")))?, .map_err(|e| lee::error::LeeError::InvalidInput(format!("{e}")))?,
encrypted_private_post_states: encrypted_private_post_states encrypted_private_post_states: encrypted_private_post_states
.into_iter() .into_iter()
.map(Into::into) .map(Into::into)
@ -345,23 +345,23 @@ impl TryFrom<PrivacyPreservingMessage> for nssa::privacy_preserving_transaction:
.collect(), .collect(),
block_validity_window: block_validity_window block_validity_window: block_validity_window
.try_into() .try_into()
.map_err(|e| nssa::error::NssaError::InvalidInput(format!("{e}")))?, .map_err(|e| lee::error::LeeError::InvalidInput(format!("{e}")))?,
timestamp_validity_window: timestamp_validity_window timestamp_validity_window: timestamp_validity_window
.try_into() .try_into()
.map_err(|e| nssa::error::NssaError::InvalidInput(format!("{e}")))?, .map_err(|e| lee::error::LeeError::InvalidInput(format!("{e}")))?,
}) })
} }
} }
impl From<nssa::program_deployment_transaction::Message> for ProgramDeploymentMessage { impl From<lee::program_deployment_transaction::Message> for ProgramDeploymentMessage {
fn from(value: nssa::program_deployment_transaction::Message) -> Self { fn from(value: lee::program_deployment_transaction::Message) -> Self {
Self { Self {
bytecode: value.into_bytecode(), bytecode: value.into_bytecode(),
} }
} }
} }
impl From<ProgramDeploymentMessage> for nssa::program_deployment_transaction::Message { impl From<ProgramDeploymentMessage> for lee::program_deployment_transaction::Message {
fn from(value: ProgramDeploymentMessage) -> Self { fn from(value: ProgramDeploymentMessage) -> Self {
let ProgramDeploymentMessage { bytecode } = value; let ProgramDeploymentMessage { bytecode } = value;
Self::new(bytecode) Self::new(bytecode)
@ -372,8 +372,8 @@ impl From<ProgramDeploymentMessage> for nssa::program_deployment_transaction::Me
// WitnessSet conversions // WitnessSet conversions
// ============================================================================ // ============================================================================
impl From<nssa::public_transaction::WitnessSet> for WitnessSet { impl From<lee::public_transaction::WitnessSet> for WitnessSet {
fn from(value: nssa::public_transaction::WitnessSet) -> Self { fn from(value: lee::public_transaction::WitnessSet) -> Self {
Self { Self {
signatures_and_public_keys: value signatures_and_public_keys: value
.signatures_and_public_keys() .signatures_and_public_keys()
@ -385,8 +385,8 @@ impl From<nssa::public_transaction::WitnessSet> for WitnessSet {
} }
} }
impl From<nssa::privacy_preserving_transaction::witness_set::WitnessSet> for WitnessSet { impl From<lee::privacy_preserving_transaction::witness_set::WitnessSet> for WitnessSet {
fn from(value: nssa::privacy_preserving_transaction::witness_set::WitnessSet) -> Self { fn from(value: lee::privacy_preserving_transaction::witness_set::WitnessSet) -> Self {
let (sigs_and_pks, proof) = value.into_raw_parts(); let (sigs_and_pks, proof) = value.into_raw_parts();
Self { Self {
signatures_and_public_keys: sigs_and_pks signatures_and_public_keys: sigs_and_pks
@ -398,8 +398,8 @@ impl From<nssa::privacy_preserving_transaction::witness_set::WitnessSet> for Wit
} }
} }
impl TryFrom<WitnessSet> for nssa::privacy_preserving_transaction::witness_set::WitnessSet { impl TryFrom<WitnessSet> for lee::privacy_preserving_transaction::witness_set::WitnessSet {
type Error = nssa::error::NssaError; type Error = lee::error::LeeError;
fn try_from(value: WitnessSet) -> Result<Self, Self::Error> { fn try_from(value: WitnessSet) -> Result<Self, Self::Error> {
let WitnessSet { let WitnessSet {
@ -415,7 +415,7 @@ impl TryFrom<WitnessSet> for nssa::privacy_preserving_transaction::witness_set::
signatures_and_public_keys, signatures_and_public_keys,
proof proof
.map(Into::into) .map(Into::into)
.ok_or_else(|| nssa::error::NssaError::InvalidInput("Missing proof".to_owned()))?, .ok_or_else(|| lee::error::LeeError::InvalidInput("Missing proof".to_owned()))?,
)) ))
} }
} }
@ -424,10 +424,10 @@ impl TryFrom<WitnessSet> for nssa::privacy_preserving_transaction::witness_set::
// Transaction conversions // Transaction conversions
// ============================================================================ // ============================================================================
impl From<nssa::PublicTransaction> for PublicTransaction { impl From<lee::PublicTransaction> for PublicTransaction {
fn from(value: nssa::PublicTransaction) -> Self { fn from(value: lee::PublicTransaction) -> Self {
let hash = HashType(value.hash()); let hash = HashType(value.hash());
let nssa::PublicTransaction { let lee::PublicTransaction {
message, message,
witness_set, witness_set,
} = value; } = value;
@ -440,8 +440,8 @@ impl From<nssa::PublicTransaction> for PublicTransaction {
} }
} }
impl TryFrom<PublicTransaction> for nssa::PublicTransaction { impl TryFrom<PublicTransaction> for lee::PublicTransaction {
type Error = nssa::error::NssaError; type Error = lee::error::LeeError;
fn try_from(value: PublicTransaction) -> Result<Self, Self::Error> { fn try_from(value: PublicTransaction) -> Result<Self, Self::Error> {
let PublicTransaction { let PublicTransaction {
@ -456,7 +456,7 @@ impl TryFrom<PublicTransaction> for nssa::PublicTransaction {
Ok(Self::new( Ok(Self::new(
message.into(), message.into(),
nssa::public_transaction::WitnessSet::from_raw_parts( lee::public_transaction::WitnessSet::from_raw_parts(
signatures_and_public_keys signatures_and_public_keys
.into_iter() .into_iter()
.map(|(sig, pk)| Ok((sig.into(), pk.try_into()?))) .map(|(sig, pk)| Ok((sig.into(), pk.try_into()?)))
@ -466,10 +466,10 @@ impl TryFrom<PublicTransaction> for nssa::PublicTransaction {
} }
} }
impl From<nssa::PrivacyPreservingTransaction> for PrivacyPreservingTransaction { impl From<lee::PrivacyPreservingTransaction> for PrivacyPreservingTransaction {
fn from(value: nssa::PrivacyPreservingTransaction) -> Self { fn from(value: lee::PrivacyPreservingTransaction) -> Self {
let hash = HashType(value.hash()); let hash = HashType(value.hash());
let nssa::PrivacyPreservingTransaction { let lee::PrivacyPreservingTransaction {
message, message,
witness_set, witness_set,
} = value; } = value;
@ -482,8 +482,8 @@ impl From<nssa::PrivacyPreservingTransaction> for PrivacyPreservingTransaction {
} }
} }
impl TryFrom<PrivacyPreservingTransaction> for nssa::PrivacyPreservingTransaction { impl TryFrom<PrivacyPreservingTransaction> for lee::PrivacyPreservingTransaction {
type Error = nssa::error::NssaError; type Error = lee::error::LeeError;
fn try_from(value: PrivacyPreservingTransaction) -> Result<Self, Self::Error> { fn try_from(value: PrivacyPreservingTransaction) -> Result<Self, Self::Error> {
let PrivacyPreservingTransaction { let PrivacyPreservingTransaction {
@ -496,10 +496,10 @@ impl TryFrom<PrivacyPreservingTransaction> for nssa::PrivacyPreservingTransactio
} }
} }
impl From<nssa::ProgramDeploymentTransaction> for ProgramDeploymentTransaction { impl From<lee::ProgramDeploymentTransaction> for ProgramDeploymentTransaction {
fn from(value: nssa::ProgramDeploymentTransaction) -> Self { fn from(value: lee::ProgramDeploymentTransaction) -> Self {
let hash = HashType(value.hash()); let hash = HashType(value.hash());
let nssa::ProgramDeploymentTransaction { message } = value; let lee::ProgramDeploymentTransaction { message } = value;
Self { Self {
hash, hash,
@ -508,29 +508,29 @@ impl From<nssa::ProgramDeploymentTransaction> for ProgramDeploymentTransaction {
} }
} }
impl From<ProgramDeploymentTransaction> for nssa::ProgramDeploymentTransaction { impl From<ProgramDeploymentTransaction> for lee::ProgramDeploymentTransaction {
fn from(value: ProgramDeploymentTransaction) -> Self { fn from(value: ProgramDeploymentTransaction) -> Self {
let ProgramDeploymentTransaction { hash: _, message } = value; let ProgramDeploymentTransaction { hash: _, message } = value;
Self::new(message.into()) Self::new(message.into())
} }
} }
impl From<common::transaction::NSSATransaction> for Transaction { impl From<common::transaction::LeeTransaction> for Transaction {
fn from(value: common::transaction::NSSATransaction) -> Self { fn from(value: common::transaction::LeeTransaction) -> Self {
match value { match value {
common::transaction::NSSATransaction::Public(tx) => Self::Public(tx.into()), common::transaction::LeeTransaction::Public(tx) => Self::Public(tx.into()),
common::transaction::NSSATransaction::PrivacyPreserving(tx) => { common::transaction::LeeTransaction::PrivacyPreserving(tx) => {
Self::PrivacyPreserving(tx.into()) Self::PrivacyPreserving(tx.into())
} }
common::transaction::NSSATransaction::ProgramDeployment(tx) => { common::transaction::LeeTransaction::ProgramDeployment(tx) => {
Self::ProgramDeployment(tx.into()) Self::ProgramDeployment(tx.into())
} }
} }
} }
} }
impl TryFrom<Transaction> for common::transaction::NSSATransaction { impl TryFrom<Transaction> for common::transaction::LeeTransaction {
type Error = nssa::error::NssaError; type Error = lee::error::LeeError;
fn try_from(value: Transaction) -> Result<Self, Self::Error> { fn try_from(value: Transaction) -> Result<Self, Self::Error> {
match value { match value {
@ -565,7 +565,7 @@ impl From<common::block::BlockHeader> for BlockHeader {
} }
impl TryFrom<BlockHeader> for common::block::BlockHeader { impl TryFrom<BlockHeader> for common::block::BlockHeader {
type Error = nssa::error::NssaError; type Error = lee::error::LeeError;
fn try_from(value: BlockHeader) -> Result<Self, Self::Error> { fn try_from(value: BlockHeader) -> Result<Self, Self::Error> {
let BlockHeader { let BlockHeader {
@ -592,11 +592,11 @@ impl From<common::block::BlockBody> for BlockBody {
let transactions = transactions let transactions = transactions
.into_iter() .into_iter()
.map(|tx| match tx { .map(|tx| match tx {
common::transaction::NSSATransaction::Public(tx) => Transaction::Public(tx.into()), common::transaction::LeeTransaction::Public(tx) => Transaction::Public(tx.into()),
common::transaction::NSSATransaction::PrivacyPreserving(tx) => { common::transaction::LeeTransaction::PrivacyPreserving(tx) => {
Transaction::PrivacyPreserving(tx.into()) Transaction::PrivacyPreserving(tx.into())
} }
common::transaction::NSSATransaction::ProgramDeployment(tx) => { common::transaction::LeeTransaction::ProgramDeployment(tx) => {
Transaction::ProgramDeployment(tx.into()) Transaction::ProgramDeployment(tx.into())
} }
}) })
@ -607,7 +607,7 @@ impl From<common::block::BlockBody> for BlockBody {
} }
impl TryFrom<BlockBody> for common::block::BlockBody { impl TryFrom<BlockBody> for common::block::BlockBody {
type Error = nssa::error::NssaError; type Error = lee::error::LeeError;
fn try_from(value: BlockBody) -> Result<Self, Self::Error> { fn try_from(value: BlockBody) -> Result<Self, Self::Error> {
let BlockBody { transactions } = value; let BlockBody { transactions } = value;
@ -615,8 +615,8 @@ impl TryFrom<BlockBody> for common::block::BlockBody {
let transactions = transactions let transactions = transactions
.into_iter() .into_iter()
.map(|tx| { .map(|tx| {
let nssa_tx: common::transaction::NSSATransaction = tx.try_into()?; let lee_tx: common::transaction::LeeTransaction = tx.try_into()?;
Ok::<_, nssa::error::NssaError>(nssa_tx) Ok::<_, lee::error::LeeError>(lee_tx)
}) })
.collect::<Result<Vec<_>, _>>()?; .collect::<Result<Vec<_>, _>>()?;
@ -643,7 +643,7 @@ impl From<common::block::Block> for Block {
} }
impl TryFrom<Block> for common::block::Block { impl TryFrom<Block> for common::block::Block {
type Error = nssa::error::NssaError; type Error = lee::error::LeeError;
fn try_from(value: Block) -> Result<Self, Self::Error> { fn try_from(value: Block) -> Result<Self, Self::Error> {
let Block { let Block {
@ -698,14 +698,14 @@ impl From<HashType> for common::HashType {
// ValidityWindow conversions // ValidityWindow conversions
// ============================================================================ // ============================================================================
impl From<nssa_core::program::ValidityWindow<u64>> for ValidityWindow { impl From<lee_core::program::ValidityWindow<u64>> for ValidityWindow {
fn from(value: nssa_core::program::ValidityWindow<u64>) -> Self { fn from(value: lee_core::program::ValidityWindow<u64>) -> Self {
Self((value.start(), value.end())) Self((value.start(), value.end()))
} }
} }
impl TryFrom<ValidityWindow> for nssa_core::program::ValidityWindow<u64> { impl TryFrom<ValidityWindow> for lee_core::program::ValidityWindow<u64> {
type Error = nssa_core::program::InvalidWindow; type Error = lee_core::program::InvalidWindow;
fn try_from(value: ValidityWindow) -> Result<Self, Self::Error> { fn try_from(value: ValidityWindow) -> Result<Self, Self::Error> {
value.0.try_into() value.0.try_into()

View File

@ -1,6 +1,6 @@
//! This crate defines the protocol types used by the indexer service. //! This crate defines the protocol types used by the indexer service.
//! //!
//! Currently it mostly mimics types from `nssa_core`, but it's important to have a separate crate //! Currently it mostly mimics types from `lee_core`, but it's important to have a separate crate
//! to define a stable interface for the indexer service RPCs which evolves in its own way. //! to define a stable interface for the indexer service RPCs which evolves in its own way.
use std::{fmt::Display, str::FromStr}; use std::{fmt::Display, str::FromStr};

View File

@ -10,8 +10,8 @@ workspace = true
[dependencies] [dependencies]
test_fixtures.workspace = true test_fixtures.workspace = true
nssa_core = { workspace = true, features = ["host"] } lee_core = { workspace = true, features = ["host"] }
nssa.workspace = true lee.workspace = true
authenticated_transfer_core.workspace = true authenticated_transfer_core.workspace = true
sequencer_core = { workspace = true, features = ["default", "testnet"] } sequencer_core = { workspace = true, features = ["default", "testnet"] }
wallet.workspace = true wallet.workspace = true

View File

@ -6,9 +6,9 @@
use anyhow::{Context as _, Result}; use anyhow::{Context as _, Result};
use integration_tests::{TestContext, private_mention}; use integration_tests::{TestContext, private_mention};
use key_protocol::key_management::KeyChain; use key_protocol::key_management::KeyChain;
use lee::{Data, program::Program};
use lee_core::account::Nonce;
use log::info; use log::info;
use nssa::{Data, program::Program};
use nssa_core::account::Nonce;
use sequencer_service_rpc::RpcClient as _; use sequencer_service_rpc::RpcClient as _;
use tokio::test; use tokio::test;
use wallet::{ use wallet::{
@ -127,8 +127,8 @@ async fn new_public_account_without_label() -> Result<()> {
async fn import_public_account() -> Result<()> { async fn import_public_account() -> Result<()> {
let mut ctx = TestContext::new().await?; let mut ctx = TestContext::new().await?;
let private_key = nssa::PrivateKey::new_os_random(); let private_key = lee::PrivateKey::new_os_random();
let account_id = nssa::AccountId::from(&nssa::PublicKey::new_from_private_key(&private_key)); let account_id = lee::AccountId::from(&lee::PublicKey::new_from_private_key(&private_key));
let command = Command::Account(AccountSubcommand::Import(ImportSubcommand::Public { let command = Command::Account(AccountSubcommand::Import(ImportSubcommand::Public {
private_key, private_key,
@ -156,8 +156,8 @@ async fn import_private_account() -> Result<()> {
let mut ctx = TestContext::new().await?; let mut ctx = TestContext::new().await?;
let key_chain = KeyChain::new_os_random(); let key_chain = KeyChain::new_os_random();
let account_id = nssa::AccountId::from((&key_chain.nullifier_public_key, 0)); let account_id = lee::AccountId::from((&key_chain.nullifier_public_key, 0));
let account = nssa::Account { let account = lee::Account {
program_owner: Program::authenticated_transfer_program().id(), program_owner: Program::authenticated_transfer_program().id(),
balance: 777, balance: 777,
data: Data::default(), data: Data::default(),
@ -213,11 +213,11 @@ async fn import_private_account_second_time_overrides_account_data() -> Result<(
let mut ctx = TestContext::new().await?; let mut ctx = TestContext::new().await?;
let key_chain = KeyChain::new_os_random(); let key_chain = KeyChain::new_os_random();
let account_id = nssa::AccountId::from((&key_chain.nullifier_public_key, 0)); let account_id = lee::AccountId::from((&key_chain.nullifier_public_key, 0));
let key_chain_json = let key_chain_json =
serde_json::to_string(&key_chain).context("Failed to serialize key chain")?; serde_json::to_string(&key_chain).context("Failed to serialize key chain")?;
let initial_account = nssa::Account { let initial_account = lee::Account {
program_owner: Program::authenticated_transfer_program().id(), program_owner: Program::authenticated_transfer_program().id(),
balance: 100, balance: 100,
data: Data::default(), data: Data::default(),
@ -236,7 +236,7 @@ async fn import_private_account_second_time_overrides_account_data() -> Result<(
) )
.await?; .await?;
let updated_account = nssa::Account { let updated_account = lee::Account {
program_owner: Program::authenticated_transfer_program().id(), program_owner: Program::authenticated_transfer_program().id(),
balance: 999, balance: 999,
data: Data::default(), data: Data::default(),

View File

@ -12,8 +12,8 @@ use integration_tests::{
TIME_TO_WAIT_FOR_BLOCK_SECONDS, TestContext, private_mention, public_mention, TIME_TO_WAIT_FOR_BLOCK_SECONDS, TestContext, private_mention, public_mention,
verify_commitment_is_in_state, verify_commitment_is_in_state,
}; };
use lee::program::Program;
use log::info; use log::info;
use nssa::program::Program;
use sequencer_service_rpc::RpcClient as _; use sequencer_service_rpc::RpcClient as _;
use token_core::{TokenDefinition, TokenHolding}; use token_core::{TokenDefinition, TokenHolding};
use tokio::test; use tokio::test;
@ -24,7 +24,7 @@ use wallet::cli::{
}; };
/// Create a public account and return its ID. /// Create a public account and return its ID.
async fn new_public_account(ctx: &mut TestContext) -> Result<nssa::AccountId> { async fn new_public_account(ctx: &mut TestContext) -> Result<lee::AccountId> {
let result = wallet::cli::execute_subcommand( let result = wallet::cli::execute_subcommand(
ctx.wallet_mut(), ctx.wallet_mut(),
Command::Account(AccountSubcommand::New(NewSubcommand::Public { Command::Account(AccountSubcommand::New(NewSubcommand::Public {
@ -40,7 +40,7 @@ async fn new_public_account(ctx: &mut TestContext) -> Result<nssa::AccountId> {
} }
/// Create a private account and return its ID. /// Create a private account and return its ID.
async fn new_private_account(ctx: &mut TestContext) -> Result<nssa::AccountId> { async fn new_private_account(ctx: &mut TestContext) -> Result<lee::AccountId> {
let result = wallet::cli::execute_subcommand( let result = wallet::cli::execute_subcommand(
ctx.wallet_mut(), ctx.wallet_mut(),
Command::Account(AccountSubcommand::New(NewSubcommand::Private { Command::Account(AccountSubcommand::New(NewSubcommand::Private {

View File

@ -1,20 +1,20 @@
use std::time::Duration; use std::time::Duration;
use anyhow::{Context as _, Result}; use anyhow::{Context as _, Result};
use common::transaction::NSSATransaction; use common::transaction::LeeTransaction;
use integration_tests::{ use integration_tests::{
TIME_TO_WAIT_FOR_BLOCK_SECONDS, TestContext, fetch_privacy_preserving_tx, private_mention, TIME_TO_WAIT_FOR_BLOCK_SECONDS, TestContext, fetch_privacy_preserving_tx, private_mention,
public_mention, verify_commitment_is_in_state, public_mention, verify_commitment_is_in_state,
}; };
use log::info; use lee::{
use nssa::{
AccountId, SharedSecretKey, execute_and_prove, AccountId, SharedSecretKey, execute_and_prove,
privacy_preserving_transaction::circuit::ProgramWithDependencies, program::Program, privacy_preserving_transaction::circuit::ProgramWithDependencies, program::Program,
}; };
use nssa_core::{ use lee_core::{
InputAccountIdentity, NullifierPublicKey, account::AccountWithMetadata, InputAccountIdentity, NullifierPublicKey, account::AccountWithMetadata,
encryption::shared_key_derivation::Secp256k1Point, encryption::shared_key_derivation::Secp256k1Point,
}; };
use log::info;
use sequencer_service_rpc::RpcClient as _; use sequencer_service_rpc::RpcClient as _;
use tokio::test; use tokio::test;
use wallet::{ use wallet::{
@ -639,20 +639,20 @@ async fn ppt_cant_chain_call_faucet() -> Result<()> {
std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("../artifacts/test_program_methods/faucet_chain_caller.bin"), .join("../artifacts/test_program_methods/faucet_chain_caller.bin"),
)?; )?;
let deploy_tx = NSSATransaction::ProgramDeployment(nssa::ProgramDeploymentTransaction::new( let deploy_tx = LeeTransaction::ProgramDeployment(lee::ProgramDeploymentTransaction::new(
nssa::program_deployment_transaction::Message::new(binary.clone()), lee::program_deployment_transaction::Message::new(binary.clone()),
)); ));
ctx.sequencer_client().send_transaction(deploy_tx).await?; ctx.sequencer_client().send_transaction(deploy_tx).await?;
info!("Waiting for deploy block creation"); info!("Waiting for deploy block creation");
tokio::time::sleep(Duration::from_secs(TIME_TO_WAIT_FOR_BLOCK_SECONDS)).await; tokio::time::sleep(Duration::from_secs(TIME_TO_WAIT_FOR_BLOCK_SECONDS)).await;
let faucet_account_id = nssa::system_faucet_account_id(); let faucet_account_id = lee::system_faucet_account_id();
let attacker_id = ctx.existing_public_accounts()[0]; let attacker_id = ctx.existing_public_accounts()[0];
let faucet_program_id = Program::faucet().id(); let faucet_program_id = Program::faucet().id();
let vault_program_id = Program::vault().id(); let vault_program_id = Program::vault().id();
let auth_transfer_program_id = Program::authenticated_transfer_program().id(); let auth_transfer_program_id = Program::authenticated_transfer_program().id();
let nsk: nssa_core::NullifierSecretKey = [3; 32]; let nsk: lee_core::NullifierSecretKey = [3; 32];
let npk = NullifierPublicKey::from(&nsk); let npk = NullifierPublicKey::from(&nsk);
let vpk = Secp256k1Point::from_scalar([4; 32]); let vpk = Secp256k1Point::from_scalar([4; 32]);
let ssk = SharedSecretKey::new([55; 32], &vpk); let ssk = SharedSecretKey::new([55; 32], &vpk);

View File

@ -1,10 +1,10 @@
use std::{path::PathBuf, time::Duration}; use std::{path::PathBuf, time::Duration};
use anyhow::Result; use anyhow::Result;
use common::transaction::NSSATransaction; use common::transaction::LeeTransaction;
use integration_tests::{TIME_TO_WAIT_FOR_BLOCK_SECONDS, TestContext, public_mention}; use integration_tests::{TIME_TO_WAIT_FOR_BLOCK_SECONDS, TestContext, public_mention};
use lee::{program::Program, public_transaction, system_faucet_account_id};
use log::info; use log::info;
use nssa::{program::Program, public_transaction, system_faucet_account_id};
use sequencer_service_rpc::RpcClient as _; use sequencer_service_rpc::RpcClient as _;
use tokio::test; use tokio::test;
use wallet::{ use wallet::{
@ -368,13 +368,13 @@ async fn cannot_transfer_funds_from_system_faucet_account() -> Result<()> {
vec![], vec![],
authenticated_transfer_core::Instruction::Transfer { amount }, authenticated_transfer_core::Instruction::Transfer { amount },
)?; )?;
let tx = nssa::PublicTransaction::new( let tx = lee::PublicTransaction::new(
message, message,
nssa::public_transaction::WitnessSet::from_raw_parts(vec![]), lee::public_transaction::WitnessSet::from_raw_parts(vec![]),
); );
let tx_hash = ctx let tx_hash = ctx
.sequencer_client() .sequencer_client()
.send_transaction(NSSATransaction::Public(tx)) .send_transaction(LeeTransaction::Public(tx))
.await?; .await?;
info!("Waiting for next block creation"); info!("Waiting for next block creation");
@ -426,13 +426,13 @@ async fn cannot_execute_faucet_program() -> Result<()> {
amount, amount,
}, },
)?; )?;
let tx = nssa::PublicTransaction::new( let tx = lee::PublicTransaction::new(
message, message,
nssa::public_transaction::WitnessSet::from_raw_parts(vec![]), lee::public_transaction::WitnessSet::from_raw_parts(vec![]),
); );
let tx_hash = ctx let tx_hash = ctx
.sequencer_client() .sequencer_client()
.send_transaction(NSSATransaction::Public(tx)) .send_transaction(LeeTransaction::Public(tx))
.await?; .await?;
info!("Waiting for next block creation"); info!("Waiting for next block creation");
@ -464,8 +464,8 @@ async fn user_tx_that_chain_calls_faucet_is_dropped() -> Result<()> {
.join("../artifacts/test_program_methods/faucet_chain_caller.bin"), .join("../artifacts/test_program_methods/faucet_chain_caller.bin"),
)?; )?;
let faucet_chain_caller_id = Program::new(binary.clone())?.id(); let faucet_chain_caller_id = Program::new(binary.clone())?.id();
let deploy_tx = NSSATransaction::ProgramDeployment(nssa::ProgramDeploymentTransaction::new( let deploy_tx = LeeTransaction::ProgramDeployment(lee::ProgramDeploymentTransaction::new(
nssa::program_deployment_transaction::Message::new(binary), lee::program_deployment_transaction::Message::new(binary),
)); ));
ctx.sequencer_client().send_transaction(deploy_tx).await?; ctx.sequencer_client().send_transaction(deploy_tx).await?;
@ -485,9 +485,9 @@ async fn user_tx_that_chain_calls_faucet_is_dropped() -> Result<()> {
vec![], vec![],
(faucet_program_id, vault_program_id, attacker, amount), (faucet_program_id, vault_program_id, attacker, amount),
)?; )?;
let attack_tx = NSSATransaction::Public(nssa::PublicTransaction::new( let attack_tx = LeeTransaction::Public(lee::PublicTransaction::new(
message, message,
nssa::public_transaction::WitnessSet::from_raw_parts(vec![]), lee::public_transaction::WitnessSet::from_raw_parts(vec![]),
)); ));
let faucet_balance_before = ctx let faucet_balance_before = ctx

View File

@ -8,11 +8,11 @@ use std::time::Duration;
use anyhow::Result; use anyhow::Result;
use bytesize::ByteSize; use bytesize::ByteSize;
use common::transaction::NSSATransaction; use common::transaction::LeeTransaction;
use integration_tests::{ use integration_tests::{
TIME_TO_WAIT_FOR_BLOCK_SECONDS, TestContext, config::SequencerPartialConfig, TIME_TO_WAIT_FOR_BLOCK_SECONDS, TestContext, config::SequencerPartialConfig,
}; };
use nssa::program::Program; use lee::program::Program;
use sequencer_service_rpc::RpcClient as _; use sequencer_service_rpc::RpcClient as _;
use tokio::test; use tokio::test;
@ -33,13 +33,13 @@ async fn reject_oversized_transaction() -> Result<()> {
// Create a 1.1 MiB binary to ensure it exceeds the limit // Create a 1.1 MiB binary to ensure it exceeds the limit
let oversized_binary = vec![0_u8; 1100 * 1024]; // 1.1 MiB binary let oversized_binary = vec![0_u8; 1100 * 1024]; // 1.1 MiB binary
let message = nssa::program_deployment_transaction::Message::new(oversized_binary); let message = lee::program_deployment_transaction::Message::new(oversized_binary);
let tx = nssa::ProgramDeploymentTransaction::new(message); let tx = lee::ProgramDeploymentTransaction::new(message);
// Try to submit the transaction and expect an error // Try to submit the transaction and expect an error
let result = ctx let result = ctx
.sequencer_client() .sequencer_client()
.send_transaction(NSSATransaction::ProgramDeployment(tx)) .send_transaction(LeeTransaction::ProgramDeployment(tx))
.await; .await;
assert!( assert!(
@ -74,13 +74,13 @@ async fn accept_transaction_within_limit() -> Result<()> {
// Create a small program deployment that should fit // Create a small program deployment that should fit
let small_binary = vec![0_u8; 1024]; // 1 KiB binary let small_binary = vec![0_u8; 1024]; // 1 KiB binary
let message = nssa::program_deployment_transaction::Message::new(small_binary); let message = lee::program_deployment_transaction::Message::new(small_binary);
let tx = nssa::ProgramDeploymentTransaction::new(message); let tx = lee::ProgramDeploymentTransaction::new(message);
// This should succeed // This should succeed
let result = ctx let result = ctx
.sequencer_client() .sequencer_client()
.send_transaction(NSSATransaction::ProgramDeployment(tx)) .send_transaction(LeeTransaction::ProgramDeployment(tx))
.await; .await;
assert!( assert!(
@ -123,17 +123,17 @@ async fn transaction_deferred_to_next_block_when_current_full() -> Result<()> {
// Submit both program deployments // Submit both program deployments
ctx.sequencer_client() ctx.sequencer_client()
.send_transaction(NSSATransaction::ProgramDeployment( .send_transaction(LeeTransaction::ProgramDeployment(
nssa::ProgramDeploymentTransaction::new( lee::ProgramDeploymentTransaction::new(
nssa::program_deployment_transaction::Message::new(burner_bytecode), lee::program_deployment_transaction::Message::new(burner_bytecode),
), ),
)) ))
.await?; .await?;
ctx.sequencer_client() ctx.sequencer_client()
.send_transaction(NSSATransaction::ProgramDeployment( .send_transaction(LeeTransaction::ProgramDeployment(
nssa::ProgramDeploymentTransaction::new( lee::ProgramDeploymentTransaction::new(
nssa::program_deployment_transaction::Message::new(chain_caller_bytecode), lee::program_deployment_transaction::Message::new(chain_caller_bytecode),
), ),
)) ))
.await?; .await?;
@ -148,13 +148,13 @@ async fn transaction_deferred_to_next_block_when_current_full() -> Result<()> {
.unwrap(); .unwrap();
// Check which program is in block 1 // Check which program is in block 1
let get_program_ids = |block: &common::block::Block| -> Vec<nssa::ProgramId> { let get_program_ids = |block: &common::block::Block| -> Vec<lee::ProgramId> {
block block
.body .body
.transactions .transactions
.iter() .iter()
.filter_map(|tx| { .filter_map(|tx| {
if let NSSATransaction::ProgramDeployment(deployment) = tx { if let LeeTransaction::ProgramDeployment(deployment) = tx {
let bytecode = deployment.message.clone().into_bytecode(); let bytecode = deployment.message.clone().into_bytecode();
Program::new(bytecode).ok().map(|p| p.id()) Program::new(bytecode).ok().map(|p| p.id())
} else { } else {

View File

@ -8,8 +8,13 @@ use std::time::Duration;
use anyhow::Context as _; use anyhow::Context as _;
use borsh::BorshSerialize; use borsh::BorshSerialize;
use common::transaction::NSSATransaction; use common::transaction::LeeTransaction;
use integration_tests::{TIME_TO_WAIT_FOR_BLOCK_SECONDS, TestContext}; use integration_tests::{TIME_TO_WAIT_FOR_BLOCK_SECONDS, TestContext};
use lee::{
AccountId, execute_and_prove, privacy_preserving_transaction, program::Program,
public_transaction,
};
use lee_core::{InputAccountIdentity, account::AccountWithMetadata};
use log::info; use log::info;
use logos_blockchain_core::mantle::{Value, ledger::Inputs, ops::channel::deposit::DepositOp}; use logos_blockchain_core::mantle::{Value, ledger::Inputs, ops::channel::deposit::DepositOp};
use logos_blockchain_http_api_common::bodies::{ use logos_blockchain_http_api_common::bodies::{
@ -19,11 +24,6 @@ use logos_blockchain_http_api_common::bodies::{
transfer_funds::{WalletTransferFundsRequestBody, WalletTransferFundsResponseBody}, transfer_funds::{WalletTransferFundsRequestBody, WalletTransferFundsResponseBody},
}, },
}; };
use nssa::{
AccountId, execute_and_prove, privacy_preserving_transaction, program::Program,
public_transaction,
};
use nssa_core::{InputAccountIdentity, account::AccountWithMetadata};
use sequencer_service_rpc::RpcClient as _; use sequencer_service_rpc::RpcClient as _;
use tokio::test; use tokio::test;
@ -34,7 +34,7 @@ async fn public_bridge_deposit_invocation_is_dropped() -> anyhow::Result<()> {
let ctx = TestContext::new().await?; let ctx = TestContext::new().await?;
let recipient_id = ctx.existing_public_accounts()[0]; let recipient_id = ctx.existing_public_accounts()[0];
let bridge_account_id = nssa::system_bridge_account_id(); let bridge_account_id = lee::system_bridge_account_id();
let vault_program_id = Program::vault().id(); let vault_program_id = Program::vault().id();
let recipient_vault_id = vault_core::compute_vault_account_id(vault_program_id, recipient_id); let recipient_vault_id = vault_core::compute_vault_account_id(vault_program_id, recipient_id);
@ -50,9 +50,9 @@ async fn public_bridge_deposit_invocation_is_dropped() -> anyhow::Result<()> {
) )
.context("Failed to build public bridge deposit transaction")?; .context("Failed to build public bridge deposit transaction")?;
let attack_tx = NSSATransaction::Public(nssa::PublicTransaction::new( let attack_tx = LeeTransaction::Public(lee::PublicTransaction::new(
message, message,
nssa::public_transaction::WitnessSet::from_raw_parts(vec![]), lee::public_transaction::WitnessSet::from_raw_parts(vec![]),
)); ));
let bridge_balance_before = ctx let bridge_balance_before = ctx
@ -93,7 +93,7 @@ async fn private_bridge_deposit_invocation_is_dropped() -> anyhow::Result<()> {
let ctx = TestContext::new().await?; let ctx = TestContext::new().await?;
let recipient_id = ctx.existing_public_accounts()[0]; let recipient_id = ctx.existing_public_accounts()[0];
let bridge_account_id = nssa::system_bridge_account_id(); let bridge_account_id = lee::system_bridge_account_id();
let vault_program_id = Program::vault().id(); let vault_program_id = Program::vault().id();
let recipient_vault_id = vault_core::compute_vault_account_id(vault_program_id, recipient_id); let recipient_vault_id = vault_core::compute_vault_account_id(vault_program_id, recipient_id);
@ -115,7 +115,7 @@ async fn private_bridge_deposit_invocation_is_dropped() -> anyhow::Result<()> {
// Create program with dependencies // Create program with dependencies
let program_with_deps = let program_with_deps =
nssa::privacy_preserving_transaction::circuit::ProgramWithDependencies::new( lee::privacy_preserving_transaction::circuit::ProgramWithDependencies::new(
Program::bridge(), Program::bridge(),
[ [
(vault_program_id, Program::vault()), (vault_program_id, Program::vault()),
@ -154,7 +154,7 @@ async fn private_bridge_deposit_invocation_is_dropped() -> anyhow::Result<()> {
.context("Failed to build privacy-preserving bridge deposit message")?; .context("Failed to build privacy-preserving bridge deposit message")?;
let witness_set = privacy_preserving_transaction::WitnessSet::for_message(&message, proof, &[]); let witness_set = privacy_preserving_transaction::WitnessSet::for_message(&message, proof, &[]);
let attack_tx = NSSATransaction::PrivacyPreserving(nssa::PrivacyPreservingTransaction::new( let attack_tx = LeeTransaction::PrivacyPreserving(lee::PrivacyPreservingTransaction::new(
message, message,
witness_set, witness_set,
)); ));
@ -413,7 +413,7 @@ async fn bedrock_deposit_mints_to_vault_then_claim_succeeds() -> anyhow::Result<
let claim_witness_set = let claim_witness_set =
public_transaction::WitnessSet::for_message(&claim_message, &[signing_key]); public_transaction::WitnessSet::for_message(&claim_message, &[signing_key]);
let claim_tx = NSSATransaction::Public(nssa::PublicTransaction::new( let claim_tx = LeeTransaction::Public(lee::PublicTransaction::new(
claim_message, claim_message,
claim_witness_set, claim_witness_set,
)); ));

View File

@ -12,8 +12,8 @@ use integration_tests::{
TIME_TO_WAIT_FOR_BLOCK_SECONDS, TestContext, private_mention, public_mention, TIME_TO_WAIT_FOR_BLOCK_SECONDS, TestContext, private_mention, public_mention,
verify_commitment_is_in_state, verify_commitment_is_in_state,
}; };
use lee::AccountId;
use log::info; use log::info;
use nssa::AccountId;
use wallet::{ use wallet::{
account::Label, account::Label,
cli::{CliAccountMention, Command, programs::native_token_transfer::AuthTransferSubcommand}, cli::{CliAccountMention, Command, programs::native_token_transfer::AuthTransferSubcommand},

View File

@ -26,8 +26,8 @@ use integration_tests::{
BlockingTestContext, TIME_TO_WAIT_FOR_BLOCK_SECONDS, TestContext, private_mention, BlockingTestContext, TIME_TO_WAIT_FOR_BLOCK_SECONDS, TestContext, private_mention,
public_mention, verify_commitment_is_in_state, public_mention, verify_commitment_is_in_state,
}; };
use lee::AccountId;
use log::{debug, info}; use log::{debug, info};
use nssa::AccountId;
use tempfile::TempDir; use tempfile::TempDir;
use wallet::{ use wallet::{
account::Label, account::Label,

View File

@ -12,8 +12,8 @@ use integration_tests::{
public_mention, verify_commitment_is_in_state, public_mention, verify_commitment_is_in_state,
}; };
use key_protocol::key_management::key_tree::chain_index::ChainIndex; use key_protocol::key_management::key_tree::chain_index::ChainIndex;
use lee::{AccountId, program::Program};
use log::info; use log::info;
use nssa::{AccountId, program::Program};
use sequencer_service_rpc::RpcClient as _; use sequencer_service_rpc::RpcClient as _;
use tokio::test; use tokio::test;
use wallet::cli::{ use wallet::cli::{

View File

@ -7,14 +7,13 @@ use std::{path::PathBuf, time::Duration};
use anyhow::{Context as _, Result}; use anyhow::{Context as _, Result};
use authenticated_transfer_core::Instruction as AuthTransferInstruction; use authenticated_transfer_core::Instruction as AuthTransferInstruction;
use common::transaction::NSSATransaction; use common::transaction::LeeTransaction;
use integration_tests::{ use integration_tests::{
NSSA_PROGRAM_FOR_TEST_PDA_SPEND_PROXY, TIME_TO_WAIT_FOR_BLOCK_SECONDS, TestContext, LEE_PROGRAM_FOR_TEST_PDA_SPEND_PROXY, TIME_TO_WAIT_FOR_BLOCK_SECONDS, TestContext,
verify_commitment_is_in_state, verify_commitment_is_in_state,
}; };
use key_protocol::key_management::ephemeral_key_holder::EphemeralKeyHolder; use key_protocol::key_management::ephemeral_key_holder::EphemeralKeyHolder;
use log::info; use lee::{
use nssa::{
AccountId, PrivacyPreservingTransaction, ProgramId, AccountId, PrivacyPreservingTransaction, ProgramId,
privacy_preserving_transaction::{ privacy_preserving_transaction::{
circuit::{ProgramWithDependencies, execute_and_prove}, circuit::{ProgramWithDependencies, execute_and_prove},
@ -23,12 +22,13 @@ use nssa::{
}, },
program::Program, program::Program,
}; };
use nssa_core::{ use lee_core::{
InputAccountIdentity, NullifierPublicKey, InputAccountIdentity, NullifierPublicKey,
account::{Account, AccountWithMetadata}, account::{Account, AccountWithMetadata},
encryption::ViewingPublicKey, encryption::ViewingPublicKey,
program::PdaSeed, program::PdaSeed,
}; };
use log::info;
use sequencer_service_rpc::RpcClient as _; use sequencer_service_rpc::RpcClient as _;
use tokio::test; use tokio::test;
use wallet::{ use wallet::{
@ -102,7 +102,7 @@ async fn fund_private_pda(
wallet wallet
.sequencer_client .sequencer_client
.send_transaction(NSSATransaction::PrivacyPreserving(tx)) .send_transaction(LeeTransaction::PrivacyPreserving(tx))
.await .await
.map_err(|e| anyhow::anyhow!("send transaction failed: {e}"))?; .map_err(|e| anyhow::anyhow!("send transaction failed: {e}"))?;
@ -170,7 +170,7 @@ async fn private_pda_family_members_receive_and_spend() -> Result<()> {
let proxy = { let proxy = {
let path = PathBuf::from(env!("CARGO_MANIFEST_DIR")) let path = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("../artifacts/test_program_methods") .join("../artifacts/test_program_methods")
.join(NSSA_PROGRAM_FOR_TEST_PDA_SPEND_PROXY); .join(LEE_PROGRAM_FOR_TEST_PDA_SPEND_PROXY);
Program::new(std::fs::read(&path).with_context(|| format!("reading {path:?}"))?) Program::new(std::fs::read(&path).with_context(|| format!("reading {path:?}"))?)
.context("invalid pda_spend_proxy binary")? .context("invalid pda_spend_proxy binary")?
}; };

View File

@ -6,12 +6,12 @@
use std::{path::PathBuf, time::Duration}; use std::{path::PathBuf, time::Duration};
use anyhow::Result; use anyhow::Result;
use common::transaction::NSSATransaction; use common::transaction::LeeTransaction;
use integration_tests::{ use integration_tests::{
NSSA_PROGRAM_FOR_TEST_DATA_CHANGER, TIME_TO_WAIT_FOR_BLOCK_SECONDS, TestContext, LEE_PROGRAM_FOR_TEST_DATA_CHANGER, TIME_TO_WAIT_FOR_BLOCK_SECONDS, TestContext,
}; };
use lee::program::Program;
use log::info; use log::info;
use nssa::program::Program;
use sequencer_service_rpc::RpcClient as _; use sequencer_service_rpc::RpcClient as _;
use tokio::test; use tokio::test;
use wallet::cli::{ use wallet::cli::{
@ -26,7 +26,7 @@ async fn deploy_and_execute_program() -> Result<()> {
let manifest_dir = env!("CARGO_MANIFEST_DIR"); let manifest_dir = env!("CARGO_MANIFEST_DIR");
let binary_filepath: PathBuf = PathBuf::from(manifest_dir) let binary_filepath: PathBuf = PathBuf::from(manifest_dir)
.join("../artifacts/test_program_methods") .join("../artifacts/test_program_methods")
.join(NSSA_PROGRAM_FOR_TEST_DATA_CHANGER); .join(LEE_PROGRAM_FOR_TEST_DATA_CHANGER);
let command = Command::DeployProgram { let command = Command::DeployProgram {
binary_filepath: binary_filepath.clone(), binary_filepath: binary_filepath.clone(),
@ -39,7 +39,7 @@ async fn deploy_and_execute_program() -> Result<()> {
// The program is the data changer and takes one account as input. // The program is the data changer and takes one account as input.
// We pass an uninitialized account and we expect after execution to be owned by the data // We pass an uninitialized account and we expect after execution to be owned by the data
// changer program (NSSA account claiming mechanism) with data equal to [0] (due to program // changer program (LEE account claiming mechanism) with data equal to [0] (due to program
// logic) // logic)
let bytecode = std::fs::read(binary_filepath)?; let bytecode = std::fs::read(binary_filepath)?;
let data_changer = Program::new(bytecode)?; let data_changer = Program::new(bytecode)?;
@ -61,17 +61,17 @@ async fn deploy_and_execute_program() -> Result<()> {
.wallet() .wallet()
.get_account_public_signing_key(account_id) .get_account_public_signing_key(account_id)
.unwrap(); .unwrap();
let message = nssa::public_transaction::Message::try_new( let message = lee::public_transaction::Message::try_new(
data_changer.id(), data_changer.id(),
vec![account_id], vec![account_id],
nonces, nonces,
vec![0], vec![0],
)?; )?;
let witness_set = nssa::public_transaction::WitnessSet::for_message(&message, &[private_key]); let witness_set = lee::public_transaction::WitnessSet::for_message(&message, &[private_key]);
let transaction = nssa::PublicTransaction::new(message, witness_set); let transaction = lee::PublicTransaction::new(message, witness_set);
let _response = ctx let _response = ctx
.sequencer_client() .sequencer_client()
.send_transaction(NSSATransaction::Public(transaction)) .send_transaction(LeeTransaction::Public(transaction))
.await?; .await?;
info!("Waiting for next block creation"); info!("Waiting for next block creation");

View File

@ -12,8 +12,8 @@ use integration_tests::{
verify_commitment_is_in_state, verify_commitment_is_in_state,
}; };
use key_protocol::key_management::key_tree::chain_index::ChainIndex; use key_protocol::key_management::key_tree::chain_index::ChainIndex;
use lee::program::Program;
use log::info; use log::info;
use nssa::program::Program;
use sequencer_service_rpc::RpcClient as _; use sequencer_service_rpc::RpcClient as _;
use token_core::{TokenDefinition, TokenHolding}; use token_core::{TokenDefinition, TokenHolding};
use tokio::test; use tokio::test;

View File

@ -13,21 +13,21 @@ use std::time::{Duration, Instant};
use anyhow::{Context as _, Result}; use anyhow::{Context as _, Result};
use bytesize::ByteSize; use bytesize::ByteSize;
use common::transaction::NSSATransaction; use common::transaction::LeeTransaction;
use integration_tests::{TestContext, config::SequencerPartialConfig}; use integration_tests::{TestContext, config::SequencerPartialConfig};
use key_protocol::key_management::ephemeral_key_holder::EphemeralKeyHolder; use key_protocol::key_management::ephemeral_key_holder::EphemeralKeyHolder;
use log::info; use lee::{
use nssa::{
Account, AccountId, PrivacyPreservingTransaction, PrivateKey, PublicKey, PublicTransaction, Account, AccountId, PrivacyPreservingTransaction, PrivateKey, PublicKey, PublicTransaction,
privacy_preserving_transaction::{self as pptx, circuit}, privacy_preserving_transaction::{self as pptx, circuit},
program::Program, program::Program,
public_transaction as putx, public_transaction as putx,
}; };
use nssa_core::{ use lee_core::{
InputAccountIdentity, MembershipProof, NullifierPublicKey, InputAccountIdentity, MembershipProof, NullifierPublicKey,
account::{AccountWithMetadata, Nonce, data::Data}, account::{AccountWithMetadata, Nonce, data::Data},
encryption::ViewingPublicKey, encryption::ViewingPublicKey,
}; };
use log::info;
use sequencer_core::config::GenesisAction; use sequencer_core::config::GenesisAction;
use sequencer_service_rpc::RpcClient as _; use sequencer_service_rpc::RpcClient as _;
use tokio::test; use tokio::test;
@ -90,16 +90,16 @@ impl TpsTestManager {
) )
.context("Failed to build vault claim message")?; .context("Failed to build vault claim message")?;
let witness_set = let witness_set =
nssa::public_transaction::WitnessSet::for_message(&message, &[private_key]); lee::public_transaction::WitnessSet::for_message(&message, &[private_key]);
let tx = PublicTransaction::new(message, witness_set); let tx = PublicTransaction::new(message, witness_set);
let hash = sequencer_client let hash = sequencer_client
.send_transaction(NSSATransaction::Public(tx)) .send_transaction(LeeTransaction::Public(tx))
.await .await
.context("Failed to submit vault claim")?; .context("Failed to submit vault claim")?;
tx_hashes.push(hash); tx_hashes.push(hash);
} }
let deadline = Instant::now() + Duration::from_secs(300); let deadline = Instant::now() + Duration::from_mins(5);
for (i, tx_hash) in tx_hashes.iter().enumerate() { for (i, tx_hash) in tx_hashes.iter().enumerate() {
loop { loop {
anyhow::ensure!( anyhow::ensure!(
@ -140,7 +140,7 @@ impl TpsTestManager {
) )
.unwrap(); .unwrap();
let witness_set = let witness_set =
nssa::public_transaction::WitnessSet::for_message(&message, &[&pair[0].0]); lee::public_transaction::WitnessSet::for_message(&message, &[&pair[0].0]);
PublicTransaction::new(message, witness_set) PublicTransaction::new(message, witness_set)
}) })
.collect(); .collect();
@ -202,7 +202,7 @@ pub async fn tps_test() -> Result<()> {
for (i, tx) in txs.into_iter().enumerate() { for (i, tx) in txs.into_iter().enumerate() {
let tx_hash = ctx let tx_hash = ctx
.sequencer_client() .sequencer_client()
.send_transaction(NSSATransaction::Public(tx)) .send_transaction(LeeTransaction::Public(tx))
.await .await
.unwrap(); .unwrap();
info!("Sent tx {i}"); info!("Sent tx {i}");

View File

@ -20,9 +20,9 @@ use std::{
use anyhow::Result; use anyhow::Result;
use integration_tests::{BlockingTestContext, TIME_TO_WAIT_FOR_BLOCK_SECONDS}; use integration_tests::{BlockingTestContext, TIME_TO_WAIT_FOR_BLOCK_SECONDS};
use lee::{Account, AccountId, PrivateKey, PublicKey, program::Program};
use lee_core::program::DEFAULT_PROGRAM_ID;
use log::info; use log::info;
use nssa::{Account, AccountId, PrivateKey, PublicKey, program::Program};
use nssa_core::program::DEFAULT_PROGRAM_ID;
use tempfile::tempdir; use tempfile::tempdir;
use wallet::account::HumanReadableAccount; use wallet::account::HumanReadableAccount;
use wallet_ffi::{ use wallet_ffi::{
@ -865,7 +865,7 @@ fn test_wallet_ffi_transfer_shielded() -> Result<()> {
let (to, to_keys) = unsafe { let (to, to_keys) = unsafe {
let mut out_keys = FfiPrivateAccountKeys::default(); let mut out_keys = FfiPrivateAccountKeys::default();
wallet_ffi_create_private_accounts_key(wallet_ffi_handle, &raw mut out_keys).unwrap(); wallet_ffi_create_private_accounts_key(wallet_ffi_handle, &raw mut out_keys).unwrap();
let account_id = nssa::AccountId::for_regular_private_account(&out_keys.npk(), 0_u128); let account_id = lee::AccountId::for_regular_private_account(&out_keys.npk(), 0_u128);
let to: FfiBytes32 = account_id.into(); let to: FfiBytes32 = account_id.into();
(to, out_keys) (to, out_keys)
}; };
@ -1001,7 +1001,7 @@ fn test_wallet_ffi_transfer_private() -> Result<()> {
let (to, to_keys) = unsafe { let (to, to_keys) = unsafe {
let mut out_keys = FfiPrivateAccountKeys::default(); let mut out_keys = FfiPrivateAccountKeys::default();
wallet_ffi_create_private_accounts_key(wallet_ffi_handle, &raw mut out_keys).unwrap(); wallet_ffi_create_private_accounts_key(wallet_ffi_handle, &raw mut out_keys).unwrap();
let account_id = nssa::AccountId::for_regular_private_account(&out_keys.npk(), 0_u128); let account_id = lee::AccountId::for_regular_private_account(&out_keys.npk(), 0_u128);
let to: FfiBytes32 = account_id.into(); let to: FfiBytes32 = account_id.into();
(to, out_keys) (to, out_keys)
}; };

View File

@ -8,7 +8,7 @@ license = { workspace = true }
workspace = true workspace = true
[dependencies] [dependencies]
nssa.workspace = true lee.workspace = true
pyo3.workspace = true pyo3.workspace = true
log.workspace = true log.workspace = true
serde = { workspace = true, features = ["derive"] } serde = { workspace = true, features = ["derive"] }

View File

@ -1,6 +1,6 @@
use std::path::PathBuf; use std::path::PathBuf;
use nssa::{AccountId, PublicKey, Signature}; use lee::{AccountId, PublicKey, Signature};
use pyo3::{prelude::*, types::PyAny}; use pyo3::{prelude::*, types::PyAny};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
@ -198,11 +198,11 @@ impl KeycardWallet {
} }
fn pairing_file_path() -> Option<PathBuf> { fn pairing_file_path() -> Option<PathBuf> {
let home = std::env::var("NSSA_WALLET_HOME_DIR") let home = std::env::var("LEE_WALLET_HOME_DIR")
.map(PathBuf::from) .map(PathBuf::from)
.or_else(|_| { .or_else(|_| {
std::env::home_dir() std::env::home_dir()
.map(|h| h.join(".nssa").join("wallet")) .map(|h| h.join(".lee").join("wallet"))
.ok_or(()) .ok_or(())
}) })
.ok()?; .ok()?;

View File

@ -52,7 +52,7 @@ pub fn add_python_path(py: Python<'_>) -> PyResult<()> {
// Avoid duplicating the path // Avoid duplicating the path
let already_present = sys_path let already_present = sys_path
.iter() .iter()
.any(|p| p.extract::<&str>().map(|s| s == path_str).unwrap_or(false)); .any(|p| p.extract::<&str>().is_ok_and(|s| s == path_str));
if !already_present { if !already_present {
sys_path.insert(0, path_str)?; sys_path.insert(0, path_str)?;

View File

@ -12,8 +12,8 @@ default = []
test_utils = [] test_utils = []
[dependencies] [dependencies]
nssa.workspace = true lee.workspace = true
nssa_core.workspace = true lee_core.workspace = true
common.workspace = true common.workspace = true
anyhow.workspace = true anyhow.workspace = true

Some files were not shown because too many files have changed in this diff Show More