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

bitswap: protocol extension to handle cids #3297

Merged
merged 1 commit into from
Oct 12, 2016
Merged

Conversation

whyrusleeping
Copy link
Member

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 [email protected]

for _, d := range pbm.GetBlocks() {
fmt.Println("got old style block")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't needed.

Copy link
Member Author

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")
Copy link
Member

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)
}
//
Copy link
Member

@Kubuxu Kubuxu Oct 10, 2016

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)
Copy link
Member

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?

Copy link
Member Author

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")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again debug logging.

@whyrusleeping
Copy link
Member Author

I have two more PR's ready to go (already written) once this one is in. So lets get review on this ASAP

@whyrusleeping whyrusleeping force-pushed the feat/bitswap-cid branch 2 times, most recently from 8531ed0 to f4d7369 Compare October 10, 2016 15:19
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 <[email protected]>
@Kubuxu Kubuxu self-assigned this Oct 10, 2016
@Kubuxu
Copy link
Member

Kubuxu commented Oct 12, 2016

LGTM

@whyrusleeping whyrusleeping merged commit 015d476 into master Oct 12, 2016
@whyrusleeping whyrusleeping deleted the feat/bitswap-cid branch October 12, 2016 14:13
@whyrusleeping whyrusleeping removed the status/in-progress In progress label Oct 12, 2016
@ghost ghost mentioned this pull request Dec 23, 2016
ariescodescream pushed a commit to ariescodescream/go-ipfs that referenced this pull request Apr 7, 2022
bitswap: protocol extension to handle cids
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.

2 participants