From 53612cebf2bcb4e733c1022885d16e6ae512db62 Mon Sep 17 00:00:00 2001 From: Artem Gureev Date: Mon, 24 Aug 2026 18:41:48 +0000 Subject: [PATCH] chore: docs --- lee/state_machine/core/src/program/mod.rs | 2 +- lee/state_machine/src/validated_state_diff/mod.rs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lee/state_machine/core/src/program/mod.rs b/lee/state_machine/core/src/program/mod.rs index 08e112743..a05e58c0f 100644 --- a/lee/state_machine/core/src/program/mod.rs +++ b/lee/state_machine/core/src/program/mod.rs @@ -843,7 +843,7 @@ pub fn validate_execution( Ok(()) } -/// Logic of system-wide `Clear` instriction. +/// Logic of system-wide `Clear` instruction. /// /// Checks authorization, clearing data and assigning a new owner. pub fn validate_clear( diff --git a/lee/state_machine/src/validated_state_diff/mod.rs b/lee/state_machine/src/validated_state_diff/mod.rs index 4b35385fe..8c7140d53 100644 --- a/lee/state_machine/src/validated_state_diff/mod.rs +++ b/lee/state_machine/src/validated_state_diff/mod.rs @@ -129,6 +129,9 @@ impl ValidatedStateDiff { match instruction { SystemInstruction::Clear { new_owner } => { + // Only the `account_id` is read from `chained_call.pre_states`; the + // account and its authorization are re-derived below, so a forged + // pre_state grants nothing (cf. the audit-issue 91 note further down). for pre_state in &chained_call.pre_states { let account_id = pre_state.account_id; let pre = AccountWithMetadata::new(