Skip to content

Commit a6526d8

Browse files
authored
refactor: move subscriptions directly to operations_collector (#1052)
1 parent a3d749a commit a6526d8

File tree

6 files changed

+126
-212
lines changed

6 files changed

+126
-212
lines changed

lib/lambda_ethereum_consensus/beacon/beacon_node.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ defmodule LambdaEthereumConsensus.Beacon.BeaconNode do
5050
LambdaEthereumConsensus.P2P.IncomingRequests,
5151
LambdaEthereumConsensus.Beacon.PendingBlocks,
5252
LambdaEthereumConsensus.Beacon.SyncBlocks,
53-
LambdaEthereumConsensus.P2P.GossipSub,
5453
LambdaEthereumConsensus.P2P.Gossip.Attestation,
5554
LambdaEthereumConsensus.P2P.Gossip.BeaconBlock,
56-
LambdaEthereumConsensus.P2P.Gossip.BlobSideCar
55+
LambdaEthereumConsensus.P2P.Gossip.BlobSideCar,
56+
LambdaEthereumConsensus.P2P.Gossip.OperationsCollector
5757
] ++ validator_children
5858

5959
Supervisor.init(children, strategy: :one_for_all)

lib/lambda_ethereum_consensus/beacon/sync_blocks.ex

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,19 @@ defmodule LambdaEthereumConsensus.Beacon.SyncBlocks do
7373

7474
if Enum.empty?(chunks) do
7575
Logger.info("[Optimistic Sync] Sync completed")
76-
Gossip.BeaconBlock.start()
77-
Gossip.BlobSideCar.start()
76+
start_subscriptions()
7877
else
7978
Process.sleep(1000)
8079
perform_sync(remaining_chunks)
8180
end
8281
end
8382

83+
defp start_subscriptions() do
84+
Gossip.BeaconBlock.start()
85+
Gossip.BlobSideCar.start()
86+
Gossip.OperationsCollector.start()
87+
end
88+
8489
@spec fetch_blocks_by_slot(Types.slot(), non_neg_integer()) ::
8590
{:ok, [SignedBeaconBlock.t()]} | {:error, String.t()}
8691
def fetch_blocks_by_slot(from, count) do

lib/lambda_ethereum_consensus/p2p/gossip/consumer.ex

Lines changed: 0 additions & 57 deletions
This file was deleted.

lib/lambda_ethereum_consensus/p2p/gossip/gossipsub.ex

Lines changed: 0 additions & 42 deletions
This file was deleted.

lib/lambda_ethereum_consensus/p2p/gossip/handler.ex

Lines changed: 0 additions & 79 deletions
This file was deleted.

0 commit comments

Comments
 (0)