-
Notifications
You must be signed in to change notification settings - Fork 96
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
go-merkledag duplicates and global variables #291
Comments
2023-05-18 maintainer conversation:
|
The change to resolve this in ipld-prime wasn't too bad - the use of registry and a 'DefaultRegistry' meant that in the cases where there were conflicts, a specific registry could be specified to avoid the use of the implicit global. |
My personal preference is to not see more shared dependencies puled in to the boxo vortex, it continues to cause problems. A new example to highlight this is an inability to update a transitive dependency of the non-boxo go-merkledag that's been tagged with a security vulnerability, so now that go-merkledag gets the pleasure of being flagged by github as having security problems (even though it doesn't), because of the dependency tangle: ipfs/go-merkledag#103. I'd prefer people to not rely on go-merkledag at all, but this is likely to just push people to reach for the boxo form, which may help boxo adoption metrics but it doesn't help migrate people off legacy abstractions. Anyway, that aside, two other thoughts:
|
This is also leading to issues with compatibility between caboose and bifrost-gateway somehow |
Eek - not good. This was already on the critical to solve list. Our original plan was to handle after the inflight items complete next week (per #196 (comment) ). But if it is now blocking bifrost-gateway gateways, we can context switch to handle sooner. @willscott : can this be evaluated when everyone's back on Tuesday, 2023-05-30? |
Yep 👍 |
Next steps per 2023-05-30 maintainer conversation (updated later that day):
|
ipfs/go-merkledag#104 is the bubble of ipfs/go-ipld-legacy#13 on the go-merkledag side, and should be reflected in the one in boxo |
@willscott @rvagg realizing that the go-ipld-prime globals are in too many places right now and I don't immediately need go-ipld-legacy v0.2.1 so going to make dealing with that a follow-up issue. It'll likely touch the merkledag repo here and if you'd like to do the same in go-merkledag that's 👍. I'll tag you as an FYI way once there's there's anything to look at although IMO it's not that high priority at the moment so could take some time. |
2023-06-08 maintainer conversation:
|
They've already been linked, but for visibility, this has been impacting Outercore Engineering: |
@hannahhoward has said she will take care of pushing through the go-fil-markets, lotus and boost PRs. They should be good to go from the perspective of this issue (i.e. just switching from commit hashes to releases), but there may be other changes they want to make before hitting the merge button. (cc @jlogelin since you'll likely be blocked on the lotus PR). I've updated the ipfs-cluster dependencies and ipfs-cluster PRs. They're waiting for when @hsanjuan has time to review. |
I'm closing this issue since all the issues/PRs were handled and merged. The one exception is ipfs-cluster, but there are open PRs for that work. Thanks @aschmahmann and others for helping detangle here. Not fun but obviously important. |
Background
merkledag
library. There is the one here in boxo and go-merkledag.boxo/ipld/unixfs/file/unixfile.go
Line 155 in 8059f18
Bug
These interactions collectively mean that depending on whether go-merkledag gets initialized before or after boxo/ipld/merkledag you may/may not get an error if you call boxo/ipld/merkledag/DagService.Get and pass the result into boxo/ipld/unixfs/file/NewUnixFSFile.
Proposed fixes
There are obviously lots of problems here that could resolve this particular issue given the many unfortunate practices that have led us here (two versions of similar code, using global variables to manage state, doing explicit type checks, etc.).
Probably the easiest is to copy go-ipld-legacy into boxo. At that point the entry paths into go-ipld-legacy will be a little more obvious/contained and we can figure out the best way to go from there.
Another option that might not be too bad would be to remove the global variables from go-ipld-legacy, and force an instance to be instantiated with a converter registry, which would likely be a breaking change. That repo doesn't appear to be highly utilized explicitly (as opposed to via merkledag) so it probably wouldn't be too rough on consumers. That being said it's certainly more disruptive than a copy.
Open to better suggestions if folks have them.
Tracking steps
Stage the changes:
Validate the changes with consumers::
Disruption phase:
The text was updated successfully, but these errors were encountered: