-
Notifications
You must be signed in to change notification settings - Fork 628
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
Make the chain manager a View
.
#3135
Conversation
""" | ||
A GraphQL-visible map item, complete with key. | ||
""" | ||
type Entry_BlobId_Blob_9f0b41f3 { |
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.
What's this weird suffix?
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.
I think it's a hash to avoid type name collisions.
/// The owners that take over in fallback mode. | ||
#[debug(skip_if = BTreeMap::is_empty)] | ||
pub fallback_owners: BTreeMap<Owner, (PublicKey, u64)>, | ||
pub fallback_owners: RegisterView<C, BTreeMap<Owner, (PublicKey, u64)>>, |
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.
That's a lot of mechanical work. I know it's not for this PR but it'd be nice if derive(View)
wrapped all of the fields into propery *View
variants.
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.
I don't know if that's possible in general. E.g. some but not all maps should turn into MapView
s.
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.
sensible deafults + overrides with attributes.
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.
Yes, maybe. Definitely out of scope for this PR, though. 😅
Motivation
Currently the chain manager is serialized as a whole and stored in a
RegisterView
in the chain state view. Since it contains blobs it can be very large, and the blobs are not needed every time the chain manager is loaded.Proposal
Make the chain manager a
View
, and put the blobs in aMapView
.Test Plan
This doesn't change any logic, so CI should catch regressions. (In fact, it already did: #3133)
Release Plan
Links