add progressive state schema - #17358
Open
Inspector-Butters wants to merge 2 commits into
Open
Conversation
Inspector-Butters
force-pushed
the
progressive-state-schema
branch
from
August 14, 2026 12:22
4d54a9f to
49fe7c2
Compare
Inspector-Butters
force-pushed
the
progressive-state-schema
branch
from
August 14, 2026 12:24
49fe7c2 to
fb28a34
Compare
syjn99
self-requested a review
August 18, 2026 00:30
syjn99
reviewed
Aug 18, 2026
|
|
||
| func newProgressiveStateFieldsSchema(allFields []types.FieldIndex, inactiveFields []types.FieldIndex, forkFieldCount int) (*progressiveStateSchema, error) { | ||
| if len(allFields) == 0 { | ||
| return nil, fmt.Errorf("progressive state schema requires at least one field") |
Member
There was a problem hiding this comment.
Nit: I think we can just use errors.New in this case (static string). It's a bit faster than fmt.Errorf. So here's my personal rules:
- static string:
errors.New - formatted string:
fmt.Errorf - wrapping an
err:fmt.Errorfwith%wformatter
syjn99
reviewed
Aug 18, 2026
| return schema, nil | ||
| } | ||
|
|
||
| func (schema *progressiveStateSchema) getFieldIndex(field types.FieldIndex) (int, bool) { |
Member
There was a problem hiding this comment.
I think this is just a wrapper of map accessor, then can't we just use schema.fieldIndex in the caller side instead?
syjn99
reviewed
Aug 18, 2026
| "github.com/OffchainLabs/prysm/v7/runtime/version" | ||
| ) | ||
|
|
||
| const maxProgressiveStateFields = 256 |
Member
There was a problem hiding this comment.
Seems like we have same value (maxProgressiveActiveFields) in other package
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.
This PR changes how we access the fields of each fork in the state_native package going forward (starting with gloas).
we can no longer use
FieldIndex.RealPosition()since a field can have a different index for each fork.and now we have another thing to keep track of: each fork's
ActiveField []bool.it will create a
progressiveStateSchemafor gloas+ forks which will keep track of fields, fieldIndexes, and activeFields.I've showcased how this should be used. look at the changes in
state_trie.go. for later forks, the only thing we need to do, is to update thefields.gofile to include the new fork fields andprogressiveStateSchema.Fixes #17301