Skip to content

Support supplying NodeConfig via AddNode RPC call #572

@marun

Description

@marun

The AddNode RPC API appears to accept NodeConfig (enabling the caller to specify any relevant configuration value for a new node), but actually converts the values supplied as NodeConfig to flags for the invocation of avalanchego that starts the node. This seems potentially problematic:

  • a caller trying to supply NodeConfig values (e.g. stakingKey) will see node addition fail with ANR logging avalanchego's complaint that the flag name is unrecognized:
    • [my-new-node-1] couldn't configure flags: unknown flag: --stakingKey
  • a caller providing a NodeConfig value as a flag (e.g. --staking-tls-key-contents) will be able to set the value provided to the invocation of avalanchego but the internal addNode method won't use it.
  • In the specific case of --staking-tls-key-contents being specified in an RPC call to AddNode, the internal addNode method always generates a new value for stakingKey and uses it to derive the node ID such that a new node's ID could be one thing in the network and another in ANR.
  • However, it's non-trivial to correctly supply a key as a flag to AddNode via RPC, as that requires being able to reliably round-trip a key through proto to a commandline arg. If the current approach of only configuring node addition via flags were to continue, more documentation might be suggested. Following the example of supplying a stringified key (modulo escaping newlines) results in an error:
    • rpc error: code = Unknown desc = invalid character '-' after object key

Resolution of at least some of these concerns will aid in the migration of one of the Kurtosis tests (ava-labs/avalanchego#1573).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Backlog 🧊

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions