-
Notifications
You must be signed in to change notification settings - Fork 159
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: add blockstore that is the union of several CAR stores #3288
Conversation
…nto lemmih/many-car
} | ||
|
||
impl<WriterT> ManyCar<WriterT> { | ||
pub fn read_only<ReaderT: super::CarReader>(&mut self, any_car: AnyCar<ReaderT>) { |
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.
nit: push_read_only
might be more descriptive
writer: WriterT, | ||
} | ||
|
||
impl ManyCar { |
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.
nit: state migration tests could use ManyCar
. I can also do that in a separate PR
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.
nvm, bundle car is no longer needed once #3276 is merged
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.
Adding subcommand tests, at least for the happy path, would be great.
I can add smoke tests once the |
What's preventing us from doing a test without the |
I don't have two CAR files to merge. :) The primary use case for |
Done. Happy path tested. |
@lemmih Sadly, the happy path is not so happy. https://github.com/ChainSafe/forest/actions/runs/5712759803/job/15477232048?pr=3288 |
See!? This is why we should never add any tests! :P |
// Frame cache hit, no value. This only happens when hashes collide | ||
Some(None) => {} |
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.
Do we expect hash collisions? If not, should we panic here?
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.
Hash collisions may occur, and it costs us little to handle them correctly. If two CIDs have the same hash, the index returns two possible positions. We check the second position if we don't find the correct CID at the first position.
Summary of changes
Changes introduced in this pull request:
ManyCar
blockstore which takes the union of several CAR-files.ManyCar
in as many commands as possible.Reference issue to close (if applicable)
Roadmap: #3222
Other information and links
Benchmarks
Linear scan through a mainnet snapshot to find the genesis block:
Genesis Scan: 0-MiB
Genesis Scan: 32-MiB
Genesis Scan: 64-MiB
Genesis Scan: 128-MiB
Genesis Scan: 256-MiB
Genesis Scan: 512-MiB
Genesis Scan: 1024-MiB
Genesis Scan: 2048-MiB
Caching a single frame is sufficient when doing a linear scan. It's surprising that large caches hurt performance, though. Not sure why that is.
Executing 100 tipsets:
Execute 100 tipsets: 0-MiB
Execute 100 tipsets: 32-MiB
Execute 100 tipsets: 64-MiB
Execute 100 tipsets: 128-MiB
Execute 100 tipsets: 256-MiB
Execute 100 tipsets: 512-MiB
Execute 100 tipsets: 1024-MiB
Execute 100 tipsets: 2048-MiB
Change checklist