feat: require Sealevel native transfers to cover the rent of the recipient (#4936)
### Description - Happened a few times where someone transferred SOL from Eclipse -> SOL on Solana, and the recipient did not yet exist (so had no SOL balance to cover its rent). The amount on these transfers would be insufficient to cover the rent of the recipient, so the transfer could never be delivered. See https://discord.com/channels/935678348330434570/1311371339889639486/1311381212828532858 for context on the first time this happened. There were then a few other instances the day after - This introduces `ITokenAdapter.getMinimumTransferAmount`, where impls generally return a minimum of 0, but native Sealevel and native Sealevel warp routes have some logic that is aware of required rent exemption balances - Atm, in WarpCore this only checks getMinimumTransferAmount on the destination side and not the origin -- my reasoning here is that: a. for the specific issue this is addressing, the destination side is the only one where issues can arise. On the origin, the account that escrows the SOL is always rent exempt b. checking on the origin for completeness could be done, but would require some extra logic to be aware of where tokens are escrowed on the origin side (i.e. the recipient should be the account that escrows the SOL), which felt unnecessary / confusing ### Drive-by changes <!-- Are there any minor or drive-by changes also included? --> ### Related issues <!-- - Fixes #[issue number here] --> ### Backward compatibility <!-- Are these changes backward compatible? Are there any infrastructure implications, e.g. changes that would prohibit deploying older commits using this infra tooling? Yes/No --> ### Testing <!-- What kind of testing have these changes undergone? None/Manual/Unit Tests -->pull/4722/merge
parent
97c1f80b73
commit
2054f4f5be
@ -0,0 +1,5 @@ |
||||
--- |
||||
'@hyperlane-xyz/sdk': minor |
||||
--- |
||||
|
||||
Require Sealevel native transfers to cover the rent of the recipient |
Loading…
Reference in new issue