Commit Graph
11 Commits
Author SHA1 Message Date
Marvin Jones 172c58324e feat(lee): construct chained-call pre-states from protocol state (incremental update PR4)
ChainedCall.pre_states: Vec<AccountWithMetadata> becomes
pre_state_refs: Vec<AccountId>. A calling program no longer supplies
the concrete account value (or an is_authorized claim) for an account
it hands to a chained call — it only names which account, and the
protocol (sequencer for public transactions, host driver for
privacy-preserving ones) resolves the real, currently-tracked value
itself before invoking the callee.

This removes two things simultaneously: the burden on guest programs
to predict another call's outcome before it happens (the calling
program previously had no reliable way to know it), and the ability
to supply a stale or entirely fabricated account value at all. The
malicious_injector/malicious_launderer guest programs and
malicious_authorization_changer, which existed specifically to
demonstrate that forgery, are deleted — the attack they showed is now
a compile-time impossibility rather than something caught after the
fact by a runtime check.

The privacy circuit itself (execution_state.rs) needed no logic
changes: it never trusted a caller-supplied pre-state in the first
place, only the callee's own proven echo against its internally
tracked state. The public path already had the tracking map it
needed (state_diff); the privacy host driver gained one
(materialized_state), plus first-sighting position tracking so a
chained call's private-PDA authorization can be verified the same
way the circuit derives it internally.

Regenerates all lee_core/lez guest artifacts and the prebuilt
sequencer db fixture via `just build-artifacts`, required since
ChainedCall's shape is part of the proven wire format.
2026-08-22 15:19:55 -04:00
Marvin Jones 15dbd6f1a6 chore(lez,lee): fix clippy pedantic/nursery/restriction findings
Resolves needless_pass_by_value (take AccountWithMetadata/Account by
reference where only borrowed), unnecessary_wraps (drop Result<Data,
Infallible> from passthrough update_from_diff implementations),
missing_const_for_fn, useless_let_if_seq, arbitrary_source_item_ordering,
too_many_arguments, redundant_clone, and useless_conversion across the
guest programs and lee core touched by the incremental-updates rebase.
2026-08-22 02:03:43 -04:00
jonesmarvin8 b676c6c360 chore(lee,lez): fix pre-existing rustfmt violations (#776)
marvin/incremental-updates-2 was not cargo +nightly fmt --check clean;
these files had drifted since the last fmt pass (mostly unwrapped
long import lists). No functional changes.
2026-08-22 01:23:17 -04:00
Marvin Jones 687cc211f9 fix(lez): update programs for diff_data's move to Data
Rebasing onto marvin/incremental-updates-1's AccountDiff.diff_data:
Option<Data> change (was Option<Vec<u8>>) needed real fixes, not just a
mechanical rebase: every program's update_from_diff and every
diff_data-constructing call site was still written against the old
Vec<u8> shape. Several sites were doing a pointless Data -> Vec<u8> ->
Data round trip to satisfy the old field type; those now just pass the
Data value straight through. The host-side
execute_update_from_diff/prove_update_from_diff/write_update_from_diff_inputs
in lee/state_machine move to Data too, matching what now flows from
lee_core.
2026-08-22 01:22:31 -04:00
Marvin Jones e43611c7cc feat(lee): wire programs to diff-native execution (incremental update PR2)
Programs now report AccountDiff/AccountDiffOutput instead of full
post-states; balance changes are applied via apply_balance_diff's
checked arithmetic at the protocol level rather than checked in-guest,
and data changes are materialized through a new update_from_diff
guest entrypoint (trusted execution for public transactions, proven
via a recursive receipt for the privacy-preserving circuit). All 15
production programs and test/example guest programs are converted;
attack-surface guest programs that are now structurally impossible
(nonce/program_owner mutation) or redundant (manual balance-sufficiency
bypass) are moved to a dormant/ directory rather than deleted outright.
2026-08-22 01:15:25 -04:00
moudyellaz 968a17f867 Merge remote-tracking branch 'origin/dev' into moudy/cross-zone-target-auth
# Conflicts:
#	Cargo.lock
#	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-19 23:40:53 +02:00
agureev c77313b5ca fix(lee): check private PDA authorization on first sight 2026-08-17 17:23:39 +00:00
moudyellaz 073c9baa2d perf(lez)!: borrow account data in the guests instead of cloning
BREAKING CHANGE: six guest image ids move.
2026-08-16 23:41:00 +02:00
Daniil Polyakov f91d0da8e1 refactor(sequencer): add test for mempool and bring back standalone feature 2026-08-12 22:50:50 +03:00
moudyellaz 44acb4ba73 feat(cross-zone)!: let the authority act through a configured governance program
BREAKING CHANGE: WrappedTokenConfig and ReceiverConfig gain a governance field and CrossZoneConfig gains source_governance, so the config layouts change and every program image id moves.
2026-08-12 15:44:29 +02:00
Daniil Polyakov d3e507f25d refactor!(artifacts): keep lee and lez artifacts separated 2026-06-24 18:10:41 +03:00