-
Notifications
You must be signed in to change notification settings - Fork 38
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(requestid): use uuids for requestids #313
Conversation
Still having trouble figuring out why |
20d5703
to
9d6265e
Compare
I figured out the Anyway, by switching it out to So aside from the network message version switching, this is working as it should I believe. |
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.
This is pretty great-- it's nice to see this overall wasn't that bad. I'm excited you have passing tests. I think we should create an epic branch to track the new protocol and do merges to that? I'll discuss with @mvdan and we can figure it out. I realize epic branchs are a pain in the but I know we're going to ship things while all this work is still outstanding.
requestRecordChan <-chan requestRecord, | ||
count int) []requestRecord { | ||
requestRecords := make([]requestRecord, 0, count) | ||
func readNNetworkRequests(ctx context.Context, t *testing.T, td *testData, count int) []requestRecord { |
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.
oh the simplied sorting in this method is a sad state of affairs.... your correction works, but I wonder how I ended writing the tests this way to count on sorting order
f54bf67
to
bb7ceb1
Compare
d7ffdcf
to
482dd21
Compare
@hannahhoward see latest commit for my first pass at protocol switching and compatibility: f7ce568 No tests yet that exercise v1.0.0. |
Pushed another commit that adds testing, but failing testing. Fixed a few other things along the way. But I think the main problem is the lack of differentiation between the integer ID space for requests and responses. So I need to figure out a nice way to do that. |
so baseline: this looks reasonable. The MessageHandler is a good abstraction. But two caveats, one big, one small: Big: To uniquely identify the OLD requests you need the peer ID && the integer request ID. So, for your MessageHandler, you need the following maps: type oldRequestKey struct {
p peer.ID
requestID in32
}
// ...
type MessageHandler struct {
// ...
fromV1Map map[oldRequestKey]graphsync.RequestID
toV1Map map[graphsync.RequestID]oldRequestKey
//...
} The translation is:
Beyond distinguishing requests & responses, if we are talking to old client A & old client B, it's entirely possible both could send you a request with the same integer ID.
|
also, in terms of where to get the other peer.ID and the self peer.ID: |
sidebar: goodness why did I decide to have so much object orientation initially? I wonder if this would be made much easier if we took all this encoding out of the message package and just made and encode/decode package with functional implementations This is more of a "later problem" than a now problem though so let's defer it. |
OK, this is working and ready for review. But it's blocking pending a merge with #323 so that v1.1.0 isn't protobuf but is dag-cbor. |
#332 has these commits and more now, it removes the 1.1.0 protocol, adding a 2.0.0 that's dag-cbor with UUIDs and retains the translation layer that was introduced here for 1.1.0 / 1.0.0. |
Ref: #278
Closes: #279
Closes: #281
WIP, first pass. TODO:
TestGraphsyncRoundTripMultipleAlternatePersistence()
is failing and I don't yet understand whyreadNNetworkRequests()
used int id ordering to properly sort network requests to remove out-of-order effects, can't do that now so we have flakys, need to figure out at way to deal with that.