Commit Graph
3321 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 7ce202c64e refactor(lee): migrate ChainedCall/Message program reference from ProgramId to AccountId
Chained-call and public-transaction dispatch now address the target
program directly by AccountId instead of routing through ProgramId and
converting internally, closing the gap that blocked PDA-addressed
program invocation. The field is named program_account_id (not
account_id) to stay unambiguous next to the account_ids list it sits
beside in the same structs.

Execution/PDA-derivation logic that fundamentally needs the RISC0 image
id (self_program_id, caller_program_id, env::verify, PDA seed
derivation) stays ProgramId-typed, recovering it from the dispatched
AccountId via the existing bijection where needed.
2026-08-14 15:54:50 -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 89b8b930e3 docs(lee): trim program lookup comment in validated_state_diff 2026-08-13 21:04:01 -04:00
Marvin JonesandClaude Sonnet 5 78013d753a docs(lee): trim PROGRAM_STORAGE_OWNER and public_state doc comments
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-13 21:04:01 -04:00
Marvin Jones 5894c5d548 feat(lee): fold program storage into public_state, drop the separate programs map
V03State.programs is gone; deployed programs now live directly in
public_state, keyed by AccountId::from(program_id) same as any other
account. insert_program sets program_owner to a new reserved sentinel,
PROGRAM_STORAGE_OWNER, instead of leaving it at the default.

That ownership choice is load-bearing now in a way it wasn't before:
once program accounts share the same map as everything else, they're
reachable through ordinary dispatch, so program_owner determines
whether they're claimable/writable. Left unclaimed, a program
invocation could legitimately claim a program's storage account via
the normal claim path and then rewrite its elf; self-ownership has
the same flaw, since it authorizes exactly the program whose own
invocation would touch its own storage account. The reserved sentinel
makes every program account unwritable by construction, since no real
chained_call.program_id will ever derive to it.

programs() is removed; dispatch and the deployment-existence check go
through get_account_by_id_ref like any other account lookup.
genesis_fingerprint drops its separate program-hashing loop, since
program accounts now fall out of the existing public_state loop.

