54 Commits

Author SHA1 Message Date
moudyellaz
d6a2075a7c fix(sequencer): gate bootstrap republish on channel existence, not finalized-scan emptiness 2026-07-24 14:33:24 +02:00
moudyellaz
d9787eb72f style(sequencer): backtick InitConfig in build_initial_state doc comment 2026-07-24 01:07:41 +02:00
moudyellaz
124bbee6c6 Merge origin/dev 2026-07-23 23:59:36 +02:00
moudyellaz
dc977db7ab refactor: destructure genesis fingerprint and return an iterator from bridge_lock_holdings 2026-07-23 21:55:55 +02: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
erhant
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
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
Daniil Polyakov
e440430a50 feat(sequencer): add more reconstruction tests 2026-07-21 22:46:47 +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
8fdc3f203d fix(sequencer): don't increment withdrawals count on reconstruction to prevent phantom counts 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
moudyellaz
f4a5d85c65 refactor(cross-zone): seed cross-zone config via genesis transactions 2026-07-21 15:19:16 +02:00
moudyellaz
a806ebb94a refactor(cross-zone)!: register cross-zone programs as base builtins
BREAKING CHANGE: GenesisAction::DeployProgram and IndexerConfig.deploy_programs are removed. The cross-zone programs (inbox, outbox, ping_sender, ping_receiver, bridge_lock, wrapped_token) are now base builtins in testnet_initial_state, because program bytecode exceeds the genesis block inscription limit, so they cannot be shipped through genesis transactions.
2026-07-21 10:50:41 +02:00
moudyellaz
9380198eb9 refactor(cross-zone): use the Balance alias for holding amounts and debug-log skipped replays 2026-07-16 12:44:36 +02:00
moudyellaz
a16e22c46c refactor!(cross-zone): deploy programs at genesis instead of builtins
Cross-zone builtin programs are no longer registered in the production
genesis. A zone that participates declares the ones it uses via a new
GenesisAction::DeployProgram (sequencer) and a matching deploy_programs
list (indexer), both resolved through CrossZoneProgram and registered
with with_programs. Cross-zone genesis accounts (inbox config,
wrapped-token config) are seeded through the state constructor for a
receiving zone, and bridge-lock holdings are seeded from their actions
regardless of receiving config, dropping V03State::insert_genesis_account.
GenesisAction amounts now use the Balance alias. Documents cross_zone as
the reference LEZ adapter and the bridge demo as not production-safe.

The sequencer's DeployProgram set and the indexer's deploy_programs are
configured separately, so both nodes now log a deterministic genesis
fingerprint (V03State::genesis_fingerprint) at startup: equal values
confirm the two genesis states agree, a mismatch flags a divergent
deploy set.

BREAKING CHANGE: the genesis state root changes (cross-zone builtins are
out of production genesis) and the sequencer/indexer configs gain the
DeployProgram / deploy_programs list that cross-zone-participating zones
must set.
2026-07-13 19:12:24 +02:00
moudyellaz
eff31df9ce Merge origin/dev 2026-07-11 01:12:00 +02:00
Daniil Polyakov
d0aaddbec1 feat(test_fixtures): use prebuilt sequencer dp to speed up integration tests 2026-07-09 17:15:29 +03:00
Daniil Polyakov
7408955f08 feat!(wallet): wait for deploy tx inclusion in block
Breaking:
  1. Now a lot of wallet commands return `TransactionExecuted`, instead of `Empty`.
  2. Sequencer's `getTransaction()` RPC response changed from `tx` to `(tx, block_id)`
2026-07-09 00:32:53 +03:00
moudyellaz
9f7db3fa38 Merge origin/dev 2026-07-04 00:48:40 +02:00
moudyellaz
71c9351727 feat(cross-zone): add interactive two-zone chat demo app 2026-07-04 00:47:20 +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
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
fc800a7151 fix(sequencer): don't accept zero deposits & remove unreachable 2026-06-30 12:38:22 +03:00
Marvin Jones
6155bd9a37 fix(encryption): rename os_random to random_seed and fix ESK derivation in tests
Rename os_random field to random_seed per review feedback. Fix tests
that constructed SharedSecretKey with a hardcoded EphemeralSecretKey
instead of deriving it via EphemeralSecretKey::new.
2026-06-29 09:10:43 -04:00
Marvin Jones
060a83879b feat(encryption): derive esk from account state, remove chacha20poly1305 logic
Introduce EphemeralSecretKey as a proper struct with EphemeralSecretKey::new()
that derives esk from SHA256("/LEE/v0.3/esk/" || account_id || os_random || nonce).
Rename witness field from esk to os_random. Simplify encapsulate_deterministic
to accept pre-derived EphemeralSecretKey directly.
2026-06-29 09:10:43 -04:00
Daniil Polyakov
d11b706756 feat(sequencer): add getChannelId rpc endpoint 2026-06-25 16:47:04 +03:00
moudyellaz
36ed949be0 chore: some cleanup 2026-06-25 09:38:30 +02:00
moudyellaz
ff7610804a feat(cross-zone): pin peer block-signing keys and distinguish verifier lag from forgery 2026-06-25 08:21:49 +02:00
moudyellaz
fef7ce2c38 feat(cross-zone): reject user-origin calls to the sequencer-only inbox 2026-06-25 05:49:44 +02: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
moudyellaz
2c387899c4 feat(cross-zone): recognize multiple emitters via a shared extractor 2026-06-24 11:33:15 +02:00
moudyellaz
0ddb7a9291 feat(cross-zone): add Option B indexer verifier and seed inbox config consistently 2026-06-23 14:21:16 +02:00
agureev
090c368c14 tests: test and flow updates 2026-06-23 15:51:58 +04:00
moudyellaz
77cfff5256 feat(cross-zone): add inbox watcher and seed inbox config at genesis 2026-06-23 10:17:46 +02:00
Pravdyvy
855788c2ea fix(ci): ci fix 2026-06-17 12:54:27 +03:00
Pravdyvy
0fae6aada2 Merge branch 'main' into Pravdyvy/programs-elfs-deployments 2026-06-17 10:36:19 +03:00
Daniil Polyakov
e5ca40c0f9 feat: add bedrock withdraw events validation 2026-06-16 22:10:11 +03:00
Daniil Polyakov
77f1fb3f21 feat(wallet): add bridge withdraw command 2026-06-16 22:10:11 +03:00
Daniil Polyakov
d6e68a52ca feat(state): forbid private bridge withdrawals 2026-06-16 22:10:11 +03:00
Daniil Polyakov
e9e30ff019 feat(sequencer): implement bridge withdraw flow 2026-06-16 22:10:11 +03:00
Petar Radovic
a12d8ecf87 clippy 2026-06-15 12:30:18 +02:00
Petar Radovic
c2f93aff59 clippy 2026-06-15 12:28:05 +02:00
Petar Radovic
13f15530e4 update logos blockchain deps + drive loop fix 2026-06-15 12:22:00 +02:00
Pravdyvy
d63584fe11 fix(sequencer_core): new zones api try 2026-06-15 10:55:05 +03:00
erhant
85284562b4 removed bedrock_parent_id as well 2026-06-10 11:08:14 +03:00