zksync-era icon indicating copy to clipboard operation
zksync-era copied to clipboard

feat(node_framework): Add a custom setup hook

Open popzxc opened this issue 1 year ago • 0 comments
trafficstars

⚠️ To be superseded by a different approach.

What ❔

Adds the ability to implement a custom setup hook with access to context able to retrieve resources and spawn tasks early.

Why ❔

Often there may be some code that we want to run before we actually launch the node. As a simple case, check if the genesis batch info is present in the DB. It would be nice to do it:

  • From within the framework to avoid responsibility split.
  • With access to the service lifecycle (e.g. if we're performing some long operation, we would want to first spawn the healthcheck server).

Checklist

  • [ ] PR title corresponds to the body of PR (we generate changelog entries from PRs).
  • [ ] Tests for the changes have been added / updated.
  • [ ] Documentation comments have been added / updated.
  • [ ] Code has been formatted via zk fmt and zk lint.
  • [ ] Spellcheck has been run via zk spellcheck.
  • [ ] Linkcheck has been run via zk linkcheck.

popzxc avatar Feb 29 '24 09:02 popzxc