Skip to content
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

Merged
merged 25 commits into from
Nov 6, 2024

Commits on Nov 6, 2024

  1. Refactor latest snapshot info state

    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.
    InKryption committed Nov 6, 2024
    Configuration menu
    Copy the full SHA
    03a957b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d5b79ec View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c150297 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    41f1702 View commit details
    Browse the repository at this point in the history
  5. Remove unused import

    InKryption committed Nov 6, 2024
    Configuration menu
    Copy the full SHA
    5b5ce21 View commit details
    Browse the repository at this point in the history
  6. Big refactor on accountsdb fields and init & misc

    * 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.
    InKryption committed Nov 6, 2024
    Configuration menu
    Copy the full SHA
    c66d071 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    cec3b78 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    4b67d3c View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    c657dbc View commit details
    Browse the repository at this point in the history
  10. Fix writeSnapshotTarWithFields

    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.
    InKryption committed Nov 6, 2024
    Configuration menu
    Copy the full SHA
    a1534d3 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    e3c240a View commit details
    Browse the repository at this point in the history
  12. Set up test for snapshot gossip advertisement

    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.
    InKryption committed Nov 6, 2024
    Configuration menu
    Copy the full SHA
    4da9f72 View commit details
    Browse the repository at this point in the history
  13. Re-simplify SnapshotHashes incremental list

    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).
    InKryption committed Nov 6, 2024
    Configuration menu
    Copy the full SHA
    0d780f1 View commit details
    Browse the repository at this point in the history
  14. Defer gossip service shutdown

    Sequence it before deinit
    InKryption committed Nov 6, 2024
    Configuration menu
    Copy the full SHA
    9affe24 View commit details
    Browse the repository at this point in the history
  15. Use workaround in gossip snapshot update unit test

    In the future there should be a better API for loading from a snapshot
    that's outside the accountsdb snapshot working directory.
    InKryption committed Nov 6, 2024
    Configuration menu
    Copy the full SHA
    22446d5 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    ec7d671 View commit details
    Browse the repository at this point in the history
  17. Remove unused imports

    InKryption committed Nov 6, 2024
    Configuration menu
    Copy the full SHA
    1d69736 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    b59b924 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    3b4c01b View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    ce20259 View commit details
    Browse the repository at this point in the history
  21. Gossip push queue & signing refactor

    * 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.
    InKryption committed Nov 6, 2024
    Configuration menu
    Copy the full SHA
    0f19fbc View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    3e633a8 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    01a3a28 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    d68d920 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    5de9f2b View commit details
    Browse the repository at this point in the history