Commit Graph
48 Commits
Author SHA1 Message Date
jonesmarvin8andClaude Sonnet 5 2ba1ecd609 refactor!(lee): Change program_owner: ProgramId to AccountId (#722)
* feat(lee): store deployed programs as Account-shaped state, keyed by AccountId

Program-as-Account migration, first slice: V03State.programs becomes
HashMap<AccountId, Account> instead of HashMap<ProgramId, Program>,
with the elf held directly in Account.data. The map key is derived
from ProgramId via a new 1:1 From<ProgramId> for AccountId conversion
(both types are exactly 32 bytes) rather than a hash, since ProgramId
is already content-derived from the elf.

Account.program_owner stays ProgramId-typed everywhere - this only
changes how deployed programs are stored and looked up host-side, not
the dispatch/authorization model any guest program logic depends on.
Dispatch resolves a ChainedCall's program_id by converting to
AccountId, fetching the Account, and reconstructing a Program via
new_unchecked for execution.

DATA_MAX_LENGTH is raised from 100 KiB to 700 KiB to fit real program
elfs (observed 375 KB-631 KB) directly in Account.data; noted in its
docstring as a rough placeholder pending real transaction/block-size
budget analysis.

* fix(lee): store deployed programs as Account-shaped state, correct SeenShard cap

Corrects lee/state_machine internals for the Program-as-Account migration
and fixes SeenShard::MAX_DELIVERIES, which was still calibrated for the
old 100 KiB DATA_MAX_LENGTH instead of the current 700 KiB cap. Rebuilds
program artifacts and the sequencer test fixture to match.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* address PR #720 review nits

- Use FIXME instead of TODO for the temporary ProgramId->AccountId
  conversion, per review convention for patches guaranteed to be
  fixed later.
- Derive cross_zone_inbox's MAX_DELIVERIES from DATA_MAX_LENGTH
  instead of a hand-recomputed literal, so it stays in sync
  automatically the next time the cap changes.

* feat(lee): migrate Account.program_owner from ProgramId to AccountId

Account.program_owner is now AccountId-typed instead of ProgramId,
via a new bijective From<ProgramId> for AccountId / From<AccountId>
for ProgramId conversion pair (pure byte reinterpretation, not a
hash - both types are exactly 32 bytes). Adds DEFAULT_PROGRAM_OWNER
as the AccountId-typed counterpart to DEFAULT_PROGRAM_ID, used at
every program_owner comparison/claim site instead of an inline
AccountId::default().

Touches every call site across lee_core, lee (including the
guest-side privacy-preserving circuit), all 16 deployed guest
programs, wallet/wallet-ffi, indexer_ffi/indexer_service/
indexer_service_protocol, sequencer_core, testnet_initial_state,
system_accounts, cross_zone, storage, cycle_bench, and
integration_tests - mostly mechanical .into() conversions, plus two
simplifications: wallet's manual base58 encode/decode of
program_owner was dead code once it's AccountId (which already has
Display/FromStr), and the FFI crates' program_owner field now reuses
the existing generic FfiBytes32 wrapper instead of the now-unused
FfiProgramId one.

Rebuilds every guest ELF artifact and the prebuilt sequencer test
fixture via just build-artifacts, since execute_and_prove runs
against the checked-in precompiled privacy_preserving_circuit.bin,
which isn't rebuilt automatically by cargo test/check.

* chore(lee): rebuild artifacts after rebase, drop unused base58 dep

Rebases marvin/program-as-account-2 onto the updated
marvin/program-as-account (SeenShard cap fix), regenerating program
and circuit artifacts plus the sequencer test fixture to match.
Also removes lez/wallet's now-unused base58 dependency, dead since
AccountId gained its own Display/FromStr base58 encoding.

* docs(lee): trim DEFAULT_PROGRAM_OWNER and From<AccountId> for ProgramId docs

* test(lee): add known-answer tests for ProgramId/AccountId conversion, rebuild artifacts

* fix(lee): apply program_owner AccountId migration to code added after rebase

dev grew new program_owner call sites (sequencer_stake genesis/config
handling, committee_discovery, a new selective_pda_delegator test
program, and related tests) after this branch's ProgramId->AccountId
migration commit was originally written, so they predated the .into()
sweep and didn't conflict during the rebase - they just still assumed
the old ProgramId-typed field. Converts all of them, fixes a stray
unseparated hex literal clippy caught along the way, and rebuilds
artifacts against the fixed source.