Rebuilt all guest artifacts and the test fixture via just
build-artifacts as a precaution, since V03State's Borsh shape changed
even though Account's did not.
2026-08-13 21:04:01 -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 0490820f05 docs(lee): trim DEFAULT_PROGRAM_OWNER and From<AccountId> for ProgramId docs 2026-08-13 17:14:24 -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
Marvin Jones 960bdfbb33 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.
2026-08-13 14:26:34 -04:00
Moudy 7699cd3ab3 Merge pull request #697 from logos-blockchain/moudy/cross-zone-outbox-log
fix(cross-zone)!: make an outbox slot a write-once log entry keyed by its emitter
2026-08-13 13:18:05 +02:00
moudyellaz b9173e675f Merge remote-tracking branch 'origin/dev' into moudy/cross-zone-outbox-log
# Conflicts:
#	test_fixtures/fixtures/prebuilt_sequencer_db.dump
#	tools/cross_zone_chat/src/main.rs
2026-08-13 09:35:37 +02:00
Pravdyvy 4f9993149c Merge pull request #643 from logos-blockchain/Pravdyvy/multi-sequencer-integration-tests
feat(integration_tests): adding multi-sequencer support for integration tests
2026-08-13 06:42:50 +03:00
Pravdyvy f0861d2497 Merge branch 'dev' into Pravdyvy/multi-sequencer-integration-tests 2026-08-13 04:10:13 +03:00
Pravdyvy 3fc1001ade fix(ci): fixtures rebuild 2026-08-13 03:47:09 +03:00
Daniil Polyakov f502c4f5e4 Merge pull request #691 from logos-blockchain/arjentix/actors-phase-1
refactor(sequencer): actor architecture, phase 1: RpcServer and Executor actors
2026-08-13 02:33:10 +03:00
Daniil Polyakov 6af1bf6cd0 fix(rpc_server): remove useless features 2026-08-13 00:13:05 +03:00
Daniil Polyakov 53295db71c refactor(sequencer): move common actor logic into ActorHandle 2026-08-12 23:40:07 +03: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
Daniil Polyakov a4fa9e08e2 fix(sequencer): fixes after rebase 2026-08-12 23:00:22 +03:00
Daniil Polyakov 774c8167f3 chore(sequencer): remove useless long comment 2026-08-12 22:50:50 +03:00
Daniil Polyakov c75eecc0fb refactor(rpc_server): move service into actor submodule 2026-08-12 22:50:50 +03:00
Daniil Polyakov 59a2c495d2 refactor(sequencer): move actors to actor.rs modules 2026-08-12 22:50:50 +03:00
Daniil Polyakov 3e448bb5e8 refactor(rpc_server): use strongly-typed error 2026-08-12 22:50:50 +03:00
Daniil Polyakov 2e929df834 fix(sequencer): set block production start delay and missed tick behaviour 2026-08-12 22:50:50 +03:00
Daniil Polyakov b9b02764b5 fix(sequencer): fixed typos 2026-08-12 22:50:50 +03:00
Daniil Polyakov 96a94e953d feat(sequencer): add error trace to SequencerHandle::failed() 2026-08-12 22:50:50 +03:00
Daniil Polyakov f91d0da8e1 refactor(sequencer): add test for mempool and bring back standalone feature 2026-08-12 22:50:50 +03:00
Daniil Polyakov ea1b454672 refactor(executor): add strongly typed error 2026-08-12 22:50:50 +03:00
Daniil Polyakov 9e54af0ce4 fix(sequencer): bring back Drop for SequencerHandle and remove StoreRelease 2026-08-12 22:50:50 +03:00
Daniil Polyakov 7541d7658b feat(sequencer): use actors in SequencerHandle 2026-08-12 22:34:14 +03:00
Daniil Polyakov 4ae9b30736 feat(sequencer): add RPC Server Actor 2026-08-12 22:34:14 +03:00
Daniil Polyakov 436908e08f feat(sequencer): add Executor actor 2026-08-12 22:34:14 +03:00
Moudy b08e80519e Merge pull request #699 from logos-blockchain/moudy/cross-zone-emitter-pins
feat(cross-zone)!: pin the outbox in both emitters and bridge_lock's mint destination
2026-08-12 18:13:10 +02:00
Pravdyvy e146f9ff5a Merge branch 'dev' into Pravdyvy/multi-sequencer-integration-tests 2026-08-12 18:43:09 +03:00
Moudy 6303adef11 Merge pull request #700 from logos-blockchain/moudy/cross-zone-target-auth 2026-08-12 17:26:56 +02:00
Moudy 39fb98198a Merge pull request #693 from logos-blockchain/moudy/cross-zone-per-block-seen-shard 2026-08-12 17:25:59 +02:00
moudyellaz 37bbe34579 chore(integration_tests): drop the unused logos-blockchain-core dependency 2026-08-12 15:59:41 +02:00
moudyellaz e7d3ec568b fix(build): resolve the artifacts dir at build-script runtime 2026-08-12 15:25:01 +02:00
moudyellaz f846e7ac73 feat(sequencer)!: suffix the sequencer db directory with its channel id
BREAKING CHANGE: the sequencer database moves from <home>/rocksdb to <home>/rocksdb-<channel id>; an existing home fresh-starts (with a warning naming the old directory) unless the directory is renamed.
2026-08-12 15:25:01 +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
Pravdyvy c907a03056 fix(fixtures): suggestions 4 2026-08-12 12:30:27 +03:00
Pravdyvy 13a0855295 fix(fixtures): suggestions 3 2026-08-12 08:51:37 +03:00
Pravdyvy 59769f5a35 Merge branch 'dev' into Pravdyvy/multi-sequencer-integration-tests 2026-08-11 16:28:02 +03:00
Pravdyvy d6372fec0d Merge pull request #701 from logos-blockchain/Pravdyvy/fix-new-fixtures
fix(ci): fixtures rebuild
2026-08-11 06:17:57 +03:00
Pravdyvy 127d081047 fix(ci): revert 2026-08-10 20:44:43 +03:00
Pravdyvy 285f9addc6 fix(ci): proper ci test 2026-08-10 18:00:11 +03:00
Pravdyvy 20255cf7e2 fix(ci): fixtures rebuild 2026-08-10 16:18:53 +03:00