50 Commits
Author SHA1 Message Date
moudyellaz 2d7dbf4d85 Merge remote-tracking branch 'origin/dev' into moudy/cross-zone-halt-operability
# Conflicts:
#	artifacts/lez/programs/cross_zone_inbox.bin
#	artifacts/lez/programs/ping_receiver.bin
#	artifacts/lez/programs/wrapped_token.bin
#	test_fixtures/fixtures/prebuilt_sequencer_db.dump
2026-08-20 12:13:50 +02:00
Daniil Polyakov 578350beea refactor(sequencer, storage): move transaction index into StorageActor 2026-08-20 00:37:23 +03:00
Daniil Polyakov 7249f2f881 refactor(sequencer): actor architecture, phase 2: Storage Actor 2026-08-20 00:37:23 +03:00
moudyellaz 7c9d9dac10 Merge remote-tracking branch 'origin/dev' into moudy/pending-dispatch-per-key
# Conflicts:
#	lez/sequencer/core/src/cross_zone_watcher.rs
2026-08-19 01:59:01 +02:00
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
moudyellaz 1f7d366167 fix(indexer)!: make cross-zone verification halts durable, diagnosable and recoverable
BREAKING CHANGE: IndexerSyncState gains Halted, so a pre-existing typed client fails to decode getStatus while an indexer is halted; the protocol enum now carries an Unknown fallback so this class of break ends here.
2026-08-14 15:27:25 +02:00
moudyellaz 5b87891230 feat(cross-zone): extract one peer-block acceptance policy and adopt it in the watcher 2026-08-13 21:46:19 +02:00
moudyellaz dc2d8ac93f fix(storage): store pending cross-zone dispatches as per-message entries 2026-08-13 09:06:52 +02:00
moudyellaz bb54bd0581 docs: simplify comments 2026-08-07 18:30:14 +02:00
moudyellaz c245434f09 feat(sequencer): dead-letter the cross-zone deliveries this node gives up on 2026-08-07 02:57:34 +02:00
Sergio Chouhy 3d5f083e78 fix(lez): duplicated lines 2026-08-06 16:40:39 -03:00
Moudy cfc7942c3c Merge branch 'dev' into moudy/cross-zone-content-bound-key 2026-08-06 20:59:46 +02:00
erhant 80a56be5aa fix(sequencer): properly adopt / orphan blocks in false-pos from L1 2026-08-06 20:44:48 +03:00
moudyellaz e4dcc39277 feat(storage): add a durable per-peer cross-zone chain tip 2026-08-05 19:27:06 +02:00
Daniil Polyakov 7e283f5fed fix(sequencer): rework WithdrawalReconciliationKey by using released note id 2026-07-31 18:26:33 +03:00
moudyellaz 2d201f7bac feat(storage): record cross-zone deliveries and settle them on finality 2026-07-31 10:55:24 +02:00
erhant 21af565ee3 fix(sequencer): tend to PR comments & self-review findings 2026-07-30 14:23:49 +03:00
erhant 849ea66c0f fix(sequencer): harden follow-path finalization and deposit/withdraw batching 2026-07-30 14:21:10 +03:00
erhant 57759d8953 fix(bridge): enforce deposit exactly-once via a per-op-id receipt PDA 2026-07-30 14:21:10 +03:00
erhant f9ef68dbf8 fix(sequencer): proper deposit and withdraw handling initial fixes for #633 2026-07-30 14:21:10 +03:00
erhant 71b59ac1b8 fix(sequencer): add apply_produced which is like apply_adopted but for our own block, which is not in channel yet 2026-07-23 11:43:57 +03:00
erhantandClaude Fable 5 8d09ffd733 feat(sequencer): two-tier chain state and multi-sequencer support
Decentralized-sequencing foundation: a shared chain_state crate (two-tier
head/final ChainState, apply_block, AcceptOutcome, StallReason, and the
absorbed channel-consistency machinery), turn-gated block production, the
publisher follow path for adopted/orphaned/finalized peer blocks, and
persistence that keeps disk order equal to apply order under the chain lock.

