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

switch to the gogo protobuf package in the filestore #5269

Closed
wants to merge 1 commit into from

Conversation

Stebalien
Copy link
Member

No description provided.

@Stebalien Stebalien requested a review from Kubuxu as a code owner July 21, 2018 06:26
@ghost ghost assigned Stebalien Jul 21, 2018
@ghost ghost added the status/in-progress In progress label Jul 21, 2018
@ghost
Copy link

ghost commented Jul 21, 2018

What's the story of this, just a leftover from moving everything to gogo protobuf?

@Stebalien
Copy link
Member Author

No idea. However, we're using one version of protobuf here, the same in prometheus, and a different version in badger (needs a newer version). However, I need to update the version in prometheus to the one that we use in badger so I figured we should just kill this one off (@whyrusleeping had no idea why we were using this here either).

@whyrusleeping
Copy link
Member

Its worth noting though, that the version of gogo protobuf we are using has a serialization order bug. If we try to update gogo, it will break all of our hashes. This is no bueno

@Stebalien
Copy link
Member Author

I'd like to vendor that old version of gogo and rename it to something like gogo-for-ipfs.

@ghost
Copy link

ghost commented Jul 21, 2018

If we try to update gogo, it will break all of our hashes. This is no bueno

Maybe that's something to coordinate with the base32 changes.

@kevina
Copy link
Contributor

kevina commented Jul 21, 2018

@lgierth

Maybe that's something to coordinate with the base32 changes.

The base32 change will not break change hashes, Just the way there are presented.

@magik6k
Copy link
Member

magik6k commented Jul 22, 2018

Its worth noting though, that the version of gogo protobuf we are using has a serialization order bug

Is it not possible to rewrite the protobufs in a way that is preserving the 'broken' order of things?

@Stebalien
Copy link
Member Author

Is it not possible to rewrite the protobufs in a way that is preserving the 'broken' order of things?

No. In "canonical" protobuf, fields are serialized in tag order. In the buggy gogo, fields were being serialized in the order in which they appeared in the protobuf schema. Unfortunately, we list the Links field first and the Data field second while the Links field has a tag of 2 and the Data field has a tag of 1.

@Stebalien
Copy link
Member Author

However... we can update the protobuf library as long as we don't update the generated protobuf marshaler in merkledag/pb/merkledag.pb.go.

@Stebalien Stebalien mentioned this pull request Jul 23, 2018
@kevina
Copy link
Contributor

kevina commented Jul 25, 2018

However... we can update the protobuf library as long as we don't update the generated protobuf marshaler in merkledag/pb/merkledag.pb.go.

That strikes me as just asking for trouble down the road. What is to keep some other developer from regenerating this file using the update protobuf library?

@Stebalien
Copy link
Member Author

That strikes me as just asking for trouble down the road. What is to keep some other developer from regenerating this file using the update protobuf library?

My plan is to add a constant (DoNotUpgradeFileEverItWillChangeYourHashes) to the generated file (checking it elsewhere). I was also planning on renaming it.

Note: this is already a problem as this file is generated by a command (where the version of the command isn't enforced by gx).

@kevina
Copy link
Contributor

kevina commented Jul 25, 2018

My plan is to add a constant (DoNotUpgradeFileEverItWillChangeYourHashes) to the generated file (checking it elsewhere). I was also planning on renaming it.

Okay that can work as long we make it clear why we can't regenerate the file so developers not familiar with the issue won't be tempted to override the check.

@Stebalien
Copy link
Member Author

Yep. It'll have a big comment. Maybe I'll even set the constant to a multi-line string describing the issue.

@Kubuxu
Copy link
Member

Kubuxu commented Jul 27, 2018

We recently had a PR that was reapplying the old bug on fresh gogoprotobuf. Maybe we should use that?

@Stebalien
Copy link
Member Author

We recently had a PR that was reapplying the old bug on fresh gogoprotobuf. Maybe we should use that?

We don't actually need that. Really, we just need the one generated function in the generated go file.

@Stebalien
Copy link
Member Author

Done in a different PR.

@Stebalien Stebalien closed this Aug 28, 2018
@ghost ghost removed the status/in-progress In progress label Aug 28, 2018
@Stebalien Stebalien deleted the fix/use-gogo-filestore branch February 28, 2019 22:44
@Stebalien Stebalien restored the fix/use-gogo-filestore branch May 30, 2019 22:34
@Stebalien Stebalien deleted the fix/use-gogo-filestore branch May 30, 2019 22:34
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.

5 participants