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: docs/architecture.md
+31-1
Original file line number
Diff line number
Diff line change
@@ -264,7 +264,37 @@ Asynchronously, a new task is started to recompute the new head, as this takes a
264
264
265
265
## Request-Response
266
266
267
-
**TO DO**: document how ports work for this.
267
+
Request-response is an on-demand protocol where a node asks for information directly to a peer and expects a response. This may be to request metadata that corresponds to that peer for discovery purposes, or to request information from the past that will not appear on when listening to gossip (useful for checkpoint sync).
Explained, a process that wants to request something from Libp2pPort sends a request with its own pid, which is then included in the Command payload. The request is handled asynchronously in the go side, and eventually, the pid is included in the response, and sent back to LibP2PPort, who now knows to which process it needs to be dispatched.
296
+
297
+
The specific kind of command (a request) is specified, but there's nothing identifying this is a response vs any other kind of result, or the specific kind of response (e.g. a block download vs a blob download). Currently the only way this is handled differentially is because the pid is waiting for a specific kind of response and for nothing else at a time.
Copy file name to clipboardExpand all lines: lib/lambda_ethereum_consensus/beacon/pending_blocks.ex
+68-138
Original file line number
Diff line number
Diff line change
@@ -4,13 +4,10 @@ defmodule LambdaEthereumConsensus.Beacon.PendingBlocks do
4
4
5
5
The main purpose of this module is making sure that a blocks parent is already in the fork choice. If it's not, it will request it to the block downloader.
6
6
"""
7
-
8
-
useGenServer
9
7
requireLogger
10
8
11
9
aliasLambdaEthereumConsensus.ForkChoice
12
10
aliasLambdaEthereumConsensus.P2P.BlobDownloader
13
-
aliasLambdaEthereumConsensus.P2P.BlockDownloader
14
11
aliasLambdaEthereumConsensus.Store.BlobDb
15
12
aliasLambdaEthereumConsensus.Store.Blocks
16
13
aliasTypes.BlockInfo
@@ -22,137 +19,39 @@ defmodule LambdaEthereumConsensus.Beacon.PendingBlocks do
22
19
|{nil,:invalid|:download}
23
20
@typestate::nil
24
21
25
-
##########################
26
-
### Public API
27
-
##########################
22
+
@doc"""
23
+
If the block is not present, it will be stored as pending.
0 commit comments