Dynamic account sizing for DirectRecipient with VestingSchedule enum#4
Merged
Dynamic account sizing for DirectRecipient with VestingSchedule enum#4
Conversation
amilz
previously approved these changes
Feb 6, 2026
- Remove fixed 25-byte schedule padding, accounts now vary by variant - Add VestingSchedule::byte_len() method for runtime size calculation - Replace DirectRecipient flat fields with VestingSchedule enum storage - Update account creation to use DirectRecipient::calculate_account_size() - Change account size range from fixed 140 bytes to 116-140 bytes depending on variant: - Immediate: 116 bytes - Cliff: 124 bytes - Linear: 132 bytes - CliffLinear: 140 bytes - Update all integration tests and fixtures for new layout - Reset DirectRecipient::VERSION from 3 to 1 for consistency
4d7dd68 to
d50b9fd
Compare
amilz
approved these changes
Feb 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Implements dynamic account sizing for DirectRecipient following the escrow program pattern. Accounts now vary from 116-140 bytes based on VestingSchedule variant instead of fixed 140-byte padding. Adds VestingSchedule::byte_len() method and updates account creation to calculate actual size needed. All integration tests updated and passing.
Key Changes