2020-08-17 10:22:12 -07:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package gossip.v1;
|
|
|
|
|
|
|
|
option go_package = "proto/gossip/v1;gossipv1";
|
|
|
|
|
2020-08-19 05:23:00 -07:00
|
|
|
message GossipMessage {
|
|
|
|
oneof message {
|
|
|
|
Heartbeat heartbeat = 1;
|
2020-11-20 13:35:00 -08:00
|
|
|
SignedObservation signed_observation = 2;
|
2020-08-19 05:23:00 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-02-03 04:01:51 -08:00
|
|
|
// P2P gossip heartbeats for network introspection purposes. ALL FIELDS ARE UNTRUSTED.
|
2020-08-17 10:22:12 -07:00
|
|
|
message Heartbeat {
|
2020-08-19 05:23:00 -07:00
|
|
|
// The node's arbitrarily chosen, untrusted nodeName.
|
2020-08-17 10:22:12 -07:00
|
|
|
string node_name = 1;
|
2020-08-19 05:23:00 -07:00
|
|
|
// A monotonic counter that resets to zero on startup.
|
2020-08-17 10:22:12 -07:00
|
|
|
int64 counter = 2;
|
2020-08-19 05:23:00 -07:00
|
|
|
// UNIX wall time.
|
2021-02-03 04:01:51 -08:00
|
|
|
int64 timestamp = 3;
|
2020-08-21 01:36:08 -07:00
|
|
|
|
2021-02-03 04:01:51 -08:00
|
|
|
message Network {
|
|
|
|
// Canonical chain ID.
|
2020-08-21 01:36:08 -07:00
|
|
|
uint32 id = 1;
|
2021-02-03 04:01:51 -08:00
|
|
|
// Consensus height of the node.
|
2020-08-21 01:36:08 -07:00
|
|
|
int64 height = 2;
|
2021-02-03 04:01:51 -08:00
|
|
|
// Chain-specific human-readable representation of the bridge contract address.
|
|
|
|
string bridge_address = 3;
|
|
|
|
|
|
|
|
// Fee payer account for this network, if present. Some networks like Ethereum do not use fee payer accounts.
|
|
|
|
message FeePayer {
|
|
|
|
// The account's on-chain balance.
|
|
|
|
int64 balance = 1;
|
|
|
|
// Chain-specific human-readable representation of the fee payer account's address.
|
|
|
|
string address = 2;
|
|
|
|
}
|
|
|
|
FeePayer fee_payer = 4;
|
2020-08-21 01:36:08 -07:00
|
|
|
}
|
|
|
|
repeated Network networks = 4;
|
2020-08-19 05:23:00 -07:00
|
|
|
|
2021-01-28 12:46:09 -08:00
|
|
|
// Human-readable representation of the current bridge node release.
|
|
|
|
string version = 5;
|
|
|
|
|
2021-02-03 04:01:51 -08:00
|
|
|
// Human-readable representation of the guardian key's address.
|
|
|
|
string guardian_addr = 6;
|
|
|
|
|
|
|
|
// TODO: include signed statement of gk public key?
|
2020-08-19 05:23:00 -07:00
|
|
|
}
|
|
|
|
|
2020-11-20 13:35:00 -08:00
|
|
|
// A SignedObservation is a signed statement by a given guardian node
|
|
|
|
// that they observed a given event.
|
2020-08-19 05:23:00 -07:00
|
|
|
//
|
2020-11-20 13:35:00 -08:00
|
|
|
// Observations always result from an external, final event being observed.
|
|
|
|
// Examples are lockups in finalized blocks on a block or guardian set changes
|
|
|
|
// injected by node operators after reaching off-chain consensus.
|
|
|
|
//
|
|
|
|
// The event is uniquely identified by its hashed (tx_hash, nonce, values...) tuple.
|
2020-08-19 05:23:00 -07:00
|
|
|
//
|
|
|
|
// Other nodes will verify the signature. Once any node has observed a quorum of
|
|
|
|
// guardians submitting valid signatures for a given hash, they can be assembled into a VAA.
|
|
|
|
//
|
|
|
|
// Messages without valid signature are dropped unceremoniously.
|
2020-11-20 13:35:00 -08:00
|
|
|
message SignedObservation {
|
2020-08-19 05:23:00 -07:00
|
|
|
// Guardian pubkey as truncated eth address.
|
|
|
|
bytes addr = 1;
|
2020-08-21 04:00:40 -07:00
|
|
|
// The lockup's deterministic, unique hash.
|
2020-08-19 05:23:00 -07:00
|
|
|
bytes hash = 2;
|
|
|
|
// ECSDA signature of the hash using the node's guardian key.
|
|
|
|
bytes signature = 3;
|
2020-08-17 10:22:12 -07:00
|
|
|
}
|