Skip to content

Commit

Permalink
Merge branch 'develop' into fix-tss-key-voting-hash-collision
Browse files Browse the repository at this point in the history
  • Loading branch information
kingpinXD authored Sep 10, 2024
2 parents c2b9df5 + 9819129 commit 3a3b461
Show file tree
Hide file tree
Showing 46 changed files with 1,891 additions and 1,471 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* [2749](https://github.com/zeta-chain/node/pull/2749) - fix all lint errors from govet
* [2725](https://github.com/zeta-chain/node/pull/2725) - refactor SetCctxAndNonceToCctxAndInboundHashToCctx to receive tsspubkey as an argument
* [2802](https://github.com/zeta-chain/node/pull/2802) - set default liquidity cap for new ZRC20s
* [2826](https://github.com/zeta-chain/node/pull/2826) - remove unused code from emissions module and add new parameter for fixed block reward amount

### Tests

Expand Down
35 changes: 0 additions & 35 deletions docs/cli/zetacored/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -3345,45 +3345,10 @@ zetacored query emissions [flags]
### SEE ALSO

* [zetacored query](#zetacored-query) - Querying subcommands
* [zetacored query emissions get-emmisons-factors](#zetacored-query-emissions-get-emmisons-factors) - Query GetEmmisonsFactors
* [zetacored query emissions list-pool-addresses](#zetacored-query-emissions-list-pool-addresses) - Query list-pool-addresses
* [zetacored query emissions params](#zetacored-query-emissions-params) - shows the parameters of the module
* [zetacored query emissions show-available-emissions](#zetacored-query-emissions-show-available-emissions) - Query show-available-emissions

## zetacored query emissions get-emmisons-factors

Query GetEmmisonsFactors

```
zetacored query emissions get-emmisons-factors [flags]
```

### Options

```
--grpc-addr string the gRPC endpoint to use for this chain
--grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS
--height int Use a specific height to query state at (this can error if the node is pruning state)
-h, --help help for get-emmisons-factors
--node string [host]:[port] to Tendermint RPC interface for this chain
-o, --output string Output format (text|json)
```

### Options inherited from parent commands

```
--chain-id string The network chain ID
--home string directory for config and data
--log_format string The logging format (json|plain)
--log_level string The logging level (trace|debug|info|warn|error|fatal|panic)
--log_no_color Disable colored logs
--trace print out full stack trace on errors
```

### SEE ALSO

* [zetacored query emissions](#zetacored-query-emissions) - Querying commands for the emissions module

## zetacored query emissions list-pool-addresses

Query list-pool-addresses
Expand Down
46 changes: 11 additions & 35 deletions docs/openapi/openapi.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29498,21 +29498,6 @@ paths:
$ref: '#/definitions/googlerpcStatus'
tags:
- Query
/zeta-chain/emissions/get_emissions_factors:
get:
summary: Queries a list of GetEmmisonsFactors items.
operationId: Query_GetEmissionsFactors
responses:
"200":
description: A successful response.
schema:
$ref: '#/definitions/emissionsQueryGetEmissionsFactorsResponse'
default:
description: An unexpected error response.
schema:
$ref: '#/definitions/googlerpcStatus'
tags:
- Query
/zeta-chain/emissions/list_addresses:
get:
summary: Queries a list of ListBalances items.
Expand Down Expand Up @@ -57609,15 +57594,6 @@ definitions:
type: object
emissionsMsgWithdrawEmissionResponse:
type: object
emissionsQueryGetEmissionsFactorsResponse:
type: object
properties:
reservesFactor:
type: string
bondFactor:
type: string
durationFactor:
type: string
emissionsQueryListPoolAddressesResponse:
type: object
properties:
Expand Down Expand Up @@ -58468,28 +58444,28 @@ definitions:
zetacoreemissionsParams:
type: object
properties:
max_bond_factor:
type: string
min_bond_factor:
type: string
avg_block_time:
type: string
target_bond_ratio:
type: string
validator_emission_percentage:
type: string
observer_emission_percentage:
type: string
tss_signer_emission_percentage:
type: string
duration_factor_constant:
type: string
observer_slash_amount:
type: string
ballot_maturity_blocks:
type: string
format: int64
description: Params defines the parameters for the module.
block_reward_amount:
type: string
title: |-
Params defines the parameters for the module.
Sample values:
ValidatorEmissionPercentage: "00.50",
ObserverEmissionPercentage: "00.25",
TssSignerEmissionPercentage: "00.25",
ObserverSlashAmount: 100000000000000000,
BallotMaturityBlocks: 100,
BlockRewardAmount: 9620949074074074074.074070733466756687,
ethermint.evm.v1.ChainConfig:
type: object
properties:
Expand Down
9 changes: 9 additions & 0 deletions docs/releases/v20_breaking_changes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

# V20 Breaking Changes

### Emissions factors deprecated

* `EmissionsFactors` have been deprecated and removed from the `emissions` module.
- This results in the removal of the query `/zeta-chain/emissions/get_emissions_factors`.
- The fixed block reward amount can now be queried via `/zeta-chain/emissions/params`. This is constant for every block and does not depend on any factors.

28 changes: 28 additions & 0 deletions proto/zetachain/zetacore/emissions/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,35 @@ import "gogoproto/gogo.proto";
option go_package = "github.com/zeta-chain/node/x/emissions/types";

// Params defines the parameters for the module.
// Sample values:
// ValidatorEmissionPercentage: "00.50",
// ObserverEmissionPercentage: "00.25",
// TssSignerEmissionPercentage: "00.25",
// ObserverSlashAmount: 100000000000000000,
// BallotMaturityBlocks: 100,
// BlockRewardAmount: 9620949074074074074.074070733466756687,
message Params {
option (gogoproto.goproto_stringer) = false;
string validator_emission_percentage = 5;
string observer_emission_percentage = 6;
string tss_signer_emission_percentage = 7;
string observer_slash_amount = 9 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false
];
int64 ballot_maturity_blocks = 10;
string block_reward_amount = 11 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];

// not used. do not edit.
reserved 1 to 4;
reserved 8;
}

// Deprecated (v20): Do not use. Use Params Instead
message LegacyParams {
option (gogoproto.goproto_stringer) = false;
string max_bond_factor = 1;
string min_bond_factor = 2;
Expand Down
15 changes: 0 additions & 15 deletions proto/zetachain/zetacore/emissions/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@ service Query {
option (google.api.http).get = "/zeta-chain/emissions/list_addresses";
}

// Queries a list of GetEmmisonsFactors items.
rpc GetEmissionsFactors(QueryGetEmissionsFactorsRequest)
returns (QueryGetEmissionsFactorsResponse) {
option (google.api.http).get =
"/zeta-chain/emissions/get_emissions_factors";
}

// Queries a list of ShowAvailableEmissions items.
rpc ShowAvailableEmissions(QueryShowAvailableEmissionsRequest)
returns (QueryShowAvailableEmissionsResponse) {
Expand Down Expand Up @@ -54,14 +47,6 @@ message QueryListPoolAddressesResponse {
string emission_module_address = 3;
}

message QueryGetEmissionsFactorsRequest {}

message QueryGetEmissionsFactorsResponse {
string reservesFactor = 1;
string bondFactor = 2;
string durationFactor = 3;
}

message QueryShowAvailableEmissionsRequest { string address = 1; }

message QueryShowAvailableEmissionsResponse { string amount = 1; }
Expand Down
18 changes: 18 additions & 0 deletions testutil/sample/genesis.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package sample

import (
_ "embed"
"testing"

"github.com/cometbft/cometbft/types"
"github.com/stretchr/testify/require"
)

//go:embed genesis.json
var genesisJSON []byte

func GenDoc(t *testing.T) *types.GenesisDoc {
genDoc, err := types.GenesisDocFromJSON(genesisJSON)
require.NoError(t, err)
return genDoc
}
Loading

0 comments on commit 3a3b461

Please sign in to comment.