archethic-node icon indicating copy to clipboard operation
archethic-node copied to clipboard

Handle replication latency

Open Neylix opened this issue 1 year ago • 1 comments

Describe the problem you discovered

Since we are using sharding and every transaction is considered as a block, we can have some issue when 2 transactions interacting with each other are validated in the same time. The main issue is that some inputs will be forwarded to an old address or just disappeared. Here is the cases where it can cause errors: image

Describe the solution you'd like

Here is an idea to solve the issue (this maybe a quick fix and not a final solution)

Whenever a node receive an input, it will check locally if the there is a new address in the inputs destination chain. If so the inputs could be forwarded to the storage node of the last address. Also when a storage node receive a notification that a new address is created in a chain, it will check if this new transaction timestamp is lower than one of the inputs from the previous transaction. If so, forward the inputs to last storage node.

There is maybe more edge case to take into account.

An issue with this behavior is that we will have inconsistencies between the inputs and the unspent outputs of the validation stamp, or the resolved address in the validation stamp may not match the real destination address

Neylix avatar Mar 17 '23 09:03 Neylix

This would be resolved with implementation of AEIP21

Neylix avatar Jul 27 '23 06:07 Neylix