Commit Graph
64 Commits
Author SHA1 Message Date
Moudy cf699fde7c refactor: rename private_pda_spender to auth_transfer_proxy 2026-05-08 18:18:40 +02:00
Moudy 4ace6e1570 fix: address review feedback 2026-05-07 22:48:32 +02:00
Moudy f73cd6738f refactor: delegate to auth-transfer, add shared account test 2026-05-06 14:22:50 +02:00
Moudy f375a35929 fix: address PR review feedback
- Add SealingPublicKey/SealingSecretKey type aliases for seal_for/unseal
- Generalize PrivateGroupPda to PrivatePda with pre-resolved keys
- Rename group_pda_spender to private_pda_spender
- Rename group_pda_accounts to pda_accounts with serde alias
- Remove unused storage_mut()
- Remove stale group_pda_router.bin artifact
2026-04-30 09:11:08 +02:00
Moudy 5b9cf95c47 feat: add group PDA test program, unit tests, and integration test 2026-04-27 02:44:16 +02:00
Moudy 68d43d7f2b test: exercise callee authorization in private-PDA delegation tests
Addresses the following review comments:

- "Shouldn't we use a program that checks authorization in this test as
  callee? If not, I'm not sure if we are fully testing what the test
  docs describe (namely, that the callee got the input account with
  is_authorized=true). Maybe add a variant of the noop that checks the
  input account is authorized."
  I added test_program_methods/guest/src/bin/auth_asserting_noop.rs:
  same shape as noop.rs except it asserts pre.is_authorized == true for
  every pre_state before echoing the post_states. Any unauthorized
  pre_state panics the guest, failing the whole circuit proof. I added
  Program::auth_asserting_noop() as the matching helper. In
  caller_pda_seeds_authorize_private_pda_for_callee and
  caller_pda_seeds_with_wrong_seed_rejects_private_pda_for_callee, I
  swapped Program::noop() for Program::auth_asserting_noop() as the
  callee. The positive test now proves the callee actually sees
  is_authorized=true, not just that the circuit's consistency check did
  not reject. The negative test doubles its evidence, both the
  circuit's authorization reconciliation and the callee guest would now
  reject a wrong-seed delegation.

- "This branching logic is only correct because we are not supporting
  non-authorized private accounts with non-default values. Likely to be
  changed in the future. I'm sure there's use cases for this. For
  example the multisig program if ran completely private it would need
  a private non-default and non-authorized input account."
  Agreed. Supporting this needs wallet-supplied `(seed, owner)` side
  input so the npk-to-account_id binding can be re-verified for an
  existing private PDA without a fresh Claim::Pda or a caller
  pda_seeds match. I handled this in the second PR. I added a
  TODO(private-pdas-pr-2/3) marker on the `else` branch in
  privacy_preserving_circuit.rs:3 => { ... } so the constraint is
  visible to future maintainers, along with a comment noting the
  multisig use case.
