-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(block): move da init to NewNode instead of NewManager #1332
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1332 +/- ##
==========================================
- Coverage 17.72% 17.12% -0.61%
==========================================
Files 187 203 +16
Lines 55555 60906 +5351
==========================================
+ Hits 9849 10430 +581
- Misses 44182 48870 +4688
- Partials 1524 1606 +82 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think the current solution will not work since it loads the da type from genesis, and it may happen is not defined there (migrated rollapps) or it has changed since genesis definition. IMO there are three options to enable lightweight block manager, without active SL client or DA client.
1 - readd da type in config, and instead of instantiating the da from rollapp param, only validate the da created is the same as the rollapp param on blockmanager start(), and panic in case is not. this way da can be passed to the block manager.
2 - instead of creating the da in the NewManager() moving it to start() func. this way a lightweight block manager can be created without da.
3 - avoid that da init() creates any connection (e.g. with da light client), just reading config and init logic. this way it will not be a problem when creating lightweight block manager and it will not fail (it will just require valid config params, but could be default params).
dalcKV := store.NewPrefixKV(baseKV, dalcPrefix) | ||
// Init the settlement layer client | ||
/* ------------------------------ init DA layer ----------------------------- */ | ||
params, err := types.GetRollappParamsFromGenesis(genesis.AppState) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if its a migrated rollapp, that does not have rollapp params defined in genesis? in that case i think it will fail to get rollapp params from genesis appstate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or also in case the da rollapp param is changed via gov proposal, the one defined in genesis wont be correct.
This allows to spin up a lightweight block manager, without active SL client or DA client