Commit Graph
62 Commits
Author SHA1 Message Date
Marvin Jones 172c58324e feat(lee): construct chained-call pre-states from protocol state (incremental update PR4)
ChainedCall.pre_states: Vec<AccountWithMetadata> becomes
pre_state_refs: Vec<AccountId>. A calling program no longer supplies
the concrete account value (or an is_authorized claim) for an account
it hands to a chained call — it only names which account, and the
protocol (sequencer for public transactions, host driver for
privacy-preserving ones) resolves the real, currently-tracked value
itself before invoking the callee.

This removes two things simultaneously: the burden on guest programs
to predict another call's outcome before it happens (the calling
program previously had no reliable way to know it), and the ability
to supply a stale or entirely fabricated account value at all. The
malicious_injector/malicious_launderer guest programs and
malicious_authorization_changer, which existed specifically to
demonstrate that forgery, are deleted — the attack they showed is now
a compile-time impossibility rather than something caught after the
fact by a runtime check.

The privacy circuit itself (execution_state.rs) needed no logic
changes: it never trusted a caller-supplied pre-state in the first
place, only the callee's own proven echo against its internally
tracked state. The public path already had the tracking map it
needed (state_diff); the privacy host driver gained one
(materialized_state), plus first-sighting position tracking so a
chained call's private-PDA authorization can be verified the same
way the circuit derives it internally.