2026-04-21 02:08:02 +02:00
Moudy d3577f02bc fix: reject multiple family members under same (program, seed) in one tx 2026-04-17 15:36:20 +02:00
Moudy f9a5a7635e refactor: make programs privacy-agnostic in the privacy circuit 2026-04-17 07:29:40 +02:00
Moudy 526c3cd978 test: add private PDA circuit tests and two guest programs 2026-04-16 18:07:32 +02:00
Moudy bda21fb5c5 refactor: move private PDA npk into proven ChainedCall and Claim 2026-04-16 16:53:54 +02:00
Moudy a87e8d93dc fix: cargo fmt 2026-04-07 20:16:42 +02:00
Moudy 56ee93b5b7 merge main into feat-caller-program-id-and-flash-swap 2026-04-07 19:44:55 +02:00
Moudy b22a989fbc merge main into feat-caller-program-id-and-flash-swap 2026-04-07 19:27:27 +02:00
Moudy 7d465dded7 fix: verify caller_program_id in program output 2026-04-07 19:03:06 +02:00
Moudy 495680e2ea update test guest programs with caller_program_id in ProgramOutput 2026-04-07 17:54:59 +02:00
Sergio Chouhy d9ddd5e3f6 fix docs. refactor sequencer logic to check size before executing 2026-04-06 21:07:55 -03:00
Sergio Chouhy ed1926b38a use Timestamp instead of u64 2026-04-06 13:21:39 -03:00
Sergio Chouhy 015999b3a5 add clock usage example programs 2026-04-04 00:23:43 -03:00
Moudy cc8e82278b fix: add backticks in callback doc comment 2026-04-04 00:20:42 +02:00
Moudy 324750e618 fix: remove unfulfilled large_enum_variant expect, add backticks in docs, rebuild artifacts 2026-04-04 00:04:40 +02:00
Moudy 032f6b8906 fix: use AccountId::new instead of From<ProgramId>, apply formatting 2026-04-03 23:24:13 +02:00
moudyellaz 1d0c93e9cf test: verify malicious self_program_id is rejected in public execution 2026-04-03 22:13:58 +02:00
Moudy 3cfc74695b fix: compute intermediate states inside flash swap programs 2026-04-03 22:05:49 +02:00
Moudy c85f19fe85 fix: clippy lints in flash swap guest programs 2026-04-03 20:16:59 +02:00
Moudy bc0583368d fix: set is_authorized on PDA accounts in flash swap chained calls 2026-04-03 15:18:23 +02:00
Moudy 74e16db68f fix: apply formatting and rebuild artifacts 2026-04-03 01:17:42 +02:00
moudyellaz 38ea2a01fa feat: add flash_swap_initiator and flash_swap_callback guest programs 2026-04-03 00:58:11 +02:00
moudyellaz 087baebcca feat: add caller_program_id to ProgramInput 2026-04-03 00:58:11 +02:00
Sergio Chouhy 4d5010f044 Merge branch 'main' into schouhy/add-block-context-system-accounts 2026-04-02 19:48:55 -03:00
Sergio Chouhy 29d66d2c2d small refactor 2026-04-02 17:40:58 -03:00
Moudy 702ef4a46f fix: cargo fmt 2026-04-02 20:30:27 +02:00
moudyellaz 7def0c4664 refactor: pass self_program_id to ProgramOutput in test and example guest programs 2026-04-02 20:30:16 +02:00
Moudy 59d3d38448 fix: serialize write_inputs fields separately to match guest deserialization 2026-04-02 20:29:12 +02:00
moudyellaz 9ecf186851 refactor: update all guest programs to handle self_program_id field 2026-04-02 20:29:10 +02:00
Sergio Chouhy eb14b8bf98 clippy 2026-03-31 13:51:12 +02:00
Sergio Chouhy 99f0ed03dc add type aliases 2026-03-31 13:50:06 +02:00
Sergio Chouhy 27b0ba7592 add tests for timestamp validity windows 2026-03-31 13:49:37 +02:00
Sergio Chouhy 9aa7caf3bf refactor validity window with generic 2026-03-31 13:49:12 +02:00
moudyellaz 5c592312f9 feat: extend ValidityWindow with Unix timestamp bounds 2026-03-31 13:46:08 +02:00
Daniil Polyakov 6780f1c9a4 feat: protect from public pda griefing attacks 2026-03-28 01:23:57 +03:00
Sergio Chouhy e618e08bdc use validity window as intstruction type in test programs 2026-03-26 18:10:31 -03:00
Sergio Chouhy 70ccb1befa add constructors from ranges 2026-03-25 17:42:17 -03:00
Sergio Chouhy 953a1dacd3 clippy 2026-03-25 17:35:10 -03:00
Sergio Chouhy 79d70b3a66 add test for empty intersection in circuit 2026-03-25 17:33:27 -03:00
Sergio Chouhy abc30c0ce0 remove old program output constructors 2026-03-25 16:56:04 -03:00
Sergio Chouhy 3257440448 enforce valid window construction 2026-03-20 13:49:17 -03:00
Sergio Chouhy a069004451 add validity window checks on privacy preserving transactions 2026-03-19 18:32:54 -03:00
jonesmarvin8 8dd5037e28 Merge branch 'main' into marvin/nonce 2026-03-17 16:45:08 -04:00
Daniil Polyakov 252848a145 feat: update rust to 1.94.0 2026-03-17 21:25:30 +03:00
Daniil Polyakov aa462b66eb feat: add nursery clippy lints 2026-03-17 21:25:30 +03:00