archethic-foundation / archethic-foundation/archethic-node

Handle replication latency

Open
#948 1 comment 0 reactions 1 assignee Claimed by @Neylix View on GitHub
enhancements replication to-analyze
Dominant language
Elixir
Stars
82
Forks
24
PR merge metrics
No merged PRs in 30d

Description

### 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](https://user-images.githubusercontent.com/26260538/225865317-5e694395-a4e2-4b09-ad1a-0c888d5df188.png)

### 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

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.