Skip to content

Commit

Permalink
feat: full gravity multichain support (#1189)
Browse files Browse the repository at this point in the history
# Related Github tickets

- VolumeFi#1636
- VolumeFi#842
- VolumeFi#1378
- VolumeFi#1617

# Background

This change addresses quite a lot of ongoing issues on the gravity
project, and the merge will result in a fully functional bridge
implementation across multiple chains and tokens, with full support for
funds exchange.

Rollout will require an updated version of compass with this change
VolumeFi/paloma-compass-evm@95b856d

# Testing completed

- [x] test coverage exists or has been added/updated
- [x] tested in a private testnet

# Breaking changes

- [x] I have checked my code for breaking changes
- [x] If there are breaking changes, there is a supporting migration.

---------

Co-authored-by: Luis Carvalho <[email protected]>
Co-authored-by: Taariq Lewis <[email protected]>
  • Loading branch information
3 people authored Jun 11, 2024
1 parent a58367b commit 4a39be0
Show file tree
Hide file tree
Showing 32 changed files with 1,314 additions and 1,465 deletions.
4 changes: 3 additions & 1 deletion proto/palomachain/paloma/gravity/msgs.proto
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ message MsgSendToPalomaClaim {
string chain_reference_id = 8;
palomachain.paloma.valset.MsgMetadata metadata = 9
[ (gogoproto.nullable) = false ];
uint64 gravity_nonce = 10;
}

message MsgSendToPalomaClaimResponse {}
Expand All @@ -105,6 +106,7 @@ message MsgBatchSendToEthClaim {
string orchestrator = 6;
palomachain.paloma.valset.MsgMetadata metadata = 7
[ (gogoproto.nullable) = false ];
uint64 gravity_nonce = 8;
}

message MsgBatchSendToEthClaimResponse {}
Expand Down Expand Up @@ -203,4 +205,4 @@ message MsgUpdateParams {

// MsgUpdateParamsResponse defines the response structure for executing a
// MsgUpdateParams message.
message MsgUpdateParamsResponse {}
message MsgUpdateParamsResponse {}
57 changes: 14 additions & 43 deletions proto/palomachain/paloma/gravity/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ service Query {
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {}
rpc LastPendingBatchRequestByAddr(QueryLastPendingBatchRequestByAddrRequest)
returns (QueryLastPendingBatchRequestByAddrResponse) {}
rpc LastEventNonce(QueryLastEventNonceRequest)
returns (QueryLastEventNonceResponse) {}
rpc LastEventNonceByAddr(QueryLastEventNonceByAddrRequest)
returns (QueryLastEventNonceResponse) {}
rpc LastObservedGravityNonce(QueryLastObservedGravityNonceRequest)
returns (QueryLastObservedGravityNonceResponse) {}
rpc LastObservedGravityNonceByAddr(QueryLastObservedGravityNonceByAddrRequest)
returns (QueryLastObservedGravityNonceResponse) {}
rpc LastObservedGravityBlock(QueryLastObservedGravityBlockRequest)
returns (QueryLastObservedGravityBlockResponse) {}
rpc OutgoingTxBatches(QueryOutgoingTxBatchesRequest)
returns (QueryOutgoingTxBatchesResponse) {}
rpc BatchRequestByNonce(QueryBatchRequestByNonceRequest)
Expand All @@ -32,10 +34,6 @@ service Query {
returns (QueryERC20ToDenomResponse) {}
rpc DenomToERC20(QueryDenomToERC20Request)
returns (QueryDenomToERC20Response) {}
rpc GetLastObservedEthBlock(QueryLastObservedEthBlockRequest)
returns (QueryLastObservedEthBlockResponse) {}
rpc GetLastObservedEthNonce(QueryLastObservedEthNonceRequest)
returns (QueryLastObservedEthNonceResponse) {}
rpc GetAttestations(QueryAttestationsRequest)
returns (QueryAttestationsResponse) {}

Expand Down Expand Up @@ -80,14 +78,19 @@ message QueryBatchConfirmsResponse {
repeated MsgConfirmBatch confirms = 1 [ (gogoproto.nullable) = false ];
}

message QueryLastEventNonceRequest {
message QueryLastObservedGravityNonceRequest {
string chain_reference_id = 1;
}
message QueryLastEventNonceByAddrRequest {
message QueryLastObservedGravityNonceByAddrRequest {
string address = 1;
string chain_reference_id = 2;
}
message QueryLastEventNonceResponse { uint64 event_nonce = 1; }
message QueryLastObservedGravityNonceResponse { uint64 nonce = 1; }

message QueryLastObservedGravityBlockRequest {
string chain_reference_id = 1;
}
message QueryLastObservedGravityBlockResponse { uint64 block = 1; }

message QueryERC20ToDenomRequest {
string erc20 = 1;
Expand All @@ -101,38 +104,6 @@ message QueryDenomToERC20Request {
}
message QueryDenomToERC20Response { string erc20 = 1; }

// QueryLastObservedEthBlockRequest defines the request for getting the height
// of the last applied Ethereum Event on the bridge. This is expected to lag the
// actual Ethereum block height significantly due to 1. Ethereum Finality and
// 2. Consensus mirroring the state on Ethereum
message QueryLastObservedEthBlockRequest {
reserved 1;
reserved "use_v1_key";

string chain_reference_id = 2;
}
message QueryLastObservedEthBlockResponse {
// a response of 0 indicates that no Ethereum events have been observed, and
// thus the bridge is inactive
uint64 block = 1;
}

// QueryLastObservedEthNonceRequest defines the request for getting the event
// nonce of the last applied Ethereum Event on the bridge. Note that this is
// likely to lag the last executed event a little due to 1. Ethereum Finality
// and 2. Consensus mirroring the Ethereum state
message QueryLastObservedEthNonceRequest {
reserved 1;
reserved "use_v1_key";

string chain_reference_id = 2;
}
message QueryLastObservedEthNonceResponse {
// a response of 0 indicates that no Ethereum events have been observed, and
// thus the bridge is inactive
uint64 nonce = 1;
}

// QueryAttestationsRequest defines the request structure for getting recent
// attestations with optional query parameters. By default, a limited set of
// recent attestations will be returned, defined by 'limit'. These attestations
Expand Down
Loading

0 comments on commit 4a39be0

Please sign in to comment.