proto - BatchVAA gossip and publicrpc (#1563)
This commit is contained in:
parent
266eabcf6e
commit
d83e44cf6b
|
@ -98,6 +98,11 @@ func (s *PublicrpcServer) GetSignedVAA(ctx context.Context, req *publicrpcv1.Get
|
|||
}, nil
|
||||
}
|
||||
|
||||
func (s *PublicrpcServer) GetSignedBatchVAA(ctx context.Context, req *publicrpcv1.GetSignedBatchVAARequest) (*publicrpcv1.GetSignedBatchVAAResponse, error) {
|
||||
// TEMP - noop implementaion to satisfy inclusion requirement
|
||||
return nil, status.Error(codes.Unimplemented, "not yet implemented")
|
||||
}
|
||||
|
||||
func (s *PublicrpcServer) GetCurrentGuardianSet(ctx context.Context, req *publicrpcv1.GetCurrentGuardianSetRequest) (*publicrpcv1.GetCurrentGuardianSetResponse, error) {
|
||||
gs := s.gst.Get()
|
||||
if gs == nil {
|
||||
|
|
|
@ -10,6 +10,8 @@ message GossipMessage {
|
|||
SignedHeartbeat signed_heartbeat = 3;
|
||||
SignedVAAWithQuorum signed_vaa_with_quorum = 4;
|
||||
SignedObservationRequest signed_observation_request = 5;
|
||||
SignedBatchObservation signed_batch_observation = 6;
|
||||
SignedBatchVAAWithQuorum signed_batch_vaa_with_quorum = 7;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -114,3 +116,32 @@ message ObservationRequest {
|
|||
uint32 chain_id = 1;
|
||||
bytes tx_hash = 2;
|
||||
}
|
||||
|
||||
// A SignedBatchObservation is a signed statement by a given guardian node
|
||||
// that they observed a series of messages originating from a transaction.
|
||||
//
|
||||
// BatcheObervations are emitted when all the Observations from a tx reach quorum.
|
||||
//
|
||||
// The event is uniquely identified by its hash (made from hashing all the
|
||||
// individual Observation hashes).
|
||||
//
|
||||
// Messages without valid signature are dropped unceremoniously.
|
||||
message SignedBatchObservation {
|
||||
// Guardian pubkey as truncated eth address.
|
||||
bytes addr = 1;
|
||||
// The observation batch's deterministic, unique hash.
|
||||
bytes hash = 2;
|
||||
// ECSDA signature of the hash using the node's guardian key.
|
||||
bytes signature = 3;
|
||||
// Transaction hash this observation was made from.
|
||||
bytes tx_hash = 4;
|
||||
// Chain ID for this observation.
|
||||
uint32 chain_id = 5;
|
||||
// Batch ID - emitterChain/transactionID
|
||||
string batch_id = 6;
|
||||
}
|
||||
|
||||
|
||||
message SignedBatchVAAWithQuorum {
|
||||
bytes batch_vaa = 1;
|
||||
}
|
||||
|
|
|
@ -50,6 +50,13 @@ message MessageID {
|
|||
uint64 sequence = 3;
|
||||
}
|
||||
|
||||
message BatchID {
|
||||
// Emitter chain ID.
|
||||
ChainID emitter_chain = 1;
|
||||
// Hex-encoded (without leading 0x) transaction identifier.
|
||||
string tx_id = 2;
|
||||
}
|
||||
|
||||
// PublicRPCService service exposes endpoints to be consumed externally; GUIs, historical record keeping, etc.
|
||||
service PublicRPCService {
|
||||
// GetLastHeartbeats returns the last heartbeat received for each guardian node in the
|
||||
|
@ -67,6 +74,12 @@ service PublicRPCService {
|
|||
};
|
||||
}
|
||||
|
||||
rpc GetSignedBatchVAA (GetSignedBatchVAARequest) returns (GetSignedBatchVAAResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/v1/signed_batch_vaa/{batch_id.emitter_chain}/{batch_id.tx_id}"
|
||||
};
|
||||
}
|
||||
|
||||
rpc GetCurrentGuardianSet (GetCurrentGuardianSetRequest) returns (GetCurrentGuardianSetResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/v1/guardianset/current"
|
||||
|
@ -95,7 +108,7 @@ service PublicRPCService {
|
|||
option (google.api.http) = {
|
||||
get: "/v1/governor/token_list"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -107,6 +120,14 @@ message GetSignedVAAResponse {
|
|||
bytes vaa_bytes = 1;
|
||||
}
|
||||
|
||||
message GetSignedBatchVAARequest {
|
||||
BatchID batch_id = 1;
|
||||
}
|
||||
|
||||
message GetSignedBatchVAAResponse {
|
||||
bytes batch_vaa_bytes = 1;
|
||||
}
|
||||
|
||||
message GetLastHeartbeatsRequest {
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue