-
Notifications
You must be signed in to change notification settings - Fork 58
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: update go-ipld-format and boxo to remove globals #296
feat: update go-ipld-format and boxo to remove globals #296
Conversation
func init() { | ||
ipld.Register(cid.DagProtobuf, merkledag.DecodeProtobufBlock) | ||
ipld.Register(cid.Raw, merkledag.DecodeRawBlock) | ||
ipld.Register(cid.DagCBOR, cbor.DecodeBlock) // need to decode CBOR | ||
} |
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.
These appear unneeded, is there something I'm missing 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.
I'm relatively confident that without these you would do a ipfslite.DagService.Get() and the thing would error because it didn't know how to parse stuff (particularly with CBOR).
Perhaps this is no longer the case, perhaps these are preregistered somewhere else, I don't know. It was a way to not make the users go through the hassle of figuring out that they have to register the codecs they want to use.
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.
So the merkledag library will still have a global registry for now ipfs/boxo#322 that will use the global go-ipld-prime registry + some overrides for dag-pb and raw which means the dagservice will be fine.
I don't think a breaking change to go-merkledag is in the cards for this round of PRs, but if you'd like the registry used by merkledag to be configurable I'm cool exposing it as a public global with sufficient warnings around it.
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #296 +/- ##
==========================================
- Coverage 71.35% 69.51% -1.84%
==========================================
Files 2 2
Lines 199 187 -12
==========================================
- Hits 142 130 -12
Misses 38 38
Partials 19 19
☔ View full report in Codecov by Sentry. |
6d9d44f
to
7ca89b4
Compare
7ca89b4
to
1e8fb0d
Compare
p.reprovider = provider.NewNoopProvider() | ||
return nil | ||
} | ||
|
||
queue, err := queue.NewQueue(p.ctx, "repro", p.store) | ||
prov, err := provider.New(p.store, | ||
provider.DatastorePrefix(datastore.NewKey("repro")), | ||
provider.Online(p.dht), | ||
provider.ReproviderInterval(p.cfg.ReprovideInterval), | ||
provider.KeyProvider(provider.NewBlockstoreProvider(p.bstore))) | ||
if err != nil { | ||
return err | ||
} | ||
p.reprovider = prov |
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.
There were changes to the provider subsystem so this is what it should look like now
Waiting for review (and workflow running) |
No description provided.