node.proto 5.1 KB

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