-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Use less stack intensive error mapping #2313
Conversation
Someone is attempting to deploy a commit to the coral-xyz Team on Vercel. A member of the Team first needs to authorize it. |
lgtm! I reproduced this and seems like these changes fix the #2070 issue. I was using https://github.com/andreihrs/anchor-error-reprod with all the accounts uncommented in OracleMappings struct. When I was running "cargo test-bpf", I was getting With your latest fix, the tests pass properly. Thanks for this! Maybe we can introduce a similarly sized account in tests to make sure other don't run into this issue again. Much appreciated! |
Great, I'll have to see if we can introduce downstream tests or include this one perhaps if it doesn't have too many other dependencies. Another more general solution is really just to be more conscious of heap usage in anchor, e.g. |
I'm using
Implies, this PR doesn't fix in all places? |
This PR was fixing a stack error that was showing up for a limited range of programs for a very specific reason, it was introduced by a change made to anchor about showing errors. No matter what anchor does as a dev you will always be able to exceed the stack. It's a memory buffer allowed to you by the solana runtime. If you're getting a stack error then you should follow the instructions and try to box accounts which will put them on the heap. However, if there's a specific part of anchor you think might be causing this, like if there's some function or variables that are unnecessarily using up memory, then we can definitely look at fixing that. You would need to help us in tracking down / narrowing where the excessive memory usage was coming from in the anchor |
closes: #2070