archethic-foundation / archethic-node

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

Make sure the P2P view is up-to-date before to sync transactions #509

Closed ghost closed 2 years ago

ghost commented 2 years ago

Is your feature request related to a problem?

During the self-repair, we are downloading beacon summary and aggregates them. Then we are trying to synchronize missed transactions and after sync the P2P view.

The problem is when a node with a better network connection will sync faster than another; the another one will be late in the P2P view update (as the transaction synchronization takes longer than P2P view update)

This might cause validation node election errors, and failure of transaction validation until complete sync.

Describe the solution you'd like

So in order to tackle this problem, we might change the ordering of processing in lib/archethic/self_repair/sync.ex in the process_summary_aggregate/2 fn.

  1. Update the P2P view
  2. Synchronize the transactions

Additional context

No response

ghost commented 2 years ago

Hey team! Please add your planning poker estimate with ZenHub @apoorv-2204 @imnik11 @Neylix @prix-uniris

apoorv-2204 commented 2 years ago

updating p2p view first instead of :beacon ??

ghost commented 2 years ago

Not at all, instead of synchronize transactions then update P2P, we can do the opposite.