From b2af935c2f5a2b06149b2ba4e5adf291ac0189e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Arjovsky?= Date: Fri, 14 Jun 2024 16:43:02 +0200 Subject: [PATCH] Update architecture model --- docs/architecture.md | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/docs/architecture.md b/docs/architecture.md index 8f708556b..6c5b43ad7 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -2,6 +2,21 @@ ## Processes summary +Some GenServers to be deleted soon: + +Easy difficulty: +- Metadata: can be replaced with db calls entirely. +- BeaconChain: can be deleted and its calls replaced by ForkChoice db calls. +- Peerbook: can be maintained in the db. Doesn't need to be a pid to be a handler. +- IncomingRequests.Receiver: Genserver that receives incoming requests and dispatches them to a handler task. We should handle the tasks directly in port. The genserver is "needed" because of the set_handler primitive. + +Medium difficulty: +- Validators: more complicated. May be replaced by libraries that react on slots. Need to be more thought. The most complicated part is independent failure. +- ExecutionChain: the tricky part is the deposit tree, but the rest can be calculated after state transition succeeds. + +Not to be deleted soon: +- SyncBlocks. It's an init task. It needs to be revisited only to see if it holds well against restarts. + ### Supervision tree This is our complete supervision tree. @@ -23,16 +38,10 @@ Application --> BeaconNode Application --> BeaconApi.Endpoint BeaconNode -->|genesis_time,
genesis_validators_root,
fork_choice_data, time| BeaconChain -BeaconNode -->|store, head_slot, time| ForkChoice BeaconNode -->|listen_addr,
enable_discovery,
discovery_addr,
bootnodes| P2P.Libp2pPort BeaconNode --> P2P.Peerbook BeaconNode --> P2P.IncomingRequests -BeaconNode --> PendingBlocks BeaconNode --> SyncBlocks -BeaconNode --> Attestation -BeaconNode --> BeaconBlock -BeaconNode --> BlobSideCar -BeaconNode --> OperationsCollector BeaconNode -->|slot, head_root| ValidatorManager BeaconNode -->|genesis_time, snapshot, votes| ExecutionChain ValidatorManager --> ValidatorN