rollmint icon indicating copy to clipboard operation
rollmint copied to clipboard

[Feature Request]: Add a separate flag for mock DA server or improve conditional

Open a26nine opened this issue 5 months ago • 0 comments

Implementation ideas

Looking at the code: https://github.com/rollkit/rollkit/blob/a95825f7ac1a1813acd3a7ced71aa838efa0cefb/cmd/rollkit/commands/run_node.go#L121-L129

It seems a mock DA server is initialised if the user doesn't pass a value with the --rollkit.da_address flag explicitly.

The default value for --rollkit.da_address is http://localhost:26658 as seen here: https://github.com/rollkit/rollkit/blob/a95825f7ac1a1813acd3a7ced71aa838efa0cefb/config/defaults.go#L30

(As in a real world situation) If the user is running a local light node with default config, it would run on localhost at port 26658. So, it is expected that the rollkit rollup should connect to the local light node by default.

However, based on the conditional here: https://github.com/rollkit/rollkit/blob/a95825f7ac1a1813acd3a7ced71aa838efa0cefb/cmd/rollkit/commands/run_node.go#L122

A mock DA server is initialised if the user doesn't pass a value with the --rollkit.da_address flag. On the contrary, a mock DA server is not initialised if a value is passed that flag, even if it's the default value.

Meaning, to apply the default value and avoid creating a mock DA server, the user needs to explicitly pass --rollkit.da_address http://localhost:26658.

It's not good UX. Therefore, a couple of suggestions to improve it:

  1. Add a flag to initiate or toggle a mock DA server, or,
  2. Improve the conditional to check if a light node is running at the default address, and decide if the mock DA server needs to be created based on that.

a26nine avatar Aug 27 '24 00:08 a26nine