Request 1M compute units in transfer remote #2771
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Because incremental merkle tree insertion complexity can change depending on what the index in the merkle tree is, we ran into a situation where the 200k default compute limit wasn't enough when trying to perform a transfer remote on sealevel.
Normal cost for index 257, about 158k units:
https://explorer.solana.com/tx/4oB9b6PaaKvGMhrQS7XGmi7zBpX3GUW99sbVrSjFwm5AVT96emKF4NH6gn2y9cLMLep8wQJ9LqwJifG5QMpr4BAs
Index 255, about 245k units!: https://explorer.solana.com/tx/3v6SbrT58smwnLdnrEFaMXowaEDmo6EpPmKFTUMe9aESo5FTExmJdr2uMH5QJW9hnZTqrB1mfFZe4Vmu75CCAyPs
The fix is to simply request more units. Solana tx fees don't actually charge you more if you use more units. Txs have a global cap of 1.4M units -- I'm just requesting 1M here as a balance between having lots of units & not bricking ourselves if the max compute unit amount ever decreases
Drive-by changes
n/a
Related issues
n/a
Backward compatibility
Yes
Testing
I tested a version of this in the UI - I went to the commit where we published 1.5.1, and then published a 1.5.1-beta2 version with this change and moved the UI over to it. Opening this now so we can get this in main and move the UI over to a less sketchy version