node.proto 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. syntax = "proto3";
  2. package node.v1;
  3. option go_package = "github.com/certusone/wormhole/node/pkg/proto/node/v1;nodev1";
  4. // NodePrivilegedService exposes an administrative API. It runs on a UNIX socket and is authenticated
  5. // using Linux filesystem permissions.
  6. service NodePrivilegedService {
  7. // InjectGovernanceVAA injects a governance VAA into the guardian node.
  8. // The node will inject the VAA into the aggregator and sign/broadcast the VAA signature.
  9. //
  10. // A consensus majority of nodes on the network will have to inject the VAA within the
  11. // VAA timeout window for it to reach consensus.
  12. //
  13. rpc InjectGovernanceVAA (InjectGovernanceVAARequest) returns (InjectGovernanceVAAResponse);
  14. // FindMissingMessages will detect message sequence gaps in the local VAA store for a
  15. // specific emitter chain and address. Start and end slots are the lowest and highest
  16. // sequence numbers available in the local store, respectively.
  17. //
  18. // An error is returned if more than 1000 gaps are found.
  19. rpc FindMissingMessages (FindMissingMessagesRequest) returns (FindMissingMessagesResponse);
  20. }
  21. message InjectGovernanceVAARequest {
  22. // Index of the current guardian set.
  23. uint32 current_set_index = 1;
  24. // Sequence number. This is critical for replay protection - make sure the sequence number
  25. // is unique for every new manually injected governance VAA. Sequences are tracked
  26. // by emitter, and manually injected VAAs all use a single hardcoded emitter.
  27. //
  28. // We use random sequence numbers for the manual emitter.
  29. uint64 sequence = 2;
  30. // Random nonce for disambiguation. Must be identical across all nodes.
  31. uint32 nonce = 3;
  32. oneof payload{
  33. // Core module
  34. GuardianSetUpdate guardian_set = 10;
  35. ContractUpgrade contract_upgrade = 11;
  36. // Token bridge and NFT module
  37. BridgeRegisterChain bridge_register_chain = 12;
  38. BridgeUpgradeContract bridge_contract_upgrade = 13;
  39. }
  40. }
  41. message InjectGovernanceVAAResponse {
  42. // Canonical digest of the submitted VAA.
  43. bytes digest = 1;
  44. }
  45. // GuardianSet represents a new guardian set to be submitted to and signed by the node.
  46. // During the genesis procedure, this data structure will be assembled using off-chain collaborative tooling
  47. // like GitHub using a human-readable encoding, so readability is a concern.
  48. message GuardianSetUpdate {
  49. // List of guardian set members.
  50. message Guardian {
  51. // Guardian key pubkey. Stored as hex string with 0x prefix for human readability -
  52. // this is the canonical Ethereum representation.
  53. string pubkey = 1;
  54. // Optional descriptive name. Not stored on any chain, purely informational.
  55. string name = 2;
  56. };
  57. repeated Guardian guardians = 3;
  58. }
  59. // GuardianKey specifies the on-disk format for a node's guardian key.
  60. message GuardianKey {
  61. // data is the binary representation of the secp256k1 private key.
  62. bytes data = 1;
  63. // Whether this key is deterministically generated and unsuitable for production mode.
  64. bool unsafe_deterministic_key = 2;
  65. }
  66. message BridgeRegisterChain {
  67. // Module identifier of the token or NFT bridge (typically "TokenBridge" or "NFTBridge")
  68. string module = 1;
  69. // ID of the chain to be registered.
  70. uint32 chain_id = 2;
  71. // Hex-encoded emitter address to be registered (without leading 0x).
  72. string emitter_address = 3;
  73. }
  74. // ContractUpgrade represents a Wormhole contract update to be submitted to and signed by the node.
  75. message ContractUpgrade {
  76. // ID of the chain where the Wormhole contract should be updated (uint8).
  77. uint32 chain_id = 1;
  78. // Hex-encoded address (without leading 0x) address of the new program/contract.
  79. string new_contract = 2;
  80. }
  81. message BridgeUpgradeContract {
  82. // Module identifier of the token or NFT bridge (typically "TokenBridge" or "NFTBridge").
  83. string module = 1;
  84. // ID of the chain where the bridge contract should be updated (uint16).
  85. uint32 target_chain_id = 2;
  86. // Hex-encoded address (without leading 0x) of the new program/contract.
  87. string new_contract = 3;
  88. }
  89. message FindMissingMessagesRequest {
  90. // Emitter chain ID to iterate.
  91. uint32 emitter_chain = 1;
  92. // Hex-encoded (without leading 0x) emitter address to iterate.
  93. string emitter_address = 2;
  94. }
  95. message FindMissingMessagesResponse {
  96. // List of missing sequence numbers.
  97. repeated string missing_messages = 1;
  98. // Range processed
  99. uint64 first_sequence = 2;
  100. uint64 last_sequence = 3;
  101. }