dtr-org / unit-e

A digital currency for a new era of decentralized trust
https://unit-e.io
MIT License
45 stars 15 forks source link

Use RPC to vote on parallel chain #1005

Closed Nizametdinov closed 5 years ago

Nizametdinov commented 5 years ago

Fixes #978 and makes feature_fork_choice_forked_finalize_epoch.py stable.

In #978, @frolosofsky wrote why the test was floating:

The issue happens because test creates two finalizers which act like being one. Once finalizer2 processes block which includes vote from finalizer1 and at the same moment tries to vote itself, it cannot find corresponding prev transaction in its wallet. This started to happen once #937 is merged, that PR makes validator, when voting, using global validator state instead of local one, and because of two finalizer are actually the same, it made a glitch between two finalizers which started sharing the same validator state.

I think it's not an issue for production code, we can simply rewrite test to use one validator, but make votes on different branches via rpc, like we double vote in #906.

frolosofsky commented 5 years ago

I'm not sure if this PR closes the issue, because we have another problem with this test: https://github.com/dtr-org/unit-e/issues/978#issuecomment-483317516. Maybe you can extract that problem in a separate issue, then we can close #978.

Nizametdinov commented 5 years ago

Ran feature_fork_choice_forked_finalize_epoch.py on Travis 2*100 times. It didn't fail.