Regenerates all lee_core/lez guest artifacts and the prebuilt
sequencer db fixture via `just build-artifacts`, required since
ChainedCall's shape is part of the proven wire format.
2026-08-22 15:19:55 -04:00
Marvin Jones 15dbd6f1a6 chore(lez,lee): fix clippy pedantic/nursery/restriction findings
Resolves needless_pass_by_value (take AccountWithMetadata/Account by
reference where only borrowed), unnecessary_wraps (drop Result<Data,
Infallible> from passthrough update_from_diff implementations),
missing_const_for_fn, useless_let_if_seq, arbitrary_source_item_ordering,
too_many_arguments, redundant_clone, and useless_conversion across the
guest programs and lee core touched by the incremental-updates rebase.
2026-08-22 02:03:43 -04:00
jonesmarvin8 b676c6c360 chore(lee,lez): fix pre-existing rustfmt violations (#776)
marvin/incremental-updates-2 was not cargo +nightly fmt --check clean;
these files had drifted since the last fmt pass (mostly unwrapped
long import lists). No functional changes.
2026-08-22 01:23:17 -04:00
Marvin Jones e43611c7cc feat(lee): wire programs to diff-native execution (incremental update PR2)
Programs now report AccountDiff/AccountDiffOutput instead of full
post-states; balance changes are applied via apply_balance_diff's
checked arithmetic at the protocol level rather than checked in-guest,
and data changes are materialized through a new update_from_diff
guest entrypoint (trusted execution for public transactions, proven
via a recursive receipt for the privacy-preserving circuit). All 15
production programs and test/example guest programs are converted;
attack-surface guest programs that are now structurally impossible
(nonce/program_owner mutation) or redundant (manual balance-sufficiency
bypass) are moved to a dormant/ directory rather than deleted outright.
2026-08-22 01:15:25 -04:00
Artem Gureev 279a9b8313 feat!(lee): derive private authorization from an authorization secret key
BREAKING!

Before: Providing `nsk` was the same as authorizing a regular private
account.

After: A separate `ask` is required, making unauthorized private
updates possible.
2026-08-07 10:41:56 +00:00
Pravdyvy 0c32025c4b feat(wallet_ffi): multi-poller 2026-07-21 18:01:04 +03:00
Pravdyvy 580c466124 feat(wallet): distributed transaction sending 2026-07-20 17:10:01 +03:00
Pravdyvy 1615a06604 fix(wallet_ffi): tests and leading algorithm fixes 2026-07-13 15:37:25 +03:00
Pravdyvy daabe7f29e fix(wallet): errors fixed, metric updates are now interiorly mutable 2026-07-13 12:52:57 +03:00
Pravdyvy 675e845237 fix(wallet_ffi): wallet_ffi fix 2026-07-10 16:21:03 +03:00
Daniil Polyakov d3e507f25d refactor!(artifacts): keep lee and lez artifacts separated 2026-06-24 18:10:41 +03:00
Sergio Chouhy 50be74580b refactor!: move LEZ related crates to dedicated directory
BREAKING CHANGE: LEZ crates have been moved from top-level directories into
  a dedicated `lez/` subdirectory. The following crates were relocated:

    common          → lez/common
    indexer         → lez/indexer
    explorer_service→ lez/explorer_service
    keycard_wallet  → lez/keycard_wallet
    mempool         → lez/mempool
    sequencer       → lez/sequencer
    storage         → lez/storage
    testnet_initial_state → lez/testnet_initial_state
    wallet          → lez/wallet
    wallet-ffi      → lez/wallet-ffi

  Any external tooling, scripts, or paths referencing these crates at their
  previous top-level locations must be updated.
2026-06-02 14:17:59 -03:00
Sergio Chouhy 4bcffafe27 refactor!: rename nssa crate to lee
BREAKING CHANGE:
- Crate `nssa` renamed to `lee`; update `Cargo.toml` dependencies from `nssa = { workspace = true }` to `lee = { workspace = true }`.
- Crate `nssa_core` renamed to `lee_core`; update similarly.
- Crate `key_protocol` moved under `lee`; update `Cargo.toml` dependencies from `key_protocol = { workspace = true }` to `lee_key_protocol = { workspace = true }`.
- Type `NSSATransaction` (in `common`) renamed to `LeeTransaction`.
- Error type `nssa::error::NssaError` renamed to `lee::error::LeeError`.
- Error type `nssa_core::error::NssaCoreError` renamed to `lee_core::error::LeeCoreError`.
- All `use nssa::` and `use nssa_core::` import paths must be updated to `use lee::` and `use lee_core::` respectively.
- Guest programs must replace `write_nssa_outputs` with `write_lee_outputs`.
- The sequencer RocksDB column family for the chain state was renamed. Existing databases are incompatible and must be wiped before running the new version.
- Domain separators updated: `"NSSA_seed"` → `"LEE_seed"` (key derivation), `"NSSA/v0.2/KDF-SHA256/"` → `"LEE/v0.2/KDF-SHA256/"` (encryption KDF), `"/NSSA/v0.2/AccountId/PDA/"` →
  `"/LEE/v0.2/AccountId/PDA/"` (public PDA address derivation). All previously derived keys, encrypted outputs, and public PDA addresses are invalidated.
2026-06-01 17:11:42 -03:00
Pravdyvy ef1e0e0fa4 fix(wallet): suggestion fix 1 2026-05-21 13:02:18 +03:00
Pravdyvy 97d9188c38 fix(wallet): suggestion 1 2026-05-20 18:55:39 +03:00
Pravdyvy 3732f16df9 feat: account manager extension 2026-05-18 13:44:03 +03:00
Daniil Polyakov 5f207a3f02 feat: move initial accounts data into genesis 2026-05-15 01:33:50 +03:00
Moudy 0183eac5cc refactor: unify PDA AccountId construction via AccountId::for_{public,private}_pda
Addresses the following review comment:

- "I think this should be a constructor `AccountId::for_private_pda`.
  Consider also removing the existing `impl From<(ProgramId, Seed)> for
  AccountId` for public pdas in favor of a `AccountId::for_public_pda`
  to have a unified way of constructing pdas"

I replaced `impl From<(&ProgramId, &PdaSeed)> for AccountId` with
`AccountId::for_public_pda(program_id: &ProgramId, seed: &PdaSeed) ->
Self` and replaced the free function `private_pda_account_id(...)`
with `AccountId::for_private_pda(program_id: &ProgramId, seed:
&PdaSeed, npk: &NullifierPublicKey) -> Self`. Both live in an inherent
`impl AccountId` block in nssa/core/src/program.rs next to the PDA
derivation logic. Migrated all call sites across nssa/core,
nssa/src/state.rs, nssa/src/validated_state_diff.rs,
program_methods/guest/src/bin/privacy_preserving_circuit.rs,
programs/amm/core, programs/associated_token_account/core, the example
tail-call binary, and the ATA tutorial doc. Test function names that
referenced the old free function were also renamed
(private_pda_account_id_* to for_private_pda_*).
2026-04-21 12:35:19 +02:00
Moudy f9a5a7635e refactor: make programs privacy-agnostic in the privacy circuit 2026-04-17 07:29:40 +02:00
Moudy ca5f421188 fix: add private_pda_seeds to ChainedCall literals in example guests 2026-04-16 19:41:26 +02:00
Moudy a87e8d93dc fix: cargo fmt 2026-04-07 20:16:42 +02:00
Moudy 7d465dded7 fix: verify caller_program_id in program output 2026-04-07 19:03:06 +02:00
Moudy 74e16db68f fix: apply formatting and rebuild artifacts 2026-04-03 01:17:42 +02:00
moudyellaz 087baebcca feat: add caller_program_id to ProgramInput 2026-04-03 00:58:11 +02:00
Moudy 702ef4a46f fix: cargo fmt 2026-04-02 20:30:27 +02:00
moudyellaz 7def0c4664 refactor: pass self_program_id to ProgramOutput in test and example guest programs 2026-04-02 20:30:16 +02:00
Moudy 59d3d38448 fix: serialize write_inputs fields separately to match guest deserialization 2026-04-02 20:29:12 +02:00
Daniil Polyakov 6780f1c9a4 feat: protect from public pda griefing attacks 2026-03-28 01:23:57 +03:00
Sergio Chouhy abc30c0ce0 remove old program output constructors 2026-03-25 16:56:04 -03:00
Daniil Polyakov 7b20a83379 fix: fixes after rebase & address comments 2026-03-20 00:48:04 +03:00
Daniil Polyakov b254ebb185 feat: refactor sequencer RPC client-side 2026-03-20 00:41:05 +03:00
jonesmarvin8 8dd5037e28 Merge branch 'main' into marvin/nonce 2026-03-17 16:45:08 -04:00
Daniil Polyakov 252848a145 feat: update rust to 1.94.0 2026-03-17 21:25:30 +03:00
Daniil Polyakov aa462b66eb feat: add nursery clippy lints 2026-03-17 21:25:30 +03:00
Daniil Polyakov e3b93b6e9a feat: add restriction clippy lints 2026-03-17 21:25:30 +03:00
Daniil Polyakov efe8393ba0 feat: add pedantic clippy lints 2026-03-17 21:25:30 +03:00
Daniil Polyakov 756f2f4135 feat: add workspace lints to every crate 2026-03-17 15:13:44 +03:00
jonesmarvin8 d863b763d1 Merge branch 'main' into marvin/nonce 2026-03-02 10:49:07 -05:00
Moudy 84c23e8680 Merge pull request #324 from logos-blockchain/moudyellaz-program-deployment-readme
Update README.md
2026-02-26 14:19:05 +01:00
r4bbit 6c2bdb1b20 feat: add --label option to wallet account new sub command
Following the work done in
https://github.com/logos-blockchain/lssa/pull/292 and the comment on
extending the work
https://github.com/logos-blockchain/lssa/pull/292#pullrequestreview-3672282664,
this commit introduces a new `--label` option to the `wallet account
new` sub command.

**Usage**:

```
wallet account new public --label "Public test account"
wallet account new private --label "Private test account"
```

Labels have to be unique across all accounts in the wallet storage.

The commit also adds tests, which make use of the `WalletSubCommand`
trait functions (hence the change to make it a `pub trait`).
2026-02-18 12:30:17 +01:00
jonesmarvin8 bf8c47b9b7 format fixes 2026-02-16 20:50:14 -05:00
jonesmarvin8 77f2fb6994 update nonce mechanism 2026-02-12 19:22:03 -05:00
Daniil Polyakov 975cfb9ec6 feat: fully integrate Sequencer, Indexer and Explorer with Bedrock 2026-02-12 16:31:13 +03:00
Moudy 3b6446ff86 added instrc for sequencer 2026-02-05 15:37:39 +01:00
Moudy b509817038 Update README.md
just removed the sequencer part as it has changed and replaces NSSA. I think this should be polished and moved under tutorials
2026-02-04 12:58:02 +01:00
David Rusu 38f1f68030 feat(license): MIT/Apache2 license and add cargo deny config 2026-01-31 23:13:36 +04:00
Daniil Polyakov 4e46dbbdf4 feat: implement private multi chain calls in wallet (nssa) 2026-01-17 02:28:31 +03:00
Daniil Polyakov 2fcde81301 Merge pull request #262 from logos-blockchain/arjentix/refactor-integration-tests
Big integration tests refactor
2026-01-13 00:32:04 +03:00
Danish Arora 2022f28228 fix: program deployment tutorial (#277) 2026-01-12 13:13:34 +05:30
Daniil Polyakov 7296088005 feat: introduce parallel integration tests, wallet without global vars and etc 2025-12-31 04:30:22 +03:00