Skip to content

Test: validator_update is delegable to an agent key - #269

Merged
On1x merged 1 commit into
masterfrom
agent-validator-update-test
Nov 9, 2026
Merged

On1x merged 1 commit into
masterfrom
agent-validator-update-test

Conversation

@On1x

@On1x On1x commented Nov 9, 2026

Copy link
Copy Markdown
Member

Why

validator_guard holds a private key per monitored validator and signs validator_update with it. The open question: can that key be an agent key scoped to validator_update (HF15 agent access) instead of the account's active key — so a node host never needs the account's active key?

Reading the code says yes: validator_update is not in never_delegable_operation_names() (libraries/protocol/agent_operations.cpp), and verify_authority falls through to the agent hook (libraries/chain/agent_evaluator.cpp) when the ordinary active signature is missing. But that path had no coverage: test_agent_access.cpp used validator_update only to register the fixture validator.

What

Two cases in tests/consensus_sim/scenarios/test_agent_access.cpp:

  • agent_access_validator_update_is_delegable — an agent row naming validator_update; a transaction signed only by the agent key rotates the validator's block signing key, and the validator_object.signing_key on chain changes.
  • agent_access_validator_update_needs_the_grant — the same agent key with a row naming transfer is rejected and the signing key stays unchanged.

Both use the existing HF15 fixture (marker-switched fork, no wall-clock dependency). Consensus-sim targets are BUILD_TESTNET-only, so the testnet CI job runs them.

Single-TU -fsyntax-only on the edited scenario: rc 0.

🤖 Generated with Claude Code

validator_guard holds a private key per monitored validator and signs
validator_update with it; the question was whether that key can be an agent
key scoped to validator_update instead of the account's active key.

The chain says yes: validator_update is not in never_delegable_operation_names()
and its active authority is checked through the same hook as every other
operation, so an agent row naming it is enough. Until now that path had no
test — test_agent_access.cpp used validator_update only to register the
fixture validator.

Two cases:
  - with the grant, a transaction signed ONLY by the agent key rotates the
    validator's block signing key;
  - without it (row names transfer), the same key is rejected and the key on
    chain stays unchanged.

Consensus-sim is BUILD_TESTNET-only, so CI's testnet job runs these.
@On1x
On1x merged commit 6da2d37 into master Nov 9, 2026
8 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