It would be nice to be able to easily test validations of multiple blocks in sequence. For example, verifying if one block creates outputs, the next one can spend them.
But for that we need a consolidate_block function, which is currently defined in ChainManager and depends on actix. So we need to move that logic to the witnet_data_structures or the witnet_validations crate, in order to be able to write more validations tests.
The actix dependency can be removed by either returning all the needed information (for example, the list of reveals which need to be broadcasted through the network) and handling it in the caller, or by exposing a callback API so we can execute arbitrary code at arbitrary points in the consolidation process. Maybe some things can be extracted as a separate function, for example sending the JSON-RPC block notifications should not interfere with the consolidation.
This would be useful now to verify that any changes to validations do not affect old blocks from the mainnet. That's useful to verify that new nodes will be able to sync from the beginning.
It would be nice to be able to easily test validations of multiple blocks in sequence. For example, verifying if one block creates outputs, the next one can spend them.
But for that we need a
consolidate_block
function, which is currently defined inChainManager
and depends on actix. So we need to move that logic to thewitnet_data_structures
or thewitnet_validations
crate, in order to be able to write more validations tests.The actix dependency can be removed by either returning all the needed information (for example, the list of reveals which need to be broadcasted through the network) and handling it in the caller, or by exposing a callback API so we can execute arbitrary code at arbitrary points in the consolidation process. Maybe some things can be extracted as a separate function, for example sending the JSON-RPC block notifications should not interfere with the consolidation.