update to arraylist implementation of ssz list#221
Merged
g11tech merged 4 commits intoblockblaz:mainfrom Sep 22, 2025
Merged
Conversation
g11tech
reviewed
Sep 22, 2025
pkgs/types/src/lib.zig
Outdated
| // the init to max size will fill the list and works because the list doesn't store delimiter | ||
| // else one needs to go through the append route | ||
| .justifications_validators = try ssz.utils.Bitlist(params.HISTORICAL_ROOTS_LIMIT * params.VALIDATOR_REGISTRY_LIMIT).init(params.HISTORICAL_ROOTS_LIMIT * params.VALIDATOR_REGISTRY_LIMIT), | ||
| .justifications_validators = try ssz.utils.Bitlist(params.HISTORICAL_ROOTS_LIMIT * params.VALIDATOR_REGISTRY_LIMIT).init(std.testing.allocator), |
Member
There was a problem hiding this comment.
the original test case had some data inserted into it, so add some data
g11tech
reviewed
Sep 22, 2025
pkgs/types/src/lib.zig
Outdated
| break :blk roots; | ||
| }, | ||
| .justifications_validators = try ssz.utils.Bitlist(params.HISTORICAL_ROOTS_LIMIT * params.VALIDATOR_REGISTRY_LIMIT).init(params.HISTORICAL_ROOTS_LIMIT * params.VALIDATOR_REGISTRY_LIMIT), | ||
| .justifications_validators = try ssz.utils.Bitlist(params.HISTORICAL_ROOTS_LIMIT * params.VALIDATOR_REGISTRY_LIMIT).init(std.testing.allocator), |
g11tech
reviewed
Sep 22, 2025
| }, | ||
| .signature = [_]u8{2} ** SIGSIZE, | ||
| }; | ||
| defer block.message.body.attestations.deinit(); |
Member
There was a problem hiding this comment.
add a deinit fn to block and do this deinit there and call block.deinit
g11tech
reviewed
Sep 22, 2025
| // even beam run command results into core dumped | ||
| .HISTORICAL_ROOTS_LIMIT = 1 << 10, // 2^18 = 262144 | ||
| .VALIDATOR_REGISTRY_LIMIT = 1 << 4, // 2^12 = 4096 | ||
| .HISTORICAL_ROOTS_LIMIT = 1 << 18, // 2^18 = 262144 |
Member
There was a problem hiding this comment.
restored to original limits as per spec since lists aren't stack allocated anymore
1feab49 to
877c3b7
Compare
877c3b7 to
3af4b61
Compare
g11tech
approved these changes
Sep 22, 2025
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
Migrate SSZ types from BoundedArray to ArrayList for dynamic memory management
Changes
flattenJustifications()- now properly deinits existing lists before reinitializing to prevent memory leaksBeamState.deinit()to clean up all ArrayList fields without requiring allocator parameter