-
Notifications
You must be signed in to change notification settings - Fork 8
fix: Increase the limit of seeds from 4 to 8 for escrow accounts #106
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
Conversation
|
\n\n## Walkthrough\nExpanded seed-count handling in src/processor/fast/delegate.rs: the seeds_to_validate match now supports 5–8 seeds by constructing matching seed arrays. Behavior for other counts and subsequent derived_pda computation/validation remains unchanged.\n\n## Changes\n| Cohort / File(s) | Summary of changes |\n| --- | --- |\n| Seed validation logic Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
GabrielePicco
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
We should support up to 16 seeds to cover all cases, but we can merge as it is to cover already most use-cases.
Yes. Created an issue: #108 |

Issue
We encountered
TooManySeeds(Custom Error: 14 or 0xe):The older
delegatehad usedVecfor seeds, but the new implementation uses fixed-size arrays to avoid heap allocation. These fixed-size arrays allowed upto4seeds. But the above failing instruction passes 5 seeds:["token_escrow", followed by 3 seeds (32 bytes each), then an 8-byte zero seed]Instruction data (after decoding):
Fix
This PR increases the limit on the number of seeds from
4to8.Cost Comparison
If we use
Vecand ready to pay some extra CUs, then:delegateconsumes18139 CU.delegateconsumes18268 CU.18268 - 18139 = 129 CU.If we continue with fixed-size array approach, we can define a macro to reduce the verbosity in the code and can use it wherever we have such opportunity, something like:
Summary by CodeRabbit