From 96f2bc1be08f10548281c469aed8238eb0dd9da0 Mon Sep 17 00:00:00 2001 From: Marvin Jones Date: Sat, 15 Aug 2026 23:24:11 -0400 Subject: [PATCH] docs(lee): trim redundant doc comments across program-as-account changes Removed explanatory comments that restated context better left to commit history/PR description across the deploy-dispatch and program-storage code. Co-Authored-By: Claude Sonnet 5 --- lee/state_machine/core/src/program/mod.rs | 15 --------------- lee/state_machine/src/state/mod.rs | 4 ---- lee/state_machine/src/validated_state_diff/mod.rs | 8 +------- lez/programs/loader/core/src/lib.rs | 5 ----- 4 files changed, 1 insertion(+), 31 deletions(-) diff --git a/lee/state_machine/core/src/program/mod.rs b/lee/state_machine/core/src/program/mod.rs index 2043321a1..aeab6597b 100644 --- a/lee/state_machine/core/src/program/mod.rs +++ b/lee/state_machine/core/src/program/mod.rs @@ -19,21 +19,6 @@ pub const DEFAULT_PROGRAM_OWNER: AccountId = AccountId::new([0; 32]); /// `program_owner` for program `Account`s. pub const PROGRAM_STORAGE_OWNER: AccountId = AccountId::new([0xFF; 32]); -/// Reserved `AccountId` for the native "Deploy" dispatch shortcut. -/// -/// `SHA256(domain_separator || label)`, where `domain_separator` is -/// `/LEE/v0.3/AccountId/State/` and `label` is `DeploymentProgram`, each padded with trailing -/// zero bytes to 32 bytes before concatenation — the same domain-separation construction used -/// throughout this module, just with no variable input, since this is a single fixed address -/// rather than a per-caller derivation. -/// -/// Dispatch recognizes this exact `AccountId` and runs the deploy logic as native Rust instead -/// of interpreting a guest ELF: computing a program's image id inside the zkVM costs roughly -/// 1,400-1,500 cycles per byte of deployed bytecode (measured against every real program in -/// this repo), pushing a real deployment to 500M-900M cycles against the 32M public-execution -/// cap, whereas the equivalent native computation costs low tens of milliseconds. A caller -/// targeting this address converts it to the `ProgramId` a `Message`/`ChainedCall` expects via -/// the existing `From for ProgramId` bijection. pub const RESERVED_DEPLOYMENT_PROGRAM_ACCOUNT_ID: AccountId = AccountId::new([ 89, 158, 44, 108, 43, 137, 255, 57, 188, 48, 148, 179, 39, 111, 31, 202, 167, 23, 56, 0, 167, 29, 152, 150, 161, 186, 155, 209, 69, 138, 145, 201, diff --git a/lee/state_machine/src/state/mod.rs b/lee/state_machine/src/state/mod.rs index 32b085ef0..814315efa 100644 --- a/lee/state_machine/src/state/mod.rs +++ b/lee/state_machine/src/state/mod.rs @@ -112,10 +112,6 @@ impl BorshDeserialize for NullifierSet { #[derive(Clone, PartialEq, Eq, BorshSerialize, BorshDeserialize)] #[cfg_attr(test, derive(Debug))] pub struct V03State { - /// Deployed programs live here too, as `Account`s keyed by `AccountId::from(program_id)` - /// (see that impl's doc comment), with the elf held in `Account.data` and `program_owner` - /// set to the reserved `PROGRAM_STORAGE_OWNER` (see its doc comment for why that ownership - /// choice is load-bearing now that these accounts are reachable via ordinary dispatch). public_state: HashMap, private_state: (CommitmentSet, NullifierSet), } diff --git a/lee/state_machine/src/validated_state_diff/mod.rs b/lee/state_machine/src/validated_state_diff/mod.rs index 25d1dbf5a..bb174b82a 100644 --- a/lee/state_machine/src/validated_state_diff/mod.rs +++ b/lee/state_machine/src/validated_state_diff/mod.rs @@ -128,13 +128,7 @@ impl ValidatedStateDiff { let mut program_output = if chained_call.program_account_id == RESERVED_DEPLOYMENT_PROGRAM_ACCOUNT_ID { - // Runs `Deploy` as native Rust instead of interpreting a guest ELF — see - // `RESERVED_DEPLOYMENT_PROGRAM_ACCOUNT_ID`'s doc comment for why. - // - // `execute_deploy` validates its input via `assert!`/`.expect(...)`, exactly - // like every guest program in this codebase, relying here on `catch_unwind` to - // play the same role the zkVM executor plays for a real guest: converting a - // rejected input into a graceful `Err` instead of unwinding past this call. + // Runs `Deploy` as native Rust instead of interpreting a guest ELF. let loader_core::Instruction::Deploy { bytecode } = risc0_zkvm::serde::from_slice(&chained_call.instruction_data).map_err(|e| { LeeError::InvalidInput(format!("invalid Deploy instruction: {e}")) diff --git a/lez/programs/loader/core/src/lib.rs b/lez/programs/loader/core/src/lib.rs index daab23fa6..25968a5fe 100644 --- a/lez/programs/loader/core/src/lib.rs +++ b/lez/programs/loader/core/src/lib.rs @@ -88,11 +88,6 @@ pub fn deploy_account_id( /// Executes the `Deploy` instruction: verifies `bytecode` decodes as a valid RISC0 program /// binary, derives its `ProgramData` PDA, and claims it. -/// -/// Shared, target-independent logic: called both from the guest binary (`loader_program`) and, -/// natively, from dispatch's `RESERVED_DEPLOYMENT_PROGRAM_ACCOUNT_ID` shortcut (see that -/// constant's doc comment in `lee_core::program`) — the two must stay identical, so this is the -/// single implementation both wrap around. #[must_use] pub fn execute_deploy( self_program_id: ProgramId,