node.proto 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. // List of governance VAA messages to inject.
  25. repeated GovernanceMessage messages = 2;
  26. }
  27. message GovernanceMessage {
  28. // Sequence number. This is critical for replay protection - make sure the sequence number
  29. // is unique for every new manually injected governance VAA. Sequences are tracked
  30. // by emitter, and manually injected VAAs all use a single hardcoded emitter.
  31. //
  32. // We use random sequence numbers for the manual emitter.
  33. uint64 sequence = 2;
  34. // Random nonce for disambiguation. Must be identical across all nodes.
  35. uint32 nonce = 3;
  36. oneof payload{
  37. // Core module
  38. GuardianSetUpdate guardian_set = 10;
  39. ContractUpgrade contract_upgrade = 11;
  40. // Token bridge and NFT module
  41. BridgeRegisterChain bridge_register_chain = 12;
  42. BridgeUpgradeContract bridge_contract_upgrade = 13;
  43. }
  44. }
  45. message InjectGovernanceVAAResponse {
  46. // Canonical digests of the submitted VAAs.
  47. repeated bytes digests = 1;
  48. }
  49. // GuardianSet represents a new guardian set to be submitted to and signed by the node.
  50. // During the genesis procedure, this data structure will be assembled using off-chain collaborative tooling
  51. // like GitHub using a human-readable encoding, so readability is a concern.
  52. message GuardianSetUpdate {
  53. // List of guardian set members.
  54. message Guardian {
  55. // Guardian key pubkey. Stored as hex string with 0x prefix for human readability -
  56. // this is the canonical Ethereum representation.
  57. string pubkey = 1;
  58. // Optional descriptive name. Not stored on any chain, purely informational.
  59. string name = 2;
  60. };
  61. repeated Guardian guardians = 3;
  62. }
  63. // GuardianKey specifies the on-disk format for a node's guardian key.
  64. message GuardianKey {
  65. // data is the binary representation of the secp256k1 private key.
  66. bytes data = 1;
  67. // Whether this key is deterministically generated and unsuitable for production mode.
  68. bool unsafe_deterministic_key = 2;
  69. }
  70. message BridgeRegisterChain {
  71. // Module identifier of the token or NFT bridge (typically "TokenBridge" or "NFTBridge")
  72. string module = 1;
  73. // ID of the chain to be registered.
  74. uint32 chain_id = 2;
  75. // Hex-encoded emitter address to be registered (without leading 0x).
  76. string emitter_address = 3;
  77. }
  78. // ContractUpgrade represents a Wormhole contract update to be submitted to and signed by the node.
  79. message ContractUpgrade {
  80. // ID of the chain where the Wormhole contract should be updated (uint8).
  81. uint32 chain_id = 1;
  82. // Hex-encoded address (without leading 0x) address of the new program/contract.
  83. string new_contract = 2;
  84. }
  85. message BridgeUpgradeContract {
  86. // Module identifier of the token or NFT bridge (typically "TokenBridge" or "NFTBridge").
  87. string module = 1;
  88. // ID of the chain where the bridge contract should be updated (uint16).
  89. uint32 target_chain_id = 2;
  90. // Hex-encoded address (without leading 0x) of the new program/contract.
  91. string new_contract = 3;
  92. }
  93. message FindMissingMessagesRequest {
  94. // Emitter chain ID to iterate.
  95. uint32 emitter_chain = 1;
  96. // Hex-encoded (without leading 0x) emitter address to iterate.
  97. string emitter_address = 2;
  98. }
  99. message FindMissingMessagesResponse {
  100. // List of missing sequence numbers.
  101. repeated string missing_messages = 1;
  102. // Range processed
  103. uint64 first_sequence = 2;
  104. uint64 last_sequence = 3;
  105. }