Repository navigation
Test: validator_update is delegable to an agent key - #269
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
validator_guardholds a private key per monitored validator and signsvalidator_updatewith it. The open question: can that key be an agent key scoped tovalidator_update(HF15 agent access) instead of the account'sactivekey — so a node host never needs the account's active key?Reading the code says yes:
validator_updateis not innever_delegable_operation_names()(libraries/protocol/agent_operations.cpp), andverify_authorityfalls 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.cppusedvalidator_updateonly 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 namingvalidator_update; a transaction signed only by the agent key rotates the validator's block signing key, and thevalidator_object.signing_keyon chain changes.agent_access_validator_update_needs_the_grant— the same agent key with a row namingtransferis 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-onlyon the edited scenario: rc 0.🤖 Generated with Claude Code