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 <noreply@anthropic.com>
This commit is contained in:
Marvin Jones
2026-08-22 17:39:23 -04:00
co-authored by Claude Sonnet 5
parent bef0edf294
commit 96f2bc1be0
4 changed files with 1 additions and 31 deletions
-15
View File
@@ -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<AccountId> 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,
-4
View File
@@ -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<AccountId, Account>,
private_state: (CommitmentSet, NullifierSet),
}
@@ -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}"))
-5
View File
@@ -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,