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: atrium-repo #272

Merged
merged 82 commits into from
Mar 8, 2025
Merged

feat: atrium-repo #272

merged 82 commits into from
Mar 8, 2025

Conversation

DrChat
Copy link
Contributor

@DrChat DrChat commented Dec 23, 2024

This builds on str4d's work here: #168.

Big notes:

  • Complete merkle search tree implementation (but still lacking fuzz tests)
  • Complete Repository implementation with support for basic CRUD operations
  • Added a new pair of traits for block storage: AsyncBlockStoreRead and AsyncBlockStoreWrite.
    • In-memory storage backend (primarily intended for testing)
    • CAR storage (supporting both reading and writing)
    • Users can implement other storage sources, like Azure-backed block storage.

Test coverage (cargo llvm-cov -p atrium-repo --html --open):
image


  • Merkle Search Tree
    • Parse Node
      • Read Node from bytes
      • Verify depth and sort order
      • Limit the number of TreeEntrys per Node to a statistically unlikely maximum length.
      • Consider limiting the overall depth of the repo, or other parameters, to prevent more sophisticated key mining attacks.
    • Locate key within node
    • Locate keys within node with a given prefix
    • Add entry
    • Edit entry
    • Delete entry
  • Repository
    • Load from a CAR file
    • Load from a firehose record
    • Read/write records inside of a repository
  • Storage
    • CAR files
      • Reading CAR files
      • Verify completeness of the repository structure.
      • Robustness to both duplication and de-duplication of blocks.
      • Ignore any unnecessary or unlinked blocks.
    • Commits from firehose records

@DrChat DrChat marked this pull request as draft December 23, 2024 20:14
@DrChat DrChat force-pushed the repo branch 6 times, most recently from 3b84377 to f8e988e Compare December 26, 2024 21:08
@DrChat DrChat force-pushed the repo branch 2 times, most recently from f736ccc to b230066 Compare January 1, 2025 19:20
@DrChat DrChat force-pushed the repo branch 2 times, most recently from 6db3530 to 60adc4a Compare January 18, 2025 21:58
@DrChat
Copy link
Contributor Author

DrChat commented Jan 18, 2025

I think the PR is in a pretty good state for a MVP.
My time is limited so I won't be able to quickly iterate on the functionality for creating new commits for a repository. Still planning on it, but the work here can be pushed up in the meantime :)

@DrChat DrChat marked this pull request as ready for review January 18, 2025 22:24
@erlend-sh
Copy link
Contributor

erlend-sh commented Jan 19, 2025

Pinging @str4d since this builds on their prior work.

@sugyan sugyan self-requested a review January 19, 2025 13:48
Copy link
Owner

@sugyan sugyan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have written several comments on areas unrelated to the internal logic. There are also a couple of points from clippy that I hope you can correct as well.

@DrChat DrChat force-pushed the repo branch 5 times, most recently from 5f55fc5 to cb8e8c0 Compare February 1, 2025 17:52
@DrChat
Copy link
Contributor Author

DrChat commented Feb 8, 2025

Note: It looks like there's a pretty exhaustive MST test suite here that could probably be leveraged to validate this implementation.
https://github.com/DavidBuchanan314/mst-test-suite

@DrChat DrChat force-pushed the repo branch 2 times, most recently from b3afd8a to 2ee7cba Compare February 12, 2025 00:59
@DrChat DrChat force-pushed the repo branch 4 times, most recently from 9277356 to 465724d Compare February 15, 2025 22:50
@sugyan
Copy link
Owner

sugyan commented Mar 8, 2025

I couldn't review the correctness of the implementation and other details, but I would like to merge them once. If @str4d finds any problems later, please let us know via issue or pull-request.

Thanks @DrChat for your great work!

@sugyan sugyan merged commit aa69db0 into sugyan:main Mar 8, 2025
12 of 14 checks passed
@github-actions github-actions bot mentioned this pull request Mar 8, 2025
@DrChat
Copy link
Contributor Author

DrChat commented Mar 8, 2025

Thank you! And I'm sure there are some bugs in the implementation - I'm hoping that someone else will shake them out if I don't get around to it :)

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.

4 participants