archethic-foundation / archethic-foundation/archethic-node

Store past P2P view

Open
#1,579 0 comments 0 reactions 1 assignee Claimed by @Chralu View on GitHub
feature P2P
Dominant language
Elixir
Stars
82
Forks
24
PR merge metrics
No merged PRs in 30d

Description

### 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 of a node (remember that a node can change it's global availability after the self repair)
- the node geopatch (remember that a node can change it's geopatch during the day with a node transaction)
- the node average availability

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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.