archethic-foundation / archethic-node

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

Add Geopatch in node transaction #1576

Open Neylix opened 1 month ago

Neylix commented 1 month ago

Is your feature request related to a problem?

The election of storage nodes and validation nodes is based on the geopatch of the current authorized nodes. This geopatch is calculated from the IP address of the nodes, but it is calculated locally and based on MMDB2 database.

For verification purpose we need to remake the election of an old transaction at the time it was validated. While we can technically retrieve the geopatch of a node at a specific time it could not work if the MMDB2 database is updated

Describe the solution you'd like

When a node join the network or send a node update transaction, it could include the geopatch it calculated locally and so validation nodes could ensure the geopatch is valid. Then instead of relying to a local calculated geopatch, the local p2p view could be filled with the validated geopatch of the node transaction. Hence even if the MMDB2 database is updated we could easily retrieve the geopatch of a node at a specific date through it's transaction chain.

Also notice that an update of the geopatch will update the election of storage nodes and so nodes need to reorganize their data using the Notifier.

Additional context

During the deployment of the release containing this update, a migration task needs to be runned to create a new node transaction for each node to setup their geopatch.

Epic

No response