archethic-foundation / archethic-node

Official Archethic Blockchain node, written in Elixir
GNU Affero General Public License v3.0
75 stars 22 forks source link

Store past P2P view #1579

Open Neylix opened 1 month ago

Neylix commented 1 month ago

Is your feature request related to a problem?

With BLS implementation we need to recalculate the node election for a past transaction. But currently we cannot retrieve an accurate view of the authorized and available nodes at a specific date in the past.

Describe the solution you'd like

The module P2PView need to be updated to store the required information of the nodes and p2p view at a specific date to be able to get the right information to recalculate an election. This view needs to store for each summary:

The global availability and average availability could be indexed by summary time and updated during self repair. The node geopatch and last public key could be indexed by node and update time and updated when node update it through a transaction

Once this p2p view is created, the function P2P.authorized_and_available_nodes/1 should return the nodes with the P2P informations set at the requested time

Additional context

No response

Epic

No response