-
Notifications
You must be signed in to change notification settings - Fork 201
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
feat: serialize new versioned epoch stakes bank snapshot field #2282
Conversation
567973f
to
bad8e8a
Compare
42172c5
to
928ba9b
Compare
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.
Generally, this looks good to me, but I'll defer to Brooks on the approach.
1e4817a
to
c2a4346
Compare
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.
automerge label removed due to a CI failure |
versioned_epoch_stakes.insert( | ||
epoch, | ||
VersionedEpochStakes::Current { | ||
stakes: Stakes::<Stake>::from(stakes.clone()), |
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.
@brooksprumo as you pointed out, this is causing us to do a clone of all epoch stakes. I see a few workarounds:
- replace all of the bank epoch stakes entries with
StakesEnum::Stakes
when we compute them for snapshots - when we save off bank epoch stakes during epoch boundaries, replace the
StakesEnum::Accounts
withStakesEnum::Stakes
immediately - do the custom serialization approach we do for the
epoch_stakes
field where we keepStakesEnum::Accounts
inVersionedEpochStakes
but when serializing, it gets serialized as aStakesEnum::Stakes
I'm going to explore the first one
Problem
In v2.0, the solana protocol added support for deserializing the new versioned epoch stakes bank snapshot field. Now in v2.1 we can start serializing that new field.
Summary of Changes
Implements phase 2 of solana-foundation/solana-improvement-documents#149
versioned_epoch_stakes
as a new serializable extra fieldFixes #