From f9396fc8143e0d86f261d1b4c3441c3d42a2b622 Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Thu, 12 Dec 2024 03:50:44 +0000 Subject: [PATCH] fix: on SVM collateral warp routes, specify the mint when transferring out as readonly (#4905) ### Description - This was surfaced a while back but we never made the tweak -- on the collateral warp routes, the account infos exposed to the relayer informing it how to process a message ask for the token mint to be writeable. This isn't necessary - it can be read-only because nothing is changing in the data of the token mint. A consequence of this is that we need to pay higher fees for accounts that have very high contention (like USDC) - We have strong test coverage here - if this change wasn't possible, our Sealevel tests would fail ### Drive-by changes ### Related issues ### Backward compatibility ### Testing --- .../programs/hyperlane-sealevel-token-collateral/src/plugin.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/sealevel/programs/hyperlane-sealevel-token-collateral/src/plugin.rs b/rust/sealevel/programs/hyperlane-sealevel-token-collateral/src/plugin.rs index 0fc224667e..ff8cf8dd7b 100644 --- a/rust/sealevel/programs/hyperlane-sealevel-token-collateral/src/plugin.rs +++ b/rust/sealevel/programs/hyperlane-sealevel-token-collateral/src/plugin.rs @@ -444,7 +444,7 @@ impl HyperlaneSealevelTokenPlugin for CollateralPlugin { vec![ AccountMeta::new_readonly(token.plugin_data.spl_token_program, false).into(), AccountMeta::new_readonly(spl_associated_token_account::id(), false).into(), - AccountMeta::new(token.plugin_data.mint, false).into(), + AccountMeta::new_readonly(token.plugin_data.mint, false).into(), AccountMeta::new(recipient_associated_token_account, false).into(), AccountMeta::new(ata_payer_account_key, false).into(), AccountMeta::new(token.plugin_data.escrow, false).into(),