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

PrototypeChooser support #305

Merged
merged 6 commits into from May 31, 2022
Merged

PrototypeChooser support #305

merged 6 commits into from May 31, 2022

Conversation

willscott
Copy link
Member

  • being able to set an option for traversalprototypechooser seems like an oversight.
  • I changed the tracked index records in the writerOutput to a map that would only intercept blocks on the first time it would potentially tee them to the output stream. I feel like there's something here that maybe changes based on the BlockstoreAllowDuplicatePuts option

cc @aarshkshah1992 - with these your example does what you want it to do.

* writer won't double-count replicated loads (maybe needs to respect option for this)
@rvagg
Copy link
Member

rvagg commented May 30, 2022

The bypass for duplicate loads may have unintended consequences but the only thing I can think of is that maybe you really want to create a sloppy CAR with duplicate blocks as allowed by spec .. for some reason .. but would you be using that API if you had anything like this in mind? Maybe you should just be opting for the direct CARv1 interface instead. Aside from that, the LinkSystem is still returning the blocks if they're duplicate, just not passing down to the underlying LinkSystem. Mostly we care about not skipping duplicates when executing a complex selector and if you're doing that to watch LinkSystem loads I don't think you'd care about duplicates anyway as long as you're executing the full selector.

🤷 This might be a case of shipping it and seeing if anyone squeals.

Aside from that, the assertion on the selective test is pretty weak, is there a way to narrow down the number of expected blocks to a range? I know it's getting complicated to ask for a specific sub-dag you'd expect, as nice as that would be, but it'd also be nice to tighten up the assertion(s) a little bit to recognise more failure modes.

@willscott
Copy link
Member Author

added additional checks in the test case

Copy link
Member

@rvagg rvagg left a comment

Choose a reason for hiding this comment

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

maybe let's get multiformats/go-multicodec#68 sorted too so we have a tagged version here

@willscott willscott merged commit c65f0bf into master May 31, 2022
@willscott willscott deleted the feat/chooser branch May 31, 2022 07:28
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.

None yet

2 participants