Commit Graph
117 Commits
Author SHA1 Message Date
erhant 03d73c17a5 fix(fees): rename to from_public_transaction_with_cycle_budget 2026-08-24 21:39:55 +03:00
erhant 02860fdd6e fix(fees): review fixes — correct overshoot docs and harden OutOfGas match 2026-08-24 21:39:55 +03:00
erhant 47371c8e92 feat(fees): cycle-count metering for public execution 2026-08-24 21:39:55 +03:00
erhant 2d0bb83122 feat(fees): embed Option<FeeDeclaration> on the message, drop the fee-witness 2026-08-24 21:38:26 +03:00
erhant dc471f0e2d chore(lee): destruct on Debug impl for Message 2026-08-21 17:25:47 +03:00
erhant a0a8e3b805 fix(fees): use Gas/Fee aliases for message gas_limit/tip 2026-08-21 15:05:48 +03:00
erhant 84c798935c fix(fees): #750 team review — FeeDeclaration rename, max_fee Balance, destructure guard, doc/expect trims 2026-08-21 14:56:08 +03:00
erhant 8c10506637 fix(fees): review fixes — signing-only fee payer and fee-witness round-trip 2026-08-21 14:56:08 +03:00
erhant 390abe2ffb feat(fees): fee fields and payer authorization on the wire format 2026-08-21 14:56:08 +03:00
erhant 1a0a03c908 refactor(fees): centralize Fee/Gas unit aliases in lee_core 2026-08-21 14:54:14 +03:00
agureev 1f7a4c4162 doc: fix typo 2026-08-10 12:32:57 +04:00
Artem Gureev 5a1524dcb9 refactor(lee): update stale domain for keytree parent 2026-08-07 17:13:41 +04: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
Artem Gureev fc8f7f2d42 refactor(lee): verbose key domains and the ask key chain 2026-08-07 10:40:04 +00: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
Roman 54743142e9 test: bridge guard account flags modification 2026-07-31 17:56:00 -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 0659774e43 chore(state_machine); rename get_public_account to get_account_by_id_ref [skip ci] 2026-07-30 14:23:49 +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
Artem Gureev 75326d031a refactor(verifier): consume bundled public_actions directly 2026-07-29 18:18:08 +00:00
Artem Gureev f16c3bd1e2 refactor: bundle private/public i/o into action struccts 2026-07-29 18:16:13 +00:00
Artem Gureev 7a80ab026d refactor!(lee_core): bump the note-encryption KDF domain to v0.3
BREAKING!

Before: note encryption KDF used 0.2 tag

After: now uses 0.3 tag

Mitigation: cipher keygen needs to utilize 0.3 tag after this commit
2026-07-28 16:13:14 +04:00
Artem Gureev 626ba01449 test: order-independent output assertions + wrong-nullifier decrypt 2026-07-28 11:13:19 +00:00
Artem Gureev 590ad2b53c test(circuit): assert obfuscate_output_ordering sorts and keeps notes paired 2026-07-28 11:12:21 +00:00
Artem Gureev e282ef30e1 refactor(circuit): extract obfuscate_output_ordering 2026-07-28 11:10:23 +00:00
Artem Gureev 29ee254322 feat!: byte-sort private outputs to obfuscate note order
BREAKING!

Before: Commitments, nullifier, and ciphertexts of a transaction were
position-aligned. The position revealed which nullifier was hiding a
pre-state to a commitment to which post-state. Similarly with
ciphertexts.

After: The nullifier-cipher connection remains, but now they (and
commitments independently) are shuffled by the byte-order of the
hashes.

Mitigation: Expect the circuit outputs to be jumbled.
2026-07-28 11:09:44 +00:00
Artem Gureev e13b4cb237 feat!: key note encryption on the nullifier, drop the output index
BREAKING!

Before: The ciphertext key got generated via using the commmitment and
its index as the key.

After: The ciphertext key replaces the commitment dependence by a
nullifier dependence, still making the key unique by global state. The
nullifier is assumed to be the nullifier of the pre-state of the account.

Mitigation: Use the new decryption algorithm.
2026-07-28 11:09:28 +00:00
Artem Gureev a9f492bb3f refactor(lee_core): expose nullifier byte-array 2026-07-28 10:58:57 +00:00
Artem Gureev 2e8a01ac95 refactor: warn on private-padding saturation and rename to execute_and_prove_with_padded_inputs 2026-07-24 17:00:36 +00:00
Artem Gureev 2999288a57 test(lee): pin for_dummy nullifier and commitment derivations 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
Artem Gureev 4ba0268bab feat(wallet): construct and submit dummy inputs
Ciphers submitted currently have no data
2026-07-24 16:36:13 +00:00
Artem Gureev 5d13e0acc5 feat(circuit): use dummy_inputs in ppc 2026-07-24 16:36:13 +00:00
Artem Gureev 31a17d74a3 feat(lee): add for_dummy nullifier and commitment derivations 2026-07-24 16:36:13 +00:00
Artem Gureev b9c03d3805 feat(lee): add dummy account type for function-privacy padding 2026-07-24 16:36:13 +00: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 dc977db7ab refactor: destructure genesis fingerprint and return an iterator from bridge_lock_holdings 2026-07-23 21:55:55 +02:00
jonesmarvin8 7bc4c460a2 fix!(state_machine): reject public transactions that silently drop a d… (#625)
* fix(state_machine): reject public transactions that silently drop a declared account

ValidatedStateDiff::from_public_transaction never checked that the accounts
touched in a program's output matched the caller-declared message.account_ids
— it just folded whatever pairs the program returned into the diff. A program
(or a macro-generated dispatcher wrapping one) that silently drops an account
from both sides of its own output together stays internally consistent
(pre_states.len() == post_states.len()) and passes validate_execution's
existing checks, so the dropped account simply vanishes with no error.

Add a check after the chained-call loop: every account_id in
message.account_ids must appear in the final state_diff, or the transaction is
rejected with the new DeclaredAccountMissingFromOutput error.

Add a dropped_account test-guest program that reproduces the exact shape of
the bug (two pre_states in, one consistent (pre, post) pair out) and a
regression test proving the transaction is now rejected. Verified the test
fails with Ok(()) when the check is removed, and passes once it's restored.

* style: tighten comments and apply nightly rustfmt

Condense the explanatory comments on the new account-accounting check and the
dropped_account test guest, and fix imprecise wording (the account is dropped
from both pre_state and post_states together, not just pre_state). Also
applies cargo +nightly fmt's wrapping of the new error message.

* chore: regenerate test fixture after rebase onto dev
2026-07-23 12:09:16 -04: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
moudyellaz 72195ce09e Merge origin/dev 2026-07-23 02:43:53 +02:00
Artem Gureev 3474b375e4 test(circuit): view_tag is derived on init, passed through on update 2026-07-22 22:31:32 +04:00
agureev 61cad70f9b feat(circuit): supply a view_tag on private-account updates 2026-07-22 22:31:31 +04: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 0f88fda054 Merge origin/dev 2026-07-16 12:44:07 +02:00
Pravdyvy ba741da37b Merge branch 'dev' into Pravdyvy/multi-sequencer-client 2026-07-15 13:45:44 +03:00