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

Fix incorrect mapping between dynasty and epoch #1026

Closed kostyantyn closed 5 years ago

kostyantyn commented 5 years ago

The bug was that epoch number in m_dynasty_start_epoch was one less than it should be. This allows finalizer to withdraw one epoch earlier than expected. Test rpc_finalization.py was extended to catch the bug and esperanza_widthdraw.py was adjusted accordingly.

The m_epoch_to_dynasty mapping was removed (instead of fixing it) as it wasn't used. Supporting fewer states reduces the chance of data unsynchronization.

Signed-off-by: Kostiantyn Stepaniuk kostia@thirdhash.com

frolosofsky commented 5 years ago

utACK 5c2ad528e475423d86602f759853c26cfecc7054 except GetCurrentDynastyEpochStart which is too specific in my opinion, must die, and new GetDynastyEpochStart(uint32_t dynasty) born instead.

kostyantyn commented 5 years ago

force-pushed as had conflicts with master

kostyantyn commented 5 years ago

force-pushed as another conflict appeared

frolosofsky commented 5 years ago

utACK 8d4b56a4b3c0081396ea59c2c79c233533ce85eb