Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request 1M compute units in transfer remote #2771

Merged
merged 1 commit into from
Oct 3, 2023

Conversation

tkporter
Copy link
Collaborator

@tkporter tkporter commented Oct 3, 2023

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

@codecov
Copy link

codecov bot commented Oct 3, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (a82a814) 65.35% compared to head (106d463) 65.35%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2771   +/-   ##
=======================================
  Coverage   65.35%   65.35%           
=======================================
  Files          95       95           
  Lines        1446     1446           
  Branches      189      189           
=======================================
  Hits          945      945           
  Misses        494      494           
  Partials        7        7           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tkporter tkporter merged commit 1b98c13 into main Oct 3, 2023
22 checks passed
@tkporter tkporter deleted the trevor/increase-transfer-remote-compute-limit branch October 3, 2023 12:22
tkporter added a commit that referenced this pull request Nov 27, 2023
### Description

We need to request a higher compute limit for certain message indexes
that result in a higher # of internal nodes being hashed when inserting
into the merkle tree. Similar issue as #2771

### Drive-by changes

n/a

### Related issues

n/a

### Backward compatibility

yes

### Testing

none 😛
daniel-savu pushed a commit that referenced this pull request Dec 14, 2023
### Description

We need to request a higher compute limit for certain message indexes
that result in a higher # of internal nodes being hashed when inserting
into the merkle tree. Similar issue as #2771

### Drive-by changes

n/a

### Related issues

n/a

### Backward compatibility

yes

### Testing

none 😛
daniel-savu pushed a commit that referenced this pull request Jun 5, 2024
### Description

We need to request a higher compute limit for certain message indexes
that result in a higher # of internal nodes being hashed when inserting
into the merkle tree. Similar issue as #2771

### Drive-by changes

n/a

### Related issues

n/a

### Backward compatibility

yes

### Testing

none 😛
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants