[go: up one dir, main page]

Rollup node: remove lazy usage in workers

What

This MR removes the usage of lazy in the definitions of workers in the rollup node.

Why

This is a bad pattern because the worker module does not control entirely when this lazy value will be accessed (forced). For instance in the case of the batcher, it is possible for the injection RPC to be called before the worker is started which will make all future calls fail (because the lazy value has already been forced).

How

Use functions instead (the call is cheap anyway and consist in a single pattern matching).

Manually testing the MR

Call the RPC /local/batcher/injection before the worker is started (might be hard to time right). It should answer with an error 500:

[{"kind":"permanent","id":"sc_rollup.node.no_batcher"}]

Call is a second time after a while, it should now return 200 and not the same error.

Merge request reports

Loading