Skip to content

Commit

Permalink
Merge branch 'develop' into zetaclient-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kingpinXD authored Sep 22, 2023
2 parents e90db0f + 9db49d1 commit da5fa56
Show file tree
Hide file tree
Showing 65 changed files with 2,507 additions and 1,317 deletions.
2 changes: 1 addition & 1 deletion contrib/localnet/orchestrator/smoketest/test_stress.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func (sm *SmokeTest) EchoNetworkMetrics() {
numTicks++
// Get all pending outbound transactions
cctxResp, err := sm.cctxClient.CctxAllPending(context.Background(), &types2.QueryAllCctxPendingRequest{
ChainId: uint64(common.GoerliChain().ChainId),
ChainId: common.GoerliChain().ChainId,
})
if err != nil {
continue
Expand Down
75 changes: 44 additions & 31 deletions docs/openapi/openapi.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26596,11 +26596,11 @@ paths:
schema:
$ref: '#/definitions/googlerpcStatus'
parameters:
- name: chainId
- name: chain_id
in: query
required: false
type: string
format: uint64
format: int64
- name: pagination.key
description: |-
key is a value returned in PageResponse.next_key to begin
Expand Down Expand Up @@ -27230,7 +27230,7 @@ paths:
in: path
required: true
type: string
format: uint64
format: int64
tags:
- Query
/zeta-chain/crosschain/protocolFee:
Expand Down Expand Up @@ -27315,6 +27315,20 @@ paths:
type: string
tags:
- Query
/zeta-chain/observer/crosschain_flags:
get:
operationId: Query_CrosschainFlags
responses:
"200":
description: A successful response.
schema:
$ref: '#/definitions/observerQueryGetCrosschainFlagsResponse'
default:
description: An unexpected error response.
schema:
$ref: '#/definitions/googlerpcStatus'
tags:
- Query
/zeta-chain/observer/get_all_blame_records:
get:
summary: Queries a list of VoterByIdentifier items.
Expand Down Expand Up @@ -27573,20 +27587,6 @@ paths:
$ref: '#/definitions/googlerpcStatus'
tags:
- Query
/zeta-chain/observer/permission_flags:
get:
operationId: Query_PermissionFlags
responses:
"200":
description: A successful response.
schema:
$ref: '#/definitions/observerQueryGetPermissionFlagsResponse'
default:
description: An unexpected error response.
schema:
$ref: '#/definitions/googlerpcStatus'
tags:
- Query
/zeta-chain/observer/prove:
get:
summary: merkle proof verification
Expand Down Expand Up @@ -50929,6 +50929,26 @@ definitions:
items:
type: object
$ref: '#/definitions/observerCoreParams'
observerCrosschainFlags:
type: object
properties:
isInboundEnabled:
type: boolean
isOutboundEnabled:
type: boolean
gasPriceIncreaseFlags:
$ref: '#/definitions/observerGasPriceIncreaseFlags'
observerGasPriceIncreaseFlags:
type: object
properties:
epochLength:
type: string
format: int64
retryInterval:
type: string
gasPriceIncreasePercent:
type: integer
format: int64
observerKeygen:
type: object
properties:
Expand Down Expand Up @@ -50967,9 +50987,9 @@ definitions:
type: object
observerMsgUpdateCoreParamsResponse:
type: object
observerMsgUpdateKeygenResponse:
observerMsgUpdateCrosschainFlagsResponse:
type: object
observerMsgUpdatePermissionFlagsResponse:
observerMsgUpdateKeygenResponse:
type: object
observerNode:
type: object
Expand Down Expand Up @@ -51034,13 +51054,6 @@ definitions:
type: string
is_supported:
type: boolean
observerPermissionFlags:
type: object
properties:
isInboundEnabled:
type: boolean
isOutboundEnabled:
type: boolean
observerPolicy_Type:
type: string
enum:
Expand Down Expand Up @@ -51122,6 +51135,11 @@ definitions:
properties:
core_params:
$ref: '#/definitions/observerCoreParamsList'
observerQueryGetCrosschainFlagsResponse:
type: object
properties:
crosschain_flags:
$ref: '#/definitions/observerCrosschainFlags'
observerQueryGetKeygenResponse:
type: object
properties:
Expand All @@ -51132,11 +51150,6 @@ definitions:
properties:
node_account:
$ref: '#/definitions/observerNodeAccount'
observerQueryGetPermissionFlagsResponse:
type: object
properties:
permission_flags:
$ref: '#/definitions/observerPermissionFlags'
observerQueryObserversByChainResponse:
type: object
properties:
Expand Down
9 changes: 4 additions & 5 deletions docs/spec/observer/messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,17 @@ message MsgAddBlameVote {
}
```

## MsgUpdatePermissionFlags

Updates permissions. Currently, this is only used to enable/disable the
inbound transactions.
## MsgUpdateCrosschainFlags

UpdateCrosschainFlags updates the crosschain related flags.
Only the admin policy account is authorized to broadcast this message.

```proto
message MsgUpdatePermissionFlags {
message MsgUpdateCrosschainFlags {
string creator = 1;
bool isInboundEnabled = 3;
bool isOutboundEnabled = 4;
GasPriceIncreaseFlags gasPriceIncreaseFlags = 5;
}
```

Expand Down
4 changes: 2 additions & 2 deletions proto/crosschain/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ message QueryAllPendingNoncesResponse {
}

message QueryPendingNoncesByChainRequest {
uint64 chain_id = 1;
int64 chain_id = 1;
}

message QueryPendingNoncesByChainResponse {
Expand Down Expand Up @@ -305,7 +305,7 @@ message QueryAllCctxResponse {
}

message QueryAllCctxPendingRequest {
uint64 chainId = 1;
int64 chain_id = 1;
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}

Expand Down
22 changes: 22 additions & 0 deletions proto/observer/crosschain_flags.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
syntax = "proto3";
package zetachain.zetacore.observer;

import "gogoproto/gogo.proto";
import "google/protobuf/duration.proto";

option go_package = "github.com/zeta-chain/zetacore/x/observer/types";

message GasPriceIncreaseFlags {
int64 epochLength = 1;
google.protobuf.Duration retryInterval = 2 [
(gogoproto.nullable) = false,
(gogoproto.stdduration) = true
];
uint32 gasPriceIncreasePercent = 3;
}

message CrosschainFlags {
bool isInboundEnabled = 1;
bool isOutboundEnabled = 2;
GasPriceIncreaseFlags gasPriceIncreaseFlags = 3;
}
9 changes: 9 additions & 0 deletions proto/observer/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ syntax = "proto3";
package zetachain.zetacore.observer;

import "gogoproto/gogo.proto";
import "observer/crosschain_flags.proto";
import "observer/observer.proto";

option go_package = "github.com/zeta-chain/zetacore/x/observer/types";
Expand All @@ -27,3 +28,11 @@ message EventNewObserverAdded {
string zetaclient_grantee_pubkey = 4;
uint64 observer_last_block_count = 5;
}

message EventCrosschainFlagsUpdated {
string msg_type_url = 1;
bool isInboundEnabled = 2;
bool isOutboundEnabled = 3;
GasPriceIncreaseFlags gasPriceIncreaseFlags = 4;
string signer = 5;
}
4 changes: 2 additions & 2 deletions proto/observer/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ package zetachain.zetacore.observer;

import "gogoproto/gogo.proto";
import "observer/ballot.proto";
import "observer/crosschain_flags.proto";
import "observer/keygen.proto";
import "observer/node_account.proto";
import "observer/observer.proto";
import "observer/params.proto";
import "observer/permission_flags.proto";

option go_package = "github.com/zeta-chain/zetacore/x/observer/types";

message GenesisState {
repeated Ballot ballots = 1;
repeated ObserverMapper observers = 2;
repeated NodeAccount nodeAccountList = 3;
PermissionFlags permission_flags = 4;
CrosschainFlags crosschain_flags = 4;
Params params = 5;
Keygen keygen = 6;
LastObserverCount last_observer_count = 7;
Expand Down
1 change: 1 addition & 0 deletions proto/observer/keygen.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ enum KeygenStatus {
KeyGenSuccess = 1;
KeyGenFailed = 3;
}

message Keygen {
KeygenStatus status = 2; // 0--to generate key; 1--generated; 2--error
repeated string granteePubkeys = 3;
Expand Down
9 changes: 0 additions & 9 deletions proto/observer/permission_flags.proto

This file was deleted.

12 changes: 6 additions & 6 deletions proto/observer/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "observer/ballot.proto";
import "observer/blame.proto";
import "observer/crosschain_flags.proto";
import "observer/keygen.proto";
import "observer/node_account.proto";
import "observer/observer.proto";
import "observer/params.proto";
import "observer/permission_flags.proto";

option go_package = "github.com/zeta-chain/zetacore/x/observer/types";

Expand Down Expand Up @@ -57,8 +57,8 @@ service Query {
rpc NodeAccountAll(QueryAllNodeAccountRequest) returns (QueryAllNodeAccountResponse) {
option (google.api.http).get = "/zeta-chain/observer/nodeAccount";
}
rpc PermissionFlags(QueryGetPermissionFlagsRequest) returns (QueryGetPermissionFlagsResponse) {
option (google.api.http).get = "/zeta-chain/observer/permission_flags";
rpc CrosschainFlags(QueryGetCrosschainFlagsRequest) returns (QueryGetCrosschainFlagsResponse) {
option (google.api.http).get = "/zeta-chain/observer/crosschain_flags";
}
// Queries a keygen by index.
rpc Keygen(QueryGetKeygenRequest) returns (QueryGetKeygenResponse) {
Expand Down Expand Up @@ -179,10 +179,10 @@ message QueryAllNodeAccountResponse {
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

message QueryGetPermissionFlagsRequest {}
message QueryGetCrosschainFlagsRequest {}

message QueryGetPermissionFlagsResponse {
PermissionFlags permission_flags = 1 [(gogoproto.nullable) = false];
message QueryGetCrosschainFlagsResponse {
CrosschainFlags crosschain_flags = 1 [(gogoproto.nullable) = false];
}

message QueryGetKeygenRequest {}
Expand Down
9 changes: 6 additions & 3 deletions proto/observer/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package zetachain.zetacore.observer;
import "common/common.proto";
import "gogoproto/gogo.proto";
import "observer/blame.proto";
import "observer/crosschain_flags.proto";
import "observer/observer.proto";
import "observer/params.proto";

Expand All @@ -14,7 +15,7 @@ service Msg {
rpc AddObserver(MsgAddObserver) returns (MsgAddObserverResponse);
rpc UpdateCoreParams(MsgUpdateCoreParams) returns (MsgUpdateCoreParamsResponse);
rpc AddBlameVote(MsgAddBlameVote) returns (MsgAddBlameVoteResponse);
rpc UpdatePermissionFlags(MsgUpdatePermissionFlags) returns (MsgUpdatePermissionFlagsResponse);
rpc UpdateCrosschainFlags(MsgUpdateCrosschainFlags) returns (MsgUpdateCrosschainFlagsResponse);
rpc UpdateKeygen(MsgUpdateKeygen) returns (MsgUpdateKeygenResponse);
rpc AddBlockHeader(MsgAddBlockHeader) returns (MsgAddBlockHeaderResponse);
}
Expand Down Expand Up @@ -52,12 +53,14 @@ message MsgAddBlameVote {
}

message MsgAddBlameVoteResponse {}
message MsgUpdatePermissionFlags {

message MsgUpdateCrosschainFlags {
string creator = 1;
bool isInboundEnabled = 3;
bool isOutboundEnabled = 4;
GasPriceIncreaseFlags gasPriceIncreaseFlags = 5;
}
message MsgUpdatePermissionFlagsResponse {}
message MsgUpdateCrosschainFlagsResponse {}

message MsgUpdateKeygen {
string creator = 1;
Expand Down
Loading

0 comments on commit da5fa56

Please sign in to comment.