From cb41fa7918d21cfa5ebd6d78dae83db9b4ddd922 Mon Sep 17 00:00:00 2001 From: Marvin Jones Date: Thu, 20 Aug 2026 12:26:54 -0400 Subject: [PATCH] docs(lez): drop repeated update_from_diff passthrough comment The same "diff_data is already the fully-computed encoding, so this is a passthrough" explanation was copy-pasted across 13 update_from_diff implementations. The general contract is already documented once, centrally, on ProgramCall::UpdateFromDiff in lee_core; each per-program repeat added nothing beyond what the unused _pre_state parameter and a one-line body already convey. --- .../test_methods/guest/src/bin/changer_claimer.rs | 2 -- lee/state_machine/test_methods/guest/src/bin/data_changer.rs | 2 -- lez/programs/amm/src/lib.rs | 3 --- lez/programs/bridge_lock/src/main.rs | 3 --- lez/programs/cross_zone_inbox/src/main.rs | 3 --- lez/programs/cross_zone_outbox/src/main.rs | 2 -- lez/programs/pinata/src/main.rs | 2 -- lez/programs/pinata_token/src/main.rs | 2 -- lez/programs/ping_receiver/src/main.rs | 3 --- lez/programs/ping_sender/src/main.rs | 3 --- lez/programs/sequencer_stake/src/main.rs | 3 --- lez/programs/token/src/lib.rs | 3 --- lez/programs/wrapped_token/src/main.rs | 3 --- 13 files changed, 34 deletions(-) diff --git a/lee/state_machine/test_methods/guest/src/bin/changer_claimer.rs b/lee/state_machine/test_methods/guest/src/bin/changer_claimer.rs index 56cfdbf9c..72c8b5c37 100644 --- a/lee/state_machine/test_methods/guest/src/bin/changer_claimer.rs +++ b/lee/state_machine/test_methods/guest/src/bin/changer_claimer.rs @@ -64,8 +64,6 @@ fn main() { .write(); } -/// The new data value, when written, is always a fully-computed byte blob assigned directly, so -/// materializing it from `diff_data` is a passthrough. fn update_from_diff( _pre_state: Account, diff_data: Data, diff --git a/lee/state_machine/test_methods/guest/src/bin/data_changer.rs b/lee/state_machine/test_methods/guest/src/bin/data_changer.rs index 99bde8bf4..b3fcb6975 100644 --- a/lee/state_machine/test_methods/guest/src/bin/data_changer.rs +++ b/lee/state_machine/test_methods/guest/src/bin/data_changer.rs @@ -57,8 +57,6 @@ fn main() { .write(); } -/// The new data value is always a fully-computed byte blob assigned directly, so materializing -/// it from `diff_data` is a passthrough. fn update_from_diff( _pre_state: Account, diff_data: Data, diff --git a/lez/programs/amm/src/lib.rs b/lez/programs/amm/src/lib.rs index 15e809eea..28accadc5 100644 --- a/lez/programs/amm/src/lib.rs +++ b/lez/programs/amm/src/lib.rs @@ -34,9 +34,6 @@ pub fn unchanged(account_id: AccountId) -> AccountDiffOutput { }) } -/// Every data write in this program (always the pool account) replaces its data wholesale with -/// an already-fully-computed `PoolDefinition` encoding, so `diff_data` already *is* the new data -/// verbatim — materializing it is a passthrough. pub fn update_from_diff(_pre_state: Account, diff_data: Data) -> Result { Ok(diff_data) } diff --git a/lez/programs/bridge_lock/src/main.rs b/lez/programs/bridge_lock/src/main.rs index e64c69b50..b4c3e8c37 100644 --- a/lez/programs/bridge_lock/src/main.rs +++ b/lez/programs/bridge_lock/src/main.rs @@ -14,9 +14,6 @@ use lee_core::{ }; use wrapped_token_core::{Instruction as WrappedInstruction, MAX_MINT_AMOUNT}; -/// Every data write in this program replaces the account's data wholesale with an -/// already-fully-computed encoding, so `diff_data` already *is* the new data verbatim — -/// materializing it is a passthrough. fn update_from_diff(_pre_state: Account, diff_data: Data) -> Result { Ok(diff_data) } diff --git a/lez/programs/cross_zone_inbox/src/main.rs b/lez/programs/cross_zone_inbox/src/main.rs index a988124bc..2f4552c82 100644 --- a/lez/programs/cross_zone_inbox/src/main.rs +++ b/lez/programs/cross_zone_inbox/src/main.rs @@ -13,9 +13,6 @@ use lee_core::{ }, }; -/// Every data write in this program replaces the account's data wholesale with an -/// already-fully-computed encoding, so `diff_data` already *is* the new data verbatim — -/// materializing it is a passthrough. fn update_from_diff(_pre_state: Account, diff_data: Data) -> Result { Ok(diff_data) } diff --git a/lez/programs/cross_zone_outbox/src/main.rs b/lez/programs/cross_zone_outbox/src/main.rs index 91555c7c7..73ffd4fee 100644 --- a/lez/programs/cross_zone_outbox/src/main.rs +++ b/lez/programs/cross_zone_outbox/src/main.rs @@ -9,8 +9,6 @@ use lee_core::{ }, }; -/// The record is fully computed before being written, so `diff_data` already *is* the new data -/// verbatim — materializing it is a passthrough. fn update_from_diff(_pre_state: Account, diff_data: Data) -> Result { Ok(diff_data) } diff --git a/lez/programs/pinata/src/main.rs b/lez/programs/pinata/src/main.rs index 22203fdb7..1da726742 100644 --- a/lez/programs/pinata/src/main.rs +++ b/lez/programs/pinata/src/main.rs @@ -113,8 +113,6 @@ fn main() { .write(); } -/// The challenge's next-data is fully computed before being written, so `diff_data` already *is* -/// the new data verbatim — materializing it is a passthrough. fn update_from_diff(_pre_state: Account, diff_data: Data) -> Result { Ok(diff_data) } diff --git a/lez/programs/pinata_token/src/main.rs b/lez/programs/pinata_token/src/main.rs index 714203faf..96b1d155c 100644 --- a/lez/programs/pinata_token/src/main.rs +++ b/lez/programs/pinata_token/src/main.rs @@ -136,8 +136,6 @@ fn main() { .write(); } -/// The challenge's next-data is fully computed before being written, so `diff_data` already *is* -/// the new data verbatim — materializing it is a passthrough. fn update_from_diff(_pre_state: Account, diff_data: Data) -> Result { Ok(diff_data) } diff --git a/lez/programs/ping_receiver/src/main.rs b/lez/programs/ping_receiver/src/main.rs index 550bac01e..bc3587e57 100644 --- a/lez/programs/ping_receiver/src/main.rs +++ b/lez/programs/ping_receiver/src/main.rs @@ -13,9 +13,6 @@ use ping_core::{ receiver_config_account_id, receiver_config_seed, }; -/// Every data write in this program replaces the account's data wholesale with an -/// already-fully-computed encoding, so `diff_data` already *is* the new data verbatim — -/// materializing it is a passthrough. fn update_from_diff(_pre_state: Account, diff_data: Data) -> Result { Ok(diff_data) } diff --git a/lez/programs/ping_sender/src/main.rs b/lez/programs/ping_sender/src/main.rs index 4ac6eb783..1b0a4ed05 100644 --- a/lez/programs/ping_sender/src/main.rs +++ b/lez/programs/ping_sender/src/main.rs @@ -12,9 +12,6 @@ use ping_core::{ SenderInstruction, outbox_bytes, read_outbox, sender_config_account_id, sender_config_seed, }; -/// Every data write in this program replaces the account's data wholesale with an -/// already-fully-computed encoding, so `diff_data` already *is* the new data verbatim — -/// materializing it is a passthrough. fn update_from_diff(_pre_state: Account, diff_data: Data) -> Result { Ok(diff_data) } diff --git a/lez/programs/sequencer_stake/src/main.rs b/lez/programs/sequencer_stake/src/main.rs index b56a8c816..46c99c58c 100644 --- a/lez/programs/sequencer_stake/src/main.rs +++ b/lez/programs/sequencer_stake/src/main.rs @@ -97,9 +97,6 @@ fn main() { .write(); } -/// Every data write in this program replaces the account's data wholesale with an -/// already-fully-computed encoding (`StakeRecord`/`SequencerStakeConfig` bytes), so `diff_data` -/// already *is* the new data verbatim — materializing it is a passthrough. fn update_from_diff(_pre_state: Account, diff_data: Data) -> Result { Ok(diff_data) } diff --git a/lez/programs/token/src/lib.rs b/lez/programs/token/src/lib.rs index 0ae02c6a6..781aebfac 100644 --- a/lez/programs/token/src/lib.rs +++ b/lez/programs/token/src/lib.rs @@ -15,9 +15,6 @@ pub mod transfer; mod tests; -/// Every data write in this program replaces the account's data wholesale with an -/// already-fully-computed encoding (`TokenDefinition`/`TokenHolding`/`TokenMetadata`), so -/// `diff_data` already *is* the new data verbatim — materializing it is a passthrough. pub fn update_from_diff(_pre_state: Account, diff_data: Data) -> Result { Ok(diff_data) } diff --git a/lez/programs/wrapped_token/src/main.rs b/lez/programs/wrapped_token/src/main.rs index 4116e3313..72fa03e81 100644 --- a/lez/programs/wrapped_token/src/main.rs +++ b/lez/programs/wrapped_token/src/main.rs @@ -13,9 +13,6 @@ use wrapped_token_core::{ config_seed, holding_account_id, holding_seed, read_balance, }; -/// Every data write in this program replaces the account's data wholesale with an -/// already-fully-computed encoding, so `diff_data` already *is* the new data verbatim — -/// materializing it is a passthrough. fn update_from_diff(_pre_state: Account, diff_data: Data) -> Result { Ok(diff_data) }