* chore(lee): regenerate test fixture after rebasing onto dev

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-18 11:26:57 -04:00
Pravdyvy 94beb74007 Merge branch 'dev' into Pravdyvy/ffi-tx-status-poll 2026-08-10 13:29:32 +03:00
Pravdyvy 62de1b3e8d fix(integration_tests): fix double free 2026-08-07 16:21:46 +03:00
Artem Gureev 64ddd7440f fix(wallet-ffi): revert zero-ing of derived keys 2026-08-07 17:14:02 +04:00
Pravdyvy aa9f59648e fix(integration tests): added poll call into integration tests 2026-08-07 15:33:27 +03:00
Pravdyvy 45452c80ac feat(wallet_ffi): tx status 2026-08-07 15:19:12 +03:00
Artem Gureev 3878251ce3 refactor(wallet): derive the shared PDA npk from its nsk 2026-08-07 10:41:56 +00: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
Sergio Chouhy b3eb74cf46 fix(lez/wallet): drop signing with recipient keys 2026-07-24 18:05:40 -03:00
Pravdyvy 0c32025c4b feat(wallet_ffi): multi-poller 2026-07-21 18:01:04 +03:00
Pravdyvy eaa76f5e7e fix(wallet): suggestions 3 2026-07-20 11:34:05 +03:00
Pravdyvy b3810ff77d fix(wallet): added client rotation 2026-07-17 17:31:11 +03:00
Pravdyvy 0bc08c7357 fix(wallet): suggestions 2026-07-17 16:57:12 +03:00
Pravdyvy 441e43ef91 Merge branch 'dev' into Pravdyvy/multi-sequencer-client 2026-07-15 16:40:38 +03:00
Pravdyvy 651229c454 fix(wallet_ffi): merge upfix 2026-07-15 13:35:53 +03:00
Pravdyvy e4fd9b2397 Merge branch 'dev' into Pravdyvy/pda-account-id-generation 2026-07-15 12:57:16 +03:00
Pravdyvy bf237daf71 fix(tintegration_tests): tests work 2026-07-14 13:10:32 +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
Pravdyvy e61306e498 fix(wallet_ffi): suggestions 2 2026-07-08 14:33:32 +03:00
Pravdyvy 91e310b8a0 fix(wallet_ffi): suggestiion 1 2026-07-06 09:14:34 +03:00
agureev 8e084e22d1 Merge remote-tracking branch 'origin/dev' into artem/viewing-key-binding 2026-07-02 20:04:30 +04:00
Pravdyvy 9d1e873344 Merge branch 'dev' into Pravdyvy/pda-account-id-generation 2026-07-01 15:34:20 +03:00
Pravdyvy 53ae6dcfdd fix(wallet_ffi): asref suggestion 2026-06-30 12:46:52 +03:00
Pravdyvy e45da097cf fix(doc): doctext fix 2026-06-26 19:01:15 +03:00
Pravdyvy 62437e48ee fix(wallet-ffi): functions is safe 2026-06-26 18:57:22 +03:00
Pravdyvy 0ee39e04ee feat(wallet-ffi): pda helpers 2026-06-26 18:54:15 +03:00
Pravdyvy fade3b488a feat(integration_tests): added integration tests for wallet ffi 2026-06-26 16:48:00 +03:00
Pravdyvy 860746dac9 feat(wallet_ffi): labels added 2026-06-25 18:29:35 +03:00
Daniil Polyakov c74b03582b refactor!(wallet): pass program_id instead of program in send_pub_tx() 2026-06-24 20:19:12 +03:00
Daniil Polyakov d3e507f25d refactor!(artifacts): keep lee and lez artifacts separated 2026-06-24 18:10:41 +03:00
Pravdyvy d8c50ceb59 Merge branch 'main' into Pravdyvy/ffi-mnemonic 2026-06-24 13:02:12 +03:00
Sergio Chouhy 47a94ac7e4 feat(wallet-ffi): add vault claim ffi 2026-06-24 10:35:31 +02:00
agureev 090c368c14 tests: test and flow updates 2026-06-23 15:51:58 +04:00
Pravdyvy 5c28acc961 fix(wallet_ffi): suggestion fix 2026-06-23 11:10:53 +03:00
Pravdyvy ca64789a90 Merge branch 'main' into Pravdyvy/ffi-mnemonic 2026-06-22 14:00:08 +03:00
Sergio Chouhy 32c6b9e5fc feat: add withdraw ffi 2026-06-18 16:35:44 -03:00
Pravdyvy c6d7f37a1a Merge branch 'main' into Pravdyvy/ffi-mnemonic 2026-06-18 18:44:00 +03:00
Pravdyvy 4af5651c9e fix(wallet_ffi): fiull restoration reproduction 2026-06-15 11:53:07 +03:00
Pravdyvy b85e6d31e0 Merge branch 'main' into Pravdyvy/programs-elfs-deployments 2026-06-10 20:09:24 +03:00
Pravdyvy e0348dc331 feat(integration_tests): mnemonic test 2026-06-10 19:25:58 +03:00
Pravdyvy a3ed222887 feat(wallet-ffi): mnemonic checnges 2026-06-09 19:47:12 +03:00
feb6cb7f92 feat(wallet): add keycard support for public accounts for public/privacy txs for program facades (#461)
* feat: add basic commands for communicating with keycard

* initialize changes

* reorganization

* add script file for easier wallet access

* update commands

* fixes

* fixed load for non continuous run

* Updates for signatures with keycard

* fix BIP-340 signatures for fixed sized messages

* fmt

* refactor and add pin support to program facades

* fix unit test

* fixes

* Revert "fixes"

This reverts commit 41f34f4ff4.

* fixes

* fixes

* Removed privacy keycard calls

* Revert "Removed privacy keycard calls"

This reverts commit d70ef505a1.

* Add domain separators

* Removed privacy txs for keycard

* CI fixes

* CI fixes

* addressed some comments

* fix ci

* initialize branch

* ci fixes

* fix integration test issue and updated keycard firmware

* addressed more comments

* fixed deny

* remove keycard-py

* fixed from earlier merge

* add hash_message tests

* add test

* fix deny

* CI fixes

* fixed integration tests

* Update public.rs

* update artifacts

* privacy command fixes

* ci and comments

* addressed comments

* comment fixes

* fixes from merging main

* adding support to other programs

* expanded support

* ci fixes

* ci and add private account keys test

* some fixes and setup notes

* Ci fixes

* ci fixes

* update key paths to avoid collisions in tests

* added separated files for keycard_tests_2.sh

* first round of comments

* Revert "Merge branch 'main' into marvin/keycard-commands"

This reverts commit 3fce53f663, reversing
changes made to e7b42a5177.

* python comments

* addressed comments

* compile error fixed

* fix artifacts

* fix main merge error

* adjust signer logic workflow

* updating logic

* fmt

* refactored

* clippy fix

* minor fix

* addressing comments

* minor fix

* ci fix

* addressed deferred comments

* clean up

* minor cleanup

* ci fixes

* fmt fix

* feat!(wallet): Merged `SigningGroup` with `AccountManager` (#500)

* feat: account manager extension

* feat(wallet): added unified way of sending public transactions to all facades

* fix(wallet): no sign option added

* fix(deny): deny fix

* fix(wallet): suggestion 1

* fix(wallet): suggestion fix 1

* feat!: Add new path for externally provided seed to the circuit.

BREAKING CHANGE: add identity variants to the circuit and change semantics for `Claim::Authorized` for private PDAs

* feat(ci): use separate job per each integration tests module

* feat(ci): cache rust artifacts

* feat(ci): build integration tests binary once and reuse it

* fix(wallet): fmt

* ci: add bench-regression workflow with criterion-compare for crypto_primitives_bench

* fix(wallet): merge postfix

* feat!(wallet): SigningGroup merged with AccountManager

* fix(ci): deny and artifacts fix

* fix(deny): deny fix

* fix keycard and lint

---------

Co-authored-by: Sergio Chouhy <sergio.chouhy@gmail.com>
Co-authored-by: Daniil Polyakov <arjentix@gmail.com>
Co-authored-by: Moudy <m.ellaz@hotmail.com>
Co-authored-by: Sergio Chouhy <41742639+schouhy@users.noreply.github.com>
Co-authored-by: jonesmarvin8 <83104039+jonesmarvin8@users.noreply.github.com>

* addressed comments

* minor comments

* Rebase to main

* CI fixes

---------

Co-authored-by: Pravdyvy <46261001+Pravdyvy@users.noreply.github.com>
Co-authored-by: Sergio Chouhy <sergio.chouhy@gmail.com>
Co-authored-by: Daniil Polyakov <arjentix@gmail.com>
Co-authored-by: Moudy <m.ellaz@hotmail.com>
Co-authored-by: Sergio Chouhy <41742639+schouhy@users.noreply.github.com>
2026-06-05 17:35:10 -04:00
Pravdyvy 76696a5d08 feat(wallet_ffi): freeing of ffi programs 2026-06-04 21:15:17 +03:00
Pravdyvy 7ccd8e2435 feat(wallet_ffi): program elfs and program deployment 2026-06-04 21:05:58 +03:00
jonesmarvin8 2104f71e39 feat(key-protocol/nssa)!: PQ resistance primitives for vsk/vpk for shared key agreement (#474)
* initialize pq encryption changes

* key agreement update

* add test and other fixes

* ci fixes

* fix unit tests

* updates from main and ci

* added updated specs for pq encryption

* addressing comments

* addressed comments

* fix clippy errors from main merge

* Rebased to main
2026-06-03 14:40:06 -04:00
Pravdyvy a999563a2d Merge branch 'main' into Pravdyvy/wallet-ffi-extension 2026-06-03 15:09:55 +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