Skip to content

validator_guard: do not call a working agent key a broken one - #271

Merged
On1x merged 1 commit into
masterfrom
guard-agent-authority
Nov 9, 2026
Merged

On1x merged 1 commit into
masterfrom
guard-agent-authority

Conversation

@On1x

@On1x On1x commented Nov 9, 2026

Copy link
Copy Markdown
Member

Problem

The startup authority check (plugin_initialize) looks only at account_authority_object.active.key_auths:

validator_guard: WARNING: Configured active key for validator 'faucet3' does NOT have authority on-chain. Restoration will fail.

An agent key (HF15) is by design not in active.key_auths, yet it can sign validator_update. Measured on testnet 2026-11-09: with faucet3 holding a null signing key and an agent granted only validator_update, that warning was printed at every start — and the agent-signed update did rotate the validator signing key.

So the plugin reports "restoration will fail" about a setup it is about to make work. That is misleading exactly for the deployment this feature is aimed at (a host that holds a scoped agent key instead of the account's active key).

Change

When the configured key is not in active.key_auths, ask the same hook the chain uses — graphene::chain::agent_operation_allowed(db, validator_update_operation{owner}, owner, key):

  • delegated → ilog … is an AGENT key with delegated 'validator_update' — restoration will use it;
  • neither → the warning stays, now naming what is missing ("and holds no agent grant for 'validator_update'").

An exception from the probe falls through to the warning, not to the reassuring branch: "could not check" must not read as "allowed".

Verification

  • single-TU -fsyntax-only: rc 0.
  • No selftest exists for this plugin (it is driven by a live node); the branch builds through docker-pr-build.yml and the log line can be checked live on testnet the same way the transport fix was (null key + agent grant).

🤖 Generated with Claude Code

The startup authority check looked only at account_authority_object.active.key_auths.
An agent key (HF15) is by design NOT there, yet it can sign validator_update, so the
plugin told the operator 'Restoration will fail' about a configuration that works —
measured on testnet 2026-11-09: the agent-signed update rotated the validator signing
key while this warning was printed at every start.

Ask the same hook the chain uses (agent_operation_allowed) with a validator_update
probe for that principal and key. Delegated -> ilog naming it; neither active nor
delegated -> the warning stays, and now says what is actually missing.

An inconclusive probe (exception) falls through to the warning rather than to the
reassuring branch: 'could not check' must not read as 'allowed'.
@On1x
On1x merged commit 2ac933f into master Nov 9, 2026
5 checks passed
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.

1 participant