-
Notifications
You must be signed in to change notification settings - Fork 34
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(accountsdb,gossip): Initial snapshot propagation work #333
Conversation
fff94e2
to
1480030
Compare
Interesting failure on the CI: https://github.com/Syndica/sig/actions/runs/11614796242/job/32343808753?pr=333 |
f4aec7b
to
c98d339
Compare
I still want to try resolve that TODO, but the code should now be in a state that's suitable for review. |
Alright there ended up being a simple workaround for the time being. |
6250b72
to
f631824
Compare
f631824
to
f9d39c7
Compare
f9d39c7
to
d01918d
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.
mostly small naming things - looks good otherwise
7bbd6ed
to
b27f6ac
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.
Haven't touched gossip yet so can't be 100% on that, but all seems good.
I like the additional comments and InitParams on accountsdb.
One thing that I haven't marked:
- should we be prefixing optional fields with
maybe_
like we do for vars and consts? e.g.- geyser_writer
- gossip_push_msg_queue
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.
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.
👍
1. Guard the full and incremental snapshot info under the same rwmux, both to deduplicate the full slot value, and to synchronize the existence of incremental snapshots relative to full snapshots. 2. Also do the same with the first snapshot info.
* Grouped fields into a few categories. * Change init to take only an `InitParams` struct. * Lowercase `AllocatorConfig` fields. * Share the `AllocatorConfig` enum tag across a few different places. * Inline `InitConfig`'s fields and remove it. * Fix code that potentially leaked a disk allocator pointer.
It was incorrectly reporting `file_info.length` as the file size, when it should have been using `account_file.memory.len`. This also adds a couple more runtime checks to assert the total written bytes are aligned to full 512 byte blocks.
It's currently disabled because it overwrites the snapshot archives in the test data dir; can comment the skip statement in order to test it locally for now. As the TODO says, we need a mechanism for loading from a snapshot which isn't in the accountsdb's snapshot working directory. This also adds a simple way to test the equality of the `SnapshotHashes` structure in tests.
The potential memory savings were minimal at best, and came at a significant cost in complexity - a simple tagged union is sufficient to avoid the overhead of an allocation, whilst retaining simplicity across the rest of the code (especially wrt generic comparisons).
Sequence it before deinit
In the future there should be a better API for loading from a snapshot that's outside the accountsdb snapshot working directory.
* Refactor `initSigned`, and related init methods, and call sites. * Move methods into more scoped types. * Flatten the `Gossip` struct into `AccountsDB`, and only store `my_pubkey`, instead of the whole key pair. * Change `push_msg_queue` to queue unsigned gossip data, and then sign it in `drainPushQueueToGossipTable`. * Set the wallclock time in `drainPushQueueToGossipTable` as well.
2d5918e
to
5de9f2b
Compare
This change set is centered around advertising snapshot generation to gossip, which in and of itself is not huge. It comes with a myriad of satellite refactors, improvements, and bug fixes which I encountered while I was in the process of testing/integrating the change in a smooth way, as well as experiments in setting up the RPC server for serving the advertised snapshots, which will instead be done in a follow-up PR.