From 966bd5513acc5b81e848946e16517e32f210002b Mon Sep 17 00:00:00 2001 From: Pablo Maldonado Date: Tue, 7 Jan 2025 10:21:44 +0000 Subject: [PATCH 1/3] feat(svm): N-01 Incomplete or Misleading Comments Signed-off-by: Pablo Maldonado --- programs/svm-spoke/src/lib.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/programs/svm-spoke/src/lib.rs b/programs/svm-spoke/src/lib.rs index eea54150d..617baaef2 100644 --- a/programs/svm-spoke/src/lib.rs +++ b/programs/svm-spoke/src/lib.rs @@ -310,9 +310,12 @@ pub mod svm_spoke { ) } - /// Equivalent to deposit_v3 except the deposit_nonce is not used to derive the deposit_id for the depositor. This - /// Lets the caller influence the deposit ID to make it deterministic for the depositor. The computed depositID is - /// the keccak256 hash of [signer, depositor, deposit_nonce]. + /// Equivalent to deposit_v3, except that it doesn't use the global `number_of_deposits` counter as the deposit + /// nonce. Instead, it allows the caller to pass a `deposit_nonce`. This function is designed for anyone who + /// wants to pre-compute their resultant deposit ID, which can be useful for filling a deposit faster and + /// avoiding the risk of a deposit ID unexpectedly changing due to another deposit front-running this one and + /// incrementing the global deposit ID counter. This enables the caller to influence the deposit ID, making it + /// deterministic for the depositor. The computed `depositID` is the keccak256 hash of [signer, depositor, deposit_nonce]. pub fn unsafe_deposit_v3( ctx: Context, depositor: Pubkey, @@ -486,7 +489,7 @@ pub mod svm_spoke { /// BUNDLE FUNCTIONS * /// ************************************* - /// Executes relayer refund leaf. Only callable by owner. + /// Executes relayer refund leaf. /// /// Processes a relayer refund leaf, verifying its inclusion in a previous Merkle root and that it was not /// previously executed. Function has two modes of operation: a) transfers all relayer refunds directly to @@ -494,7 +497,8 @@ pub mod svm_spoke { /// refund. In the happy path, (a) should be used. (b) should only be used if there is a relayer within the bundle /// who can't receive the transfer for some reason, such as failed token transfers due to blacklisting. Executing /// relayer refunds requires the caller to create a LUT and load the execution params into it. This is needed to - /// fit the data in a single instruction. The exact structure and validation of the leaf is defined in the UMIP. + /// fit the data in a single instruction. The exact structure and validation of the leaf is defined in the Accross + /// UMIP: . /// /// instruction_params Parameters: /// - root_bundle_id: The ID of the root bundle containing the relayer refund root. From ea421077c0a82df872fa98edb3570b58a1fca732 Mon Sep 17 00:00:00 2001 From: Pablo Maldonado Date: Wed, 8 Jan 2025 15:03:50 +0000 Subject: [PATCH 2/3] refactor: remove <> Signed-off-by: Pablo Maldonado --- programs/svm-spoke/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/svm-spoke/src/lib.rs b/programs/svm-spoke/src/lib.rs index 617baaef2..21a7bb80a 100644 --- a/programs/svm-spoke/src/lib.rs +++ b/programs/svm-spoke/src/lib.rs @@ -498,7 +498,7 @@ pub mod svm_spoke { /// who can't receive the transfer for some reason, such as failed token transfers due to blacklisting. Executing /// relayer refunds requires the caller to create a LUT and load the execution params into it. This is needed to /// fit the data in a single instruction. The exact structure and validation of the leaf is defined in the Accross - /// UMIP: . + /// UMIP: https://github.com/UMAprotocol/UMIPs/blob/master/UMIPs/umip-179.md. /// /// instruction_params Parameters: /// - root_bundle_id: The ID of the root bundle containing the relayer refund root. From e1544807b4326380ebcdca376f8bf0c0e0ed1f24 Mon Sep 17 00:00:00 2001 From: Chris Maree Date: Thu, 9 Jan 2025 12:39:32 +0100 Subject: [PATCH 3/3] Update programs/svm-spoke/src/lib.rs --- programs/svm-spoke/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/svm-spoke/src/lib.rs b/programs/svm-spoke/src/lib.rs index 21a7bb80a..2280ce3f1 100644 --- a/programs/svm-spoke/src/lib.rs +++ b/programs/svm-spoke/src/lib.rs @@ -498,7 +498,7 @@ pub mod svm_spoke { /// who can't receive the transfer for some reason, such as failed token transfers due to blacklisting. Executing /// relayer refunds requires the caller to create a LUT and load the execution params into it. This is needed to /// fit the data in a single instruction. The exact structure and validation of the leaf is defined in the Accross - /// UMIP: https://github.com/UMAprotocol/UMIPs/blob/master/UMIPs/umip-179.md. + /// UMIP: https://github.com/UMAprotocol/UMIPs/blob/master/UMIPs/umip-179.md /// /// instruction_params Parameters: /// - root_bundle_id: The ID of the root bundle containing the relayer refund root.