Skip to content

Config: Add explicit observer mode and storage kind #6489

Open
martintomazic wants to merge 5 commits intomasterfrom
martin/breaking/explicit-observer-mode
Open

Config: Add explicit observer mode and storage kind #6489
martintomazic wants to merge 5 commits intomasterfrom
martin/breaking/explicit-observer-mode

Conversation

@martintomazic
Copy link
Copy Markdown
Contributor

@martintomazic martintomazic commented Mar 27, 2026

Closes #6488, follows #6481.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 27, 2026

Deploy Preview for oasisprotocol-oasis-core canceled.

Name Link
🔨 Latest commit 3a8941f
🔍 Latest deploy log https://app.netlify.com/projects/oasisprotocol-oasis-core/deploys/69df959296f8a300087d003b

Comment thread go/consensus/cometbft/config/config.go Outdated
Comment thread go/consensus/cometbft/config/config.go Outdated
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 27, 2026

Codecov Report

❌ Patch coverage is 70.21277% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.09%. Comparing base (fc6b712) to head (5edb28b).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
go/oasis-node/cmd/node/node.go 30.00% 5 Missing and 2 partials ⚠️
go/consensus/cometbft/cometbft.go 66.66% 1 Missing and 1 partial ⚠️
go/consensus/cometbft/config/config.go 60.00% 2 Missing ⚠️
go/config/config.go 66.66% 1 Missing ⚠️
go/runtime/history/history.go 87.50% 0 Missing and 1 partial ⚠️
go/worker/client/worker.go 50.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@martintomazic martintomazic force-pushed the martin/breaking/explicit-observer-mode branch from eb8ac90 to 9ba3bd6 Compare March 30, 2026 13:59
Comment thread go/worker/common/committee/p2p.go Outdated
Comment on lines +40 to +42
if config.GlobalConfig.Consensus.StateKind == consensusCfg.StateKindStateless {
return nil // Ignore transactions on stateless clients.
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread go/worker/client/worker.go Outdated
Comment on lines +159 to +164
// 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 {
Copy link
Copy Markdown
Contributor Author

@martintomazic martintomazic Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can do this in two ways:

  1. Add new registry.Runtime.GetLocalStorage that returns local storage if it exits.
  2. 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...

Comment thread go/oasis-node/cmd/node/node.go Outdated
Comment thread go/worker/storage/worker.go Outdated
) (*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
Copy link
Copy Markdown
Contributor Author

@martintomazic martintomazic Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up: This worker shouldn't even be started if no local storage || zero runtimes.

Comment thread go/oasis-node/cmd/node/node_control.go Outdated
@martintomazic martintomazic force-pushed the martin/breaking/explicit-observer-mode branch 3 times, most recently from 3907d37 to 5edb28b Compare April 7, 2026 08:51
@martintomazic martintomazic marked this pull request as ready for review April 7, 2026 09:13
Comment thread .changelog/6488.cfg.1.md Outdated
Comment thread go/consensus/cometbft/config/config.go Outdated
Comment thread go/consensus/cometbft/cometbft.go Outdated
Comment thread go/oasis-node/cmd/node/node.go Outdated
@martintomazic martintomazic force-pushed the martin/breaking/explicit-observer-mode branch from 5edb28b to 36458ff Compare April 13, 2026 12:15
@martintomazic martintomazic changed the base branch from master to martin/trivial/observer-e2e-test April 13, 2026 12:23
@martintomazic martintomazic force-pushed the martin/trivial/observer-e2e-test branch from f09088e to 9b99580 Compare April 14, 2026 14:49
Base automatically changed from martin/trivial/observer-e2e-test to master April 14, 2026 15:15
@martintomazic martintomazic force-pushed the martin/breaking/explicit-observer-mode branch from 36458ff to 7904cf5 Compare April 14, 2026 15:34
@martintomazic martintomazic requested a review from kostko April 14, 2026 16:04
Comment thread go/config/config_test.go
Comment on lines +20 to +21
{name: "keymanager", mode: ModeKeyManager, mustErr: true},
{name: "seed", mode: ModeSeed, mustErr: true},
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread go/oasis-node/cmd/node/node.go Outdated
Comment thread go/oasis-node/cmd/node/node.go
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.
@martintomazic martintomazic force-pushed the martin/breaking/explicit-observer-mode branch from 7904cf5 to 3a8941f Compare April 15, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add explicit observer mode to the node config

2 participants