EOSIO / demux-js

💫 Deterministic event-sourced state and side effect handling for blockchain applications
MIT License
307 stars 71 forks source link

Add option to turn off ActionHandler block hash consistency validation #172

Closed flux627 closed 5 years ago

flux627 commented 5 years ago

Some implementors of the AbstractActionHandler want to opt-out of validating block hash consistency, allowing the assumption to be made that the ActionReader is fulfilling its responsibility to do so. While potentially increasing the risk of uncaught determinism bugs, this has the advantage of allowing the implemented ActionHandler to skip irrelevant blocks.

This PR adds a configuration option validateBlockHashes to ActionHandlerOptions (defaulting to true for safety) that, when false, will skip the block validation step when processing new blocks.

olivierbeaulieu commented 5 years ago

Looking good. Should we add a couple unit tests to validate the behaviour?