Move the preapply RPC's backend to the validator process
Context
This MR moves the preapply
to the validator process. This MR also contains necessary refactoring that harmonizes the Block_validation
API. This allows the shell to cache the preapplication result in order to only commit when validating the same block. The resulting effect is that it divides by (roughly) 2 the time spent preapplying then validating a same block. In particular, this is the case for migration blocks that are baked by the node. This is necessary for Hangzhou's migration which will be highly time consuming.
Edited by vbot