Commit Graph
26 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
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
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 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
David Rusu 38f1f68030 feat(license): MIT/Apache2 license and add cargo deny config 2026-01-31 23:13:36 +04:00
Daniil Polyakov 9b37a2a8b7 Merge pull request #248 from logos-blockchain/arjentix/build-docker-image
Publish sequencer_runner Docker image with CI
2025-12-19 21:05:28 +03:00
Daniil Polyakov ddf6e707ec feat: add cargo machete check to CI 2025-12-19 18:30:40 +03:00
Daniil Polyakov 87f45b8215 feat: move all crates into workspace 2025-12-19 18:30:40 +03:00
Sergio Chouhy a360df29bf Merge branch 'schouhy/add-program-deployment-example' into schouhy/add-program-deployment-example-pda 2025-12-12 17:35:01 -03:00
Sergio Chouhy 63f102643b add instructions to get the hello world program id in hex 2025-12-12 14:30:36 -03:00
Sergio Chouhy 89c1a97798 add example and instructions for pda 2025-12-12 13:00:16 -03:00
Sergio Chouhy 8c92a58bbc add program deployment examples 2025-12-11 20:59:37 -03:00