Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix beacon live updates #247

Merged
2 commits merged into from
Mar 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/archethic/beacon_chain/subset.ex
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ defmodule ArchEthic.BeaconChain.Subset do

subscribed_nodes
|> P2P.get_nodes_info()
|> Enum.reject(&(&1.first_public_key == Crypto.first_node_public_key()))
|> P2P.broadcast_message(attestation)

# Request the P2P view sampling if the not perfomed from the last 3 seconds
Expand Down
15 changes: 0 additions & 15 deletions lib/archethic/pub_sub.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ defmodule ArchEthic.PubSub do
alias ArchEthic.PubSubRegistry

alias ArchEthic.TransactionChain.Transaction
alias ArchEthic.TransactionChain.TransactionSummary

@doc """
Notify the registered processes than a new transaction has been validated
Expand Down Expand Up @@ -73,13 +72,6 @@ defmodule ArchEthic.PubSub do
dispatch(:next_summary_time, {:next_summary_time, date})
end

@doc """
Notify added new transaction summary in subset to the subscribers
"""
def notify_added_new_transaction_summary(tx_summary = %TransactionSummary{}) do
dispatch(:added_new_transaction_summary, {:added_new_transaction_summary, tx_summary})
end

@doc """
Notify next epoch of slot time
"""
Expand Down Expand Up @@ -162,13 +154,6 @@ defmodule ArchEthic.PubSub do
Registry.register(PubSubRegistry, :next_summary_time, [])
end

@doc """
Register a process to added new transaction summary to beacon chain slot
"""
def register_to_added_new_transaction_summary do
Registry.register(PubSubRegistry, :added_new_transaction_summary, [])
end

@doc """
Register a process to sent current epoch of slot time
"""
Expand Down
2 changes: 1 addition & 1 deletion lib/archethic_web/live/chains/beacon_live.ex
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ defmodule ArchEthicWeb.BeaconChainLive do
if connected?(socket) do
PubSub.register_to_next_summary_time()
# register for client to able to get the current added transaction to the beacon pool
PubSub.register_to_added_new_transaction_summary()
PubSub.register_to_current_epoch_of_slot_time()
PubSub.register_to_new_replication_attestations()
end

beacon_dates =
Expand Down