feat(lee): anchor privacy-circuit image ids and migrate all programs to Deploy

Privacy-preserving circuit:
- Add ProgramImageClaim, letting a Deploy-created program's real image_id be
  anchored to its account for privacy-circuit env::verify, with the sequencer
  independently re-deriving the real image_id via get_program to authenticate
  the claim (journal reconstruction, same pattern as public_actions pre-states).
- Fix compute_public_authorized_pdas and the private circuit's
  resolve_authorization_and_record_bindings to use the caller's real recovered
  image_id instead of bijection-guessing it from the caller's account_id, which
  was wrong for Deploy-created callers.

Program storage:
- V03State::insert_program (used by both genesis's with_programs and live
  ProgramDeploymentTransaction execution) now always writes the Deploy
  two-account shape (ProgramData header + segment), not the legacy
  PROGRAM_STORAGE_OWNER raw-elf shape. The header stays at the existing
  bijection address so no dispatch-address reference needed to change; only
  the segment (never a caller-facing address) moves to its PDA.
- Drop the now-redundant ProgramAlreadyExists pre-check in
  ProgramDeploymentTransaction validation; PDA claiming already prevents
  redeploying an account.
- Migrate remaining tests off ProgramDeploymentTransaction onto native Deploy
  (sequencer_core, integration_tests' auth_transfer and block_size_limit),
  adding a shared deploy_targets/deploy_transaction/encoded_tx_size helper.

Rebuild artifacts and the prebuilt test fixture for the circuit and program
storage changes.
This commit is contained in:
Marvin Jones
2026-08-22 19:38:51 -04:00
parent 3c1e30f2cf
commit 152152ccca
42 changed files with 954 additions and 495 deletions
@@ -1,8 +1,7 @@
use std::collections::HashMap;
use lee::{
AccountId, ProgramId, privacy_preserving_transaction::circuit::ProgramWithDependencies,
program::Program,
AccountId, privacy_preserving_transaction::circuit::ProgramWithDependencies, program::Program,
};
use wallet::{AccountIdentity, WalletCore};
@@ -47,8 +46,8 @@ async fn main() {
let simple_tail_call = Program::new(simple_tail_call_bytecode.into()).unwrap();
let hello_world_bytecode: Vec<u8> = std::fs::read(hello_world_path).unwrap();
let hello_world = Program::new(hello_world_bytecode.into()).unwrap();
let dependencies: HashMap<ProgramId, Program> =
std::iter::once((hello_world.id(), hello_world)).collect();
let dependencies: HashMap<AccountId, Program> =
std::iter::once((hello_world.id().into(), hello_world)).collect();
let program_with_dependencies = ProgramWithDependencies::new(simple_tail_call, dependencies);
let accounts = vec![AccountIdentity::PrivateOwned(account_id)];