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

Remove PoW #929

Closed scravy closed 5 years ago

scravy commented 5 years ago

The commits, in order:

  1. Removes PoW and moves (Contextual)?CheckBlock(Header)? functions to a component called LegacyValidationInterface
  2. Removes now useless nonce from header

The LegacyValidationInterface is a proper component and has two implementations: One that harbours the current *Check* functions (moved them, only thing I did is I adapted the code style as it's added in a new compilation unit). Unit tests and functional tests pass exactly as before with it.

A new implementation, since the API of BlockValidator and StakeValidator are different, will translate between the error-codes returned by BlockValidator::*Check* and CValidationState. In this pull this implementation is left empty for now to reduce the size of the changeset.

Reincarnation of https://github.com/dtr-org/unit-e/pull/433

This pull request alone should bring master into a state which can be deployed in testnet as is.

scravy commented 5 years ago

rebased to fix conflicts with master/commits merged in between. force-pushed.

cornelius commented 5 years ago

I like the design with the LegacyValidationInterface. That's a nice modularization.

I read through the changes and they look pretty straightforward to me. Somebody who is more familiar with this part of the code should have a look as well, though.

utACK 819fc3c

scravy commented 5 years ago

Rebased with master from 3131be4 to 11b3d34