Rebased onto dev after #600/#606: chain_consistency is absorbed into
chain_state, the sequencer bootstrap's verify_and_reconstruct is re-wired
onto the two-tier ChainState (reconstruction applies channel history
through the final tier and persists via the follow-path primitives), and
test fixtures adopt the SequencerSetup builder extended with
with_bedrock_signing_key.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 11:43:57 +03:00
Daniil Polyakov 61f17612d9 fix(storage): rename ZonCursor to ZoneAnchor 2026-07-21 22:46:47 +03:00
Daniil Polyakov e3442c695f fix(sequencer): fix silent reconstruction when only genesis was committed 2026-07-21 22:46:47 +03:00
Daniil Polyakov 3e7e9ed4e1 fix(sequencer): fix double mint on deposit when reconstructing state 2026-07-21 22:46:47 +03:00
Daniil Polyakov 2d5489c04e feat(sequencer): bootstrap state from Bedrock 2026-07-21 22:46:25 +03:00
erhant d22f8b540b refactor(indexer): make put_block own the breakpoint schedule
`RISC0_DEV_MODE=1 RISC0_SKIP_BUILD=1 cargo test -p storage -p indexer_core`
2026-07-10 18:35:01 +03:00
erhant 9587cf96be refactor(indexer): remove now-redundant last_breakpoint_id meta cell 2026-07-10 18:35:01 +03:00
erhant 4d0be72973 chore(indexer): comment 2026-07-10 18:35:01 +03:00
erhant 2e49cdfd9c fix(indexer): harden stall durability and breakpoint guards w.r.t. Copilot review 2026-07-10 18:35:01 +03:00
erhant c297ad31d2 fix(indexer): seed breakpoint meta only on fresh store
`RISC0_DEV_MODE=1 RISC0_SKIP_BUILD=1 cargo test -p storage -p indexer_core`
2026-07-10 18:35:01 +03:00
erhant e706211631 fix(indexer): walk down to nearest breakpoint 2026-07-10 18:35:01 +03:00
erhant 93c311be3b fix(indexer): initial prep for breakpoint fix 2026-07-10 18:35:01 +03:00
erhant 88736d7421 fix(indexer): keep track of L1 slot of last inscription for correct tracking 2026-07-10 18:35:01 +03:00
erhant 16888478dd refactor(indexer): tend to several reviews by @schouhy 2026-07-10 18:35:00 +03:00
erhant c49cc7bc29 refactor(indexer): use "stall reason" instead of "chain breaker" 2026-07-10 18:35:00 +03:00
erhant 5b2c387fe9 feat(indexer): persist ChainBreaker in RocksDB meta
test `RISC0_DEV_MODE=1 RISC0_SKIP_BUILD=1 cargo test -p storage -p indexer_core --lib chain_breaker`
2026-07-10 18:35:00 +03:00
erhant 03f92abbcf refactor(indexer): rename execute_on_state and drop indexer-side tx checks
test with:
RISC0_DEV_MODE=1 RISC0_SKIP_BUILD=1 cargo test -p common -p storage -p indexer_core
2026-07-10 18:35:00 +03:00
Daniil Polyakov 89d2486970 feat(test_fixtures): apply zstd compression 2026-07-09 17:15:29 +03:00
Daniil Polyakov d0aaddbec1 feat(test_fixtures): use prebuilt sequencer dp to speed up integration tests 2026-07-09 17:15:29 +03:00
jonesmarvin8 f786aca73e refactor(lez): clean up long functions (#541)
* add helper functions

* CI fixes

* additional refactors

* fix: clarify doc comment on apply_mempool_transaction

* chore: apply nightly fmt

* fix: import missing ML_KEM_768_CIPHERTEXT_LEN in auth_transfer private test
2026-07-01 10:23:21 -04:00
Daniil Polyakov 96b28827f6 fix(tests): fix tests 2026-06-24 20:20:40 +03:00
Daniil Polyakov d3e507f25d refactor!(artifacts): keep lee and lez artifacts separated 2026-06-24 18:10:41 +03:00
Daniil Polyakov e5ca40c0f9 feat: add bedrock withdraw events validation 2026-06-16 22:10:11 +03:00
erhant dac429a94a Merge pull request #520 from logos-blockchain/erhant/hotfix-indexer-accepts-sequencer-deposit-txs-with-bypass
fix(indexer): bypass system account guards
2026-06-12 21:19:07 +03:00
erhant 4076de05c0 rename execute_unchecked_on_state to execute_without_system_accounts_check_on_state 2026-06-11 12:44:16 +03:00
erhant e6fa92dd1e initial hotfixes to bypass system account guards to allow deposit txes 2026-06-10 14:51:01 +03:00
erhant 38c826ae73 initial removals 2026-06-09 14:44:27 +03:00
Daniil Polyakov 7f5590907f feat(sequencer): make bridge deposits fault-tolerant 2026-06-04 15:17:56 +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