You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When sending blocks to another user, the number of bytes sent to that user is not recorded in the corresponding Bitswap ledger (the receiving peer does record the number of bytes they receive, however).
Steps to reproduce:
(Optional) Initialize 2 peers to be connected to only each other.
On both peers: ipfs init, ipfs bootstrap rm all, ipfs bootstrap add <other_peer_multiaddr>
Run ipfs daemon, then ipfs swarm peers to ensure connections are established.
Add file to IPFS on one of the peers, then get the file on the other peer.
a. Peer 1: head -c 1000 /dev/urandom | base64 > /tmp/file && ipfs add -q /tmp/file
b. Peer 2: ipfs get <file_hash>
Check Bitswap ledgers with ipfs bitswap ledger <peer_id>
After I run those steps, the result on the sending peer is:
It looks like the function MessageSent, which updates the ledger just like MessageReceived when a message is received, wasn't actually called anywhere. I was able to fix it by adding a call to MessageSent where it seemed to make the most sense and have verified that the update works as expected, I'm about to submit a pull request with the change. Let me know if there are any other checks or changes I can make to this update, or if I completely missed the reason for this issue and my change was unnecessary.
Version information:
go-ipfs version: 0.4.9-dev-9dc5883a
Repo version: 5
System version: amd64/linux
Golang version: go1.8.1
This bug was also observed in version 0.4.8-dev.
Type: Bug
Severity: Medium
Description:
When sending blocks to another user, the number of bytes sent to that user is not recorded in the corresponding Bitswap ledger (the receiving peer does record the number of bytes they receive, however).
Steps to reproduce:
ipfs init
,ipfs bootstrap rm all
,ipfs bootstrap add <other_peer_multiaddr>
ipfs daemon
, thenipfs swarm peers
to ensure connections are established.a. Peer 1:
head -c 1000 /dev/urandom | base64 > /tmp/file && ipfs add -q /tmp/file
b. Peer 2:
ipfs get <file_hash>
ipfs bitswap ledger <peer_id>
After I run those steps, the result on the sending peer is:
And on the receiving peer:
If I then swap the roles and have the second peer upload a file that the first peer downloads, the first ledger changes to:
and the second ledger is unchanged from the one above.
I'm going to look into this myself, but I thought I'd post it here in case anyone has an immediate idea as to why this is happening.
Thanks!
The text was updated successfully, but these errors were encountered: