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

Add support for mempack #506

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add support for mempack #506

wants to merge 2 commits into from

Conversation

lehins
Copy link
Collaborator

@lehins lehins commented Oct 25, 2024

Description

This PR adds support for serializing/deserializing Hashes using mempack library. This is needed for Ledger to implement efficient snapshot creation.

The only breaking affect on downstream users of this PR is that Hash serialization will now require KnownNat or HashAlgorithm constraint.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated
  • All visible changes are prepended to the latest section of a CHANGELOG.md for the affected packages.
    New section is never added with the code changes. (See RELEASING.md)
  • When applicable, versions are updated in .cabal and CHANGELOG.md files according to the
    versioning process.
  • The version bounds in .cabal files for all affected packages are updated.
    If you change the bounds in a cabal file, that package itself must have a version increase. (See RELEASING.md)
  • Self-reviewed the diff

@lehins lehins force-pushed the lehins/use-mempack branch 2 times, most recently from 0f1cec6 to e73f1ab Compare October 25, 2024 21:51
@lehins lehins marked this pull request as ready for review November 1, 2024 21:19
During deserialization we create a temporary buffer, whcih is later
converted to `PackedBytes` representation. There is no need fort hat
intermediarey buffer to be backed by pinned memory (i.e. `ByteString`)
This commit switches to using unpinned `ShortByteString` in order to
reduce fragmentation of pinned memory due to deserialization of
milllions of hashes on a running node
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant