[go: up one dir, main page]

EVM/Kernel: let's have our own Runtime

Everything everywhere all at once

Following !14798 (merged), this MR introduces our own runtime that is used all along the kernel, so that we have access to new host functions and functionalities that can be implemented directly in it.

There is "peneloping", but actually each commit serves to ease the review and understand exactly how we end up to this state, and why this is actually a simple refactoring.

The only drawback is that the pattern

let mut host = MockHost::default(); 
let mut internal = MockInternal(); 
let mut host = KernelHost { host: &mut host, internal: &mut internal };

is repeated for each test. It cannot be made into a function as otherwise the function would allocate host and internal, and thesewould escape their scope.

Manually testing the MR

Trust the CI, if it fails this means that the refactoring is wrong somewhere.

Checklist

  • Document the interface of any function added or modified (see the coding guidelines)
  • Document any change to the user interface, including configuration parameters (see node configuration)
  • Provide automatic testing (see the testing guide).
  • For new features and bug fixes, add an item in the appropriate changelog (docs/protocols/alpha.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR

Merge request reports

Loading