Open riemannulus opened 1 year ago
If we remove BlockChain<T>.Swap()
in Swarm.PreloadAsync()
, we need to decision for inevitable behavior changes.
Swarm.CompleteBlockAsync()
, it appends all candidate blocks without evaluation action. https://github.com/planetarium/libplanet/blob/ff823f8435133689fcbd3f26508e40a2eab969ae/Libplanet.Net/Swarm.BlockSync.cs#L517-L522Swarm.CompleteBlockAsync()
directly to the current main BlockChain<T>
, main BlockChain<T>
is processed to the topmost block but local states do not.BlockChain<T>
, TrieState
does not reflect BlockChain<T>
when it's node run again.rn, I have some trade-offs for solving this problem.
BlockChain<T>.Append()
is atomic and quit-proof(?).Have any ideas? @longfin /cc. @libplanet
Rollback lazy-execute behavior. But I'm not sure this is the best solution.
Also, I'm not sure if
BlockChain<T>.Append()
is atomic and quit-proof(?).
I agree that this can be difficult, but also think it's easier this way than complicating others.
So, your idea is rollback lazy-execute behavior is not the worst plan in this situation?
I have no strong opinion about this so if you think so, I'll do it like that.
So, your idea is rollback lazy-execute behavior is not the worst plan in this situation?
Right. 😄
This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.
Context
BlockChain<T>.Swap()
andBlockChain<T>.Fork
inSwarm.PrealodAsync()
andSwarm.CompleteBlocksAsync()
is useless in the PBFT scenario. There is only one canonical chain in the network so we do not support multiple chain branches.And
BlockChain<T>.Swap()
is slow as much as when branches are long. So we suggest removingBlockChain<T>.Swap()
inSwarm.PreloadAsync()