calimero-network / core

Calimero 2.0
https://calimero-network.github.io/
Other
42 stars 3 forks source link

Implement initial context catchup #488

Closed fbozic closed 2 weeks ago

fbozic commented 1 month ago

Currently, the node performs catch-up in case of missing prior_hash upon receiving Transaction, or in case of TransactionRejection from the coordinator. The catch-up process is a blocking process by design on both sides (client and server).

Our first attempt to perform an initial catch-up upon receiving the Subscribed event led to a bunch of timeouts because when multiple nodes are started at the same time they try to perform catch-up at the same time, reference: https://github.com/calimero-network/core/blob/dd01008cd8a7352b1c417d5b56289f1e3f079250/crates/node/src/lib.rs#L578-L596

Initial ideas to tackle this issue:

fbozic commented 1 month ago

Initial estimation: ~1 week

fbozic commented 3 weeks ago

We decided to go with simple delayed tokio::time::interval_at as the initial implementation. The delay value will be generated randomly during configuration creation.

cc @MatejVukosav @miraclx