-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Single mode sync #93
Single mode sync #93
Conversation
a7acc97
to
5c216fe
Compare
To: cg.receivers[m], | ||
From: cg.banker, | ||
|
||
Nonce: atomic.AddUint64(&cg.bankerNonce, 1) - 1, |
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 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.
The new sync looks correct to me. I'll review the tests more in a bit to see if everything i'd be worried about is covered
So that was probably the most annoying bug i've been the cause and fixer of in a long while. We were putting messages to the datastore using the cborIpldStore, and then fetching them by the Cid we get from message.Cid(). The problem was, the Cid returned by cst.Put() was different than the one returned by message.Cid(). The cborIpldStore puts things to disk using the cbor-ipld codec only, no matter what the thing we're putting wants to use. The problem with that is that we're currently (in lotus) using the filecoin compact serialization proposal, which has since been changed in the spec. So if we had fixed the types serialization first, we wouldnt have hit this bug. If I had been lazy and not implemented FCS when I did, we wouldnt have hit this bug... sigh. In any case, I'm really sorry @magik6k that you had to beat your head against that one... |
Oh, bonus points: The different codecs only caused a few characters to change at the beginning of the Cids, the ends were the same. And I was using the ends to pick out the cid where it was being printed in debug logs in different places. So i thought i was going crazy, when i searched for the end of the cids, they would show up in all the right places (and what i was missing was that the prefixes were different...) |
919a8e7
to
a8b434a
Compare
WIP, DO NOT MERGE yet.
This PR will remove
SyncMode
distinction fromSyncer
This is a hack to try improve the situation when we need to catch up with other peers for whatever reasonIssues this has:
Case:
This is probably because we try to fetch these blocks from A which didn't get them from M yet. We probably shouldn't forward info about new tipsets without fetching them first