node.proto 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. syntax = "proto3";
  2. package node.v1;
  3. option go_package = "github.com/certusone/wormhole/bridge/pkg/proto/node/v1;nodev1";
  4. import "google/api/annotations.proto";
  5. // NodePrivileged exposes an administrative API. It runs on a UNIX socket and is authenticated
  6. // using Linux filesystem permissions.
  7. service NodePrivileged {
  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. }
  16. message InjectGovernanceVAARequest {
  17. // Index of the current guardian set.
  18. uint32 current_set_index = 1;
  19. // UNIX timestamp (s) of the VAA to be created. The timestamp is informational and will be part
  20. // of the VAA submitted to the chain. It's part of the VAA digest and has to be identical across nodes and
  21. // is critical for replay protection - a given event may only ever be observed with the same timestamp,
  22. // otherwise, it may be possible to execute it multiple times.
  23. //
  24. // For lockups, the timestamp identifies the block that the lockup belongs to.
  25. // For governance VAAs, guardians inject the VAA manually. Best practice is to pick a timestamp which roughly matches
  26. // the timing of the off-chain ceremony used to achieve consensus. For guardian set updates, the actual on-chain
  27. // guardian set creation timestamp will be set when the VAA is accepted on each chain.
  28. //
  29. // This is a uint32 to match the on-chain timestamp representation. This becomes a problem in 2106 (sorry).
  30. uint32 timestamp = 2;
  31. oneof payload{
  32. GuardianSetUpdate guardian_set = 3;
  33. ContractUpgrade contract_upgrade = 4;
  34. }
  35. }
  36. message InjectGovernanceVAAResponse {
  37. // Canonical digest of the submitted VAA.
  38. bytes digest = 1;
  39. }
  40. // GuardianSet represents a new guardian set to be submitted to and signed by the node.
  41. // During the genesis procedure, this data structure will be assembled using off-chain collaborative tooling
  42. // like GitHub using a human-readable encoding, so readability is a concern.
  43. message GuardianSetUpdate {
  44. // List of guardian set members.
  45. message Guardian {
  46. // Guardian key pubkey. Stored as hex string with 0x prefix for human readability -
  47. // this is the canonical Ethereum representation.
  48. string pubkey = 1;
  49. // Optional descriptive name. Not stored on any chain, purely informational.
  50. string name = 2;
  51. };
  52. repeated Guardian guardians = 3;
  53. }
  54. // GuardianKey specifies the on-disk format for a node's guardian key.
  55. message GuardianKey {
  56. // data is the binary representation of the secp256k1 private key.
  57. bytes data = 1;
  58. // Whether this key is deterministically generated and unsuitable for production mode.
  59. bool unsafeDeterministicKey = 2;
  60. }
  61. // ContractUpgrade represents a Wormhole contract update to be submitted to and signed by the node.
  62. message ContractUpgrade {
  63. // ID of the chain where the Wormhole contract should be updated (uint8).
  64. uint32 chain_id = 1;
  65. // Address of the new program/contract.
  66. bytes new_contract = 2;
  67. }