-
Notifications
You must be signed in to change notification settings - Fork 112
Conversation
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 always found the way we try to process locally received blocks the same as incoming messages a bit awkward, I like this better 👍
Any reason not to merge? (I see it's a draft PR) |
Quick alternative to #407 to fix the main issue.
Quick alternative to #407 to fix the main issue.
I wanted to get in a quick fix first for the release. I left it as a draft due to that last question. |
The primary motivation for this was to only account for _wanted_ blocks in the engine. This change also untangles some code, fixes some todos, and avoids reusing `receiveBlocksFrom` for processing _local_ blocks.
814ce68
to
30b442e
Compare
// Record how many bytes were received in the ledger | ||
for _, block := range blks { | ||
log.Debugw("Bitswap engine <- block", "local", e.self, "from", p, "cid", block.Cid(), "size", len(block.RawData())) | ||
l.ReceivedBytes(len(block.RawData())) |
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.
We should probably just replace this with some form of l.ReceivedBlocks(...)
and l.SentBlocks(...)
. But we can do that later.
Let's wait until we get #413 fixed before merging this (so we don't have to fork a patch release branch). |
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.
LGTM 👍
This repository has been moved to https://github.com/ipfs/go-libipfs. There is not an easy way to transfer PRs, so if you would like to continue with this PR then please re-open it in the new repository and link to this PR. |
The primary motivation for this was to only account for wanted blocks in the engine.
This change also untangles some code, fixes some todos, and avoids reusing
receiveBlocksFrom
for processing local blocks.