Commit Graph
229 Commits
Author SHA1 Message Date
Marvin Jones 0ef2d61fee refactor(lee): migrate program self/caller identity from ProgramId to AccountId
ProgramInput/ProgramOutput.self_program_id/caller_program_id, and the
dispatcher's CallerData.program_id, now carry AccountId (renamed to
self_account_id/caller_account_id) instead of ProgramId. These fields
are self-reported/cross-checked dispatch bookkeeping, not RISC0 image
identity, and AccountId already crosses the guest/host boundary this
way via every pre_state.account_id.

ProgramId is now confined to what's actually image-id-keyed:
env::verify, Program.id (from compute_image_id()), and the
for_public_pda/for_private_pda derivation formulas, each recovering
the real ProgramId from AccountId via the existing bijection exactly
where needed.

Rebuilds artifacts and the prebuilt sequencer db fixture to match.
2026-08-14 16:43:59 -04:00
Marvin Jones 18cdd7a232 refactor(lee): centralize program-ownership check behind V03State::get_program 2026-08-13 21:28:19 -04:00
Marvin Jones 8bc32eab6b test(lee): add known-answer tests for ProgramId/AccountId conversion, rebuild artifacts 2026-08-13 20:58:04 -04:00
Marvin Jones 440e4a6d73 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.
2026-08-13 17:10:05 -04:00
Marvin Jones 087f6a6c69 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.
2026-08-13 16:55:51 -04:00
Marvin JonesandClaude Sonnet 5 efbd0a3563 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>
2026-08-13 16:52:32 -04:00
moudyellaz ae3fd849e3 Merge remote-tracking branch 'origin/dev' into moudy/cross-zone-outbox-log
# Conflicts:
#	artifacts/lez/programs/amm.bin
#	artifacts/lez/programs/associated_token_account.bin
#	artifacts/lez/programs/authenticated_transfer.bin
#	artifacts/lez/programs/bridge.bin
#	artifacts/lez/programs/bridge_lock.bin
#	artifacts/lez/programs/clock.bin
#	artifacts/lez/programs/cross_zone_inbox.bin
#	artifacts/lez/programs/cross_zone_outbox.bin
#	artifacts/lez/programs/faucet.bin
#	artifacts/lez/programs/pinata.bin
#	artifacts/lez/programs/pinata_token.bin
#	artifacts/lez/programs/ping_receiver.bin
#	artifacts/lez/programs/ping_sender.bin
#	artifacts/lez/programs/token.bin
#	artifacts/lez/programs/vault.bin
#	artifacts/lez/programs/wrapped_token.bin
#	test_fixtures/fixtures/prebuilt_sequencer_db.dump
2026-08-12 22:37:45 +02:00
moudyellaz f8da8f40b3 Merge remote-tracking branch 'origin/dev' into moudy/cross-zone-per-block-seen-shard
# Conflicts:
#	artifacts/lez/programs/bridge_lock.bin
#	artifacts/lez/programs/cross_zone_inbox.bin
#	artifacts/lez/programs/wrapped_token.bin
#	test_fixtures/fixtures/prebuilt_sequencer_db.dump
2026-08-12 15:13:30 +02:00
moudyellaz 869a130eec chore: regenerate artifacts and the prebuilt sequencer fixture
Every guest moved, not only the ones whose source changed: adding real
dependencies (borsh to two cores, cross_zone_inbox_core to two targets) changes
the build graph, and with it the metadata hash of every crate in the guest build.
Piece A moved only three because it added a dev-dependency, which the guest build
never sees.
2026-08-10 15:01:26 +02:00
moudyellaz cd4027593c chore: regenerate artifacts and the prebuilt sequencer fixture 2026-08-09 19:47:47 +02:00
moudyellaz 7a324f2825 chore: regenerate artifacts and the prebuilt sequencer fixture 2026-08-09 02:21:14 +02:00
moudyellaz e0d5747b19 Merge branch 'dev' 2026-08-07 22:48:27 +02:00
moudyellaz abc1a57e14 chore: regenerate artifacts and the prebuilt sequencer fixture 2026-08-07 22:23:59 +02:00
agureev 736102329f chore: regenerate artifacts 2026-08-07 15:51:00 +04:00
Artem Gureev ca23f12f7a refactor(lee): keep the authorization precondition match wildcard-free 2026-08-05 11:43:02 +04:00
agureev d05035eb9e refactor(lee): refactor private kinds 2026-08-04 15:55:09 +04:00
agureev ccb426960f Merge remote-tracking branch 'origin/dev' into artem/bundle-actions 2026-08-04 14:21:00 +04:00
moudyellaz a1172602fc chore: update artifacts 2026-08-03 08:46:39 +02:00
Daniil Polyakov 2c9c824a0c chore(artifacts): regenerate artifacts with r0.1.91.1 risc0 docker container 2026-07-31 18:26:34 +03:00
Sergio Chouhy 2f42a7b119 fix(nix): update flake nix to add pcsclite 2026-07-30 22:24:18 -03:00
agureev 0e957b5c08 chore: docs for PrivateAction commitment field 2026-07-31 00:47:04 +04:00
agureev dbcdbb29f3 Merge remote-tracking branch 'origin/dev' into artem/bundle-actions 2026-07-31 00:16:31 +04:00
erhant 6203d65131 chore: update artifacts 2026-07-30 14:41:42 +03:00
agureev 846e1944bf chore: regenerate fixtures 2026-07-29 22:53:21 +04:00
Artem Gureev f16c3bd1e2 refactor: bundle private/public i/o into action struccts 2026-07-29 18:16:13 +00:00
agureev b5d5d862af chore: regenerate artifacts 2026-07-28 16:14:06 +04:00
agureev 8cebe109fe chore: regen artifacts, fixtures 2026-07-28 11:13:47 +00:00
agureev a4805382bd chore: format, regenerate artifacts and fixtures 2026-07-28 11:12:52 +00:00
agureev df13f3f17d chore: regenerate artifacts 2026-07-24 21:48:24 +04:00
agureev 2ed620097b chore: regenerate artifacts and fixtures 2026-07-24 16:38:04 +00:00
agureev 93b1ee2839 chore: regenerate artifacts and fixtures 2026-07-24 16:38:04 +00:00
Artem Gureev d30490442d fix(wallet): encapsulate dummy note epk in wallet 2026-07-24 16:37:52 +00:00
moudyellaz 113d5db6f5 fix(cross-zone): make InitConfig idempotent under genesis replay 2026-07-24 08:32:45 +02:00
moudyellaz 150cd17ff5 Merge origin/dev 2026-07-24 00:56:00 +02:00
moudyellaz 124bbee6c6 Merge origin/dev 2026-07-23 23:59:36 +02:00
jonesmarvin8andClaude Sonnet 5 6c0bd71523 refactor: PrivateUnauthorized authorization changed to true (#621)
* refactor: rename PrivateUnauthorized to PrivateForeignInit

The account_identity's is_authorized flag no longer determines
authorization for this variant, so keep the name tied to what
actually distinguishes it: no nsk, only npk (a foreign account init).

* chore: rebuild guest artifacts and bump spin to clear yanked advisory

Regenerate ELF artifacts after the PrivateForeignInit rename in lee_core
(compiled into every guest program), and update spin 0.9.8 -> 0.9.9 since
0.9.8 was yanked from crates.io, per cargo deny check advisories.

* test: align is_authorized with PrivateForeignInit's flipped semantics

Recipient pre-states built for PrivateForeignInit now need is_authorized:
true to match the assertion in output.rs. Also rewrites the boundary test
that checked the old invalid case to check the new one, and updates
stale "unauthorized" wording left over from the PrivateUnauthorized name.

* chore: rebuild guest artifacts

Reproducible across repeated local builds; likely toolchain drift since
the prior artifact commit rather than a source change, since no
guest-relevant source or Cargo.lock changed in between.

* fix(tests): align integration tests with PrivateForeignInit and regenerate fixture

prove_init_with_commitment_root (private.rs) and build_privacy_transaction
(tps.rs) still built PrivateForeignInit recipients with is_authorized: false,
same stale-semantics bug fixed earlier in the lee crate's own tests.

The prebuilt sequencer DB dump embeds program IDs derived from guest ELF
bytes, which shifted once the PrivateForeignInit rename changed lee_core
(compiled into every guest program). The stale dump caused widespread
"Unknown program" failures across integration test suites that exercise
deployed programs (wallet_ffi, auth_transfer, bridge, amm, token, pinata,
ata, indexer state-consistency checks). Regenerated via
`just regenerate-test-fixture`.

* fix(tests): rename leftover PrivateUnauthorized to PrivateForeignInit and regenerate fixture

* test: align is_authorized with PrivateForeignInit's flipped semantics

* chore: regenerate test fixture after rebase onto dev

* chore: regenerate test fixture after rebase onto dev

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

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-23 17:32:01 -04:00
moudyellaz 72195ce09e Merge origin/dev 2026-07-23 02:43:53 +02:00
agureev 61cad70f9b feat(circuit): supply a view_tag on private-account updates 2026-07-22 22:31:31 +04:00
moudyellaz d4d2d56e47 chore: rebuild artifacts and regenerate test fixture 2026-07-22 04:22:17 +02:00
moudyellaz b0c90fcc58 Merge origin/dev 2026-07-14 23:33:10 +02:00
Pravdyvy a1b4585c99 fix(deps): machete, artifacts and deny fix 2026-07-14 13:52:06 +03:00
agureev ae391612bd Merge remote-tracking branch 'origin/dev' into artem/change-wallet-balance-fetch 2026-07-13 15:19:06 +04:00
moudyellaz eff31df9ce Merge origin/dev 2026-07-11 01:12:00 +02:00
agureev bf86d0c05b Merge remote-tracking branch 'origin/dev' into artem/change-wallet-balance-fetch 2026-07-08 22:55:15 +04:00
moudyellaz 9f7db3fa38 Merge origin/dev 2026-07-04 00:48:40 +02:00
moudyellaz 4f75e29a3c Merge origin/main
Integrates origin/main (per-program-crate refactor) and re-homes the cross-zone messaging feature onto it.

BREAKING CHANGE: Genesis state root changes. This registers six builtin programs
(cross_zone_outbox, cross_zone_inbox, ping_sender, ping_receiver, bridge_lock,
wrapped_token) and seeds their genesis accounts (the wrapped_token authorized
minter config, the per-zone inbox config, and optional bridge-lock holdings).
Building the new cores alongside the existing builtins also enables serde/alloc
for the shared programs build, regenerating every builtin program image id. All
nodes must upgrade together.
2026-07-04 00:47:20 +02:00
agureev 8e084e22d1 Merge remote-tracking branch 'origin/dev' into artem/viewing-key-binding 2026-07-02 20:04:30 +04:00
agureev 37b0108c43 chore: update artifacts 2026-07-01 21:57:07 +04:00
jonesmarvin8 072ea3b066 refactor(lee::state_machine): clean up long functions and files (#535)
* refactor(lee): split large modules into directories and extract tests

Split state.rs, program.rs, circuit.rs, validated_state_diff.rs,
merkle_tree, and core/program.rs into module directories with separate
test files. State tests are further split into themed files (genesis,
authenticated_transfer, circuit, claiming, etc.). Extract
authenticate_public_transaction_signers helper in validated_state_diff
to remove duplicated authentication logic.

* chore: rebuild artifacts
2026-07-01 11:11:08 -04:00
jonesmarvin8 f8d859394b refactor(privacy_preserving_circuit): introduce helper functions to shorten long functions (#545)
* refactor(privacy_preserving_circuit): extract functions for readability

* refactor(privacy_preserving_circuit): address PR review comments

Bundle shared handle_* arguments into PrivateOutputHandler struct in
output.rs and fix misplaced docstring on resolve_external_seed in
execution_state.rs.

* feat: update commitment mechanism for new private account (#546)

* refactor(privacy_preserving_circuit): extract functions for readability

* feat: update commitment mechanism for new private accounts

Allow init accounts to optionally use a real membership proof for
DUMMY_COMMITMENT instead of hardcoding DUMMY_COMMITMENT_HASH as the
CommitmentSetDigest. The wallet fetches the proof from the sequencer
and passes it through the circuit.

* fix: address clippy lints and fix integration test visibility

* add tests

* refactor: removed duplicated code

* refactor: simplify init nullifier mechanism

Replace Option<MembershipProof> with Option<CommitmentSetDigest> on init
variants (PrivateAuthorizedInit, PrivateUnauthorized, PrivatePdaInit).
The circuit now receives the commitment tree root directly instead of
recomputing it from a Merkle proof.

* refactor: use CommitmentSetDigest directly instead of Option for init commitment root

Address PR #546 review feedback: the circuit now accepts CommitmentSetDigest
directly on init variants (PrivateAuthorizedInit, PrivateUnauthorized,
PrivatePdaInit), with callers providing DUMMY_COMMITMENT_HASH as the default.
Also fixes duplicate resolve_external_seed from rebase and rebuilds artifacts.

* style: run cargo +nightly fmt
2026-07-01 10:14:32 -04:00