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
Copy file name to clipboardexpand all lines: bitswap/docs/how-bitswap-works.md
+7-6
Original file line number
Diff line number
Diff line change
@@ -74,8 +74,8 @@ When a message is received, Bitswap
74
74
So that the Engine can send responses to the wants
75
75
- Informs the Engine of any received blocks
76
76
So that the Engine can send the received blocks to any peers that want them
77
-
- Informs the WantManager of received blocks, HAVEs and DONT_HAVEs
78
-
So that the WantManager can inform interested sessions
77
+
- Informs the SessionManager of received blocks, HAVEs and DONT_HAVEs
78
+
So that the SessionManager can inform interested sessions
79
79
80
80
When the client makes an API call, Bitswap creates a new Session and calls the corresponding method (eg `GetBlocks()`).
81
81
@@ -101,9 +101,10 @@ The PeerTaskQueue prioritizes tasks such that the peers with the least amount of
101
101
102
102
### Requesting Blocks
103
103
104
-
When the WantManager is informed of a new message, it
105
-
- informs the SessionManager
106
-
The SessionManager informs the Sessions that are interested in the received blocks and wants
104
+
When the SessionManager is informed of a new message, it
105
+
- informs the BlockPresenceManager
106
+
The BlockPresenceManager keeps track of which peers have sent HAVES and DONT_HAVEs for each block
107
+
- informs the Sessions that are interested in the received blocks and wants
107
108
- informs the PeerManager of received blocks
108
109
The PeerManager checks if any wants were send to a peer for the received blocks. If so it sends a `CANCEL` message to those peers.
109
110
@@ -114,7 +115,7 @@ The Session starts in "discovery" mode. This means it doesn't have any peers yet
114
115
When the client initially requests blocks from a Session, the Session
115
116
- informs the SessionInterestManager that it is interested in the want
116
117
- informs the sessionWantManager of the want
117
-
- tells the WantManager to broadcast a `want-have` to all connected peers so as to discover which peers have the block
118
+
- tells the PeerManager to broadcast a `want-have` to all connected peers so as to discover which peers have the block
118
119
- queries the ProviderQueryManager to discover which peers have the block
119
120
120
121
When the session receives a message with `HAVE` or a `block`, it informs the SessionPeerManager. The SessionPeerManager keeps track of all peers in the session.
0 commit comments