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

Amt refactor and interop tests #716

Merged
merged 19 commits into from
Oct 1, 2020
Merged

Amt refactor and interop tests #716

merged 19 commits into from
Oct 1, 2020

Conversation

austinabell
Copy link
Contributor

Summary of changes
Changes introduced in this pull request:

  • Fixes bug with Amt delete. In the case that a delete happens on an index that doesn't exist, the function would return without replacing the dirty cached node
  • Adds cache for cid resolution
    • Allows skipping bs resolution of Cid link if it's cached to avoid duplication (necessary for interop)
    • Removed Clone requirement by allowing a ref to the cache to be returned for loaded subnodes
  • Adds tests for serialization and blockstore stats
    • Cids are all the same, just made them string format to remove need for hex encoding
    • Our impl performs less writes on expansion, because go implementation flushes unnecessarily (will follow up but added TODOs)
  • Adds TrackingBlockStore which allows stats for reads and writes to be used to compare against Lotus (gas usage is based on this, so will be useful for Hamt as well which is why it's in a shared location)

Reference issue to close (if applicable)

Closes

Other information and links

// flush sub node to clear caches
n.flush(bs)?;
if let Node::Link { links, bmap } = self {
for (i, link) in (0..).zip(links.iter_mut()) {
Copy link
Member

Choose a reason for hiding this comment

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

No biggie, but shouldnt you .enumerate instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nah, because I want a u64 not a usize (and don't want to cast)

ipld/amt/src/node.rs Outdated Show resolved Hide resolved
@austinabell austinabell merged commit 2561c51 into main Oct 1, 2020
@austinabell austinabell deleted the austin/amtrefactor branch October 1, 2020 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants