Config: Add explicit observer mode and storage kind #6489
Config: Add explicit observer mode and storage kind #6489martintomazic wants to merge 5 commits intomasterfrom
Conversation
✅ Deploy Preview for oasisprotocol-oasis-core canceled.
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #6489 +/- ##
==========================================
+ Coverage 64.01% 64.09% +0.08%
==========================================
Files 698 698
Lines 68195 68198 +3
==========================================
+ Hits 43655 43713 +58
+ Misses 19499 19460 -39
+ Partials 5041 5025 -16 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
eb8ac90 to
9ba3bd6
Compare
| if config.GlobalConfig.Consensus.StateKind == consensusCfg.StateKindStateless { | ||
| return nil // Ignore transactions on stateless clients. | ||
| } |
There was a problem hiding this comment.
I can bring this in using cfg.accept_gossiped_txs to avoid global state.
The location of this handler is weird though, as this protocol is anyways enabled only for the compute nodes, therefore it doe not fit into common package.
| // If we have stateless storage, register remote storage. | ||
| // TODO: Client worker should not care about the storage kind. | ||
| // Instead storage initialization should be done during node initialization. | ||
| // Same applies for storage committee worker that initializes and registers local storage, but | ||
| // should intead receive it. | ||
| if config.GlobalConfig.Consensus.StateKind == consensusCfg.StateKindStateless { |
There was a problem hiding this comment.
We can do this in two ways:
- Add new
registry.Runtime.GetLocalStoragethat returns local storage if it exits. - Initialize local storage at the node startup and then pass it to common worker (to set it into Runtime container) and to storage worker.
Both options are nice because we can completely decouple storage committee and common worker. Out of scope of this PR, but let's open a separate issue for that...
| ) (*Worker, error) { | ||
| ctx, cancel := context.WithCancel(context.Background()) | ||
| enabled := config.GlobalConfig.Mode.HasLocalStorage() && len(commonWorker.GetRuntimes()) > 0 | ||
| enabled := config.GlobalConfig.HasLocalStorage() && len(commonWorker.GetRuntimes()) > 0 |
There was a problem hiding this comment.
Follow-up: This worker shouldn't even be started if no local storage || zero runtimes.
3907d37 to
5edb28b
Compare
5edb28b to
36458ff
Compare
f09088e to
9b99580
Compare
36458ff to
7904cf5
Compare
| {name: "keymanager", mode: ModeKeyManager, mustErr: true}, | ||
| {name: "seed", mode: ModeSeed, mustErr: true}, |
There was a problem hiding this comment.
Key-manager is technically stateless. Keymanager and seed should probably have separate config, as most of the configs that apply to client/compute are possible (not rejected) but simply ignored.
Out of scope, just this test makes it clearer.
HasLocalStorage variable was misleading as archive node has the local storage yet the variable was set to false for it. Long term solution is to stop abusing light history for tracking storage worker progress, by possibly following NodeDB last synced round directly.
7904cf5 to
3a8941f
Compare
Closes #6488, follows #6481.