rollmint icon indicating copy to clipboard operation
rollmint copied to clipboard

Refactor node creation in tests

Open tzdybal opened this issue 9 months ago • 1 comments

There are multiple functions to create node instances. Lot of the code is duplicated. We should create single helper (function on struct) for creating nodes.

Configuration / possible inputs:

  • context
  • ABCI App
  • is aggregator
  • is full/light
  • chain ID
  • genesis / consensus params / ABCI params (VoteExtensionsEnableHeight in particular)
  • persistence (DBPath in particular)
  • DA implementation (to enable mocking)
    • or DA address & namespace for "default" config
  • block manager config

For each possible input there should be a reasonable default value.

Possible outputs:

  • Node (duh)
  • App (may be needed if it was not provided)
  • Keys (p2p key, signing key)

Originally mentioned in: https://github.com/rollkit/rollkit/pull/1641#discussion_r1579991628 and https://github.com/rollkit/rollkit/pull/1641#discussion_r1580038953.

Later mentioned in: https://github.com/rollkit/rollkit/pull/1690#discussion_r1636414334

tzdybal avatar Apr 26 '24 14:04 tzdybal

Related: https://github.com/rollkit/rollkit/issues/1703

Manav-Aggarwal avatar Jun 18 '24 22:06 Manav-Aggarwal