-
-
Notifications
You must be signed in to change notification settings - Fork 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
bitswap: protocol extension to handle cids #3297
Conversation
7a65328
to
0332349
Compare
for _, d := range pbm.GetBlocks() { | ||
fmt.Println("got old style block") |
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 isn't needed.
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 right, those debug logs...
// | ||
|
||
for _, b := range pbm.GetPayload() { | ||
fmt.Println("got new style block") |
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 also leftover debug logging.
b := blocks.NewBlock(d) | ||
m.AddBlock(b) | ||
} | ||
// |
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 isn't needed either.
for _, d := range pbm.GetBlocks() { | ||
fmt.Println("got old style block") | ||
// CIDv0, sha256, protobuf only | ||
b := blocks.NewBlock(d) | ||
m.AddBlock(b) |
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.
What in the case that both v0 and v1 fields are used? Just allow it? Log it?
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 fine just allowing it for now.
} | ||
|
||
func (m *impl) ToNetV0(w io.Writer) error { | ||
fmt.Println("V0") |
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.
Again debug logging.
0332349
to
224c6a1
Compare
I have two more PR's ready to go (already written) once this one is in. So lets get review on this ASAP |
8531ed0
to
f4d7369
Compare
This change adds the /ipfs/bitswap/1.1.0 protocol. The new protocol adds a 'payload' field to the protobuf message and deprecates the existing 'blocks' field. The 'payload' field is an array of pairs of cid prefixes and block data. The cid prefixes are used to ensure the correct codecs and hash functions are used to handle the block on the receiving end. License: MIT Signed-off-by: Jeromy <why@ipfs.io>
LGTM |
bitswap: protocol extension to handle cids
This change adds the /ipfs/bitswap/1.1.0 protocol. The new protocol
adds a 'payload' field to the protobuf message and deprecates the
existing 'blocks' field. The 'payload' field is an array of pairs of cid
prefixes and block data. The cid prefixes are used to ensure the correct
codecs and hash functions are used to handle the block on the receiving
end.
cc @diasdavid @Kubuxu
License: MIT
Signed-off-by: Jeromy why@ipfs.io