Rollup node: use same L1 node connection for head monitoring
What
This MR makes the rollup node share the L1 connection for head monitoring between the different components that may need it.
Why
Duplicating the connection to the L1 node consumes unnecessary ressources, and puts additional strain on the L1 node.
How
- The crawler library maintains a single connection to the L1 node for monitoring heads.
- Other components that want to subscribe to the same heads stream can reuse the same
l1_ctxt
. - The stream is cloned on iteration to avoid one component having effects on another one.
- Components that detect an error in the L1 connection can ask for a reconnection, and all components that await are made aware of the reconnection once it is effective.
Manually testing the MR
Tezt test
dune exec tezt/tests/main.exe -- -f sc_rollup.ml -t 'Alpha: wasm_2_0_0 - maintenance of inbox in the rollup node (disconnects)'
Manual test
Run the rollup node with a remote L1 Octez node and either
- disconnect from network
- sleep the computer
- C-z on the process and resume with
fg
.
Edited by Alain Mebsout