Skip to content

Commit

Permalink
feat: CNS-validator-rewards-query (#1624)
Browse files Browse the repository at this point in the history
* added a query to fetch tracked cu

* add query for spectrackedinfo

* add query for estimated rewards

* fix

* now it works

* fix cli

* add cli for tracked cu

* pr changes

* can take into account the provider/delegation address

* add community and tax

* pr changes

* fix

* added community and validator tax for iprpc

* done

* fix

* pr changes

* typo

* add cli

* fix for self delegation

* update lava spec

* remove cosmwasm from lava spec

* added event

* fix unit test

* added leftover pool

* add test.
make sure to distribute the rewards from all kinds of tokens

* add test

* pr fix

* fix

* fix

* lint

---------

Co-authored-by: Yarom Swisa <[email protected] git config --global user.name Yarom>
Co-authored-by: Yaroms <[email protected]>
Co-authored-by: Omer <[email protected]>
Co-authored-by: Oren <[email protected]>
Co-authored-by: oren-lava <[email protected]>
  • Loading branch information
6 people authored Aug 14, 2024
1 parent bc12d32 commit 1bd1d53
Show file tree
Hide file tree
Showing 17 changed files with 1,558 additions and 109 deletions.
1 change: 1 addition & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ var (
subscriptionmoduletypes.ModuleName: {authtypes.Burner, authtypes.Staking},
string(rewardsmoduletypes.ValidatorsRewardsAllocationPoolName): {authtypes.Minter, authtypes.Staking},
string(rewardsmoduletypes.ValidatorsRewardsDistributionPoolName): {authtypes.Burner, authtypes.Staking},
string(rewardsmoduletypes.ValidatorsRewardsLeftOverPoolName): {authtypes.Burner, authtypes.Staking},
string(rewardsmoduletypes.ProviderRewardsDistributionPool): {authtypes.Burner, authtypes.Staking},
string(rewardsmoduletypes.ProvidersRewardsAllocationPool): {authtypes.Minter, authtypes.Staking},
dualstakingmoduletypes.ModuleName: {authtypes.Burner, authtypes.Staking},
Expand Down
146 changes: 145 additions & 1 deletion cookbook/specs/lava.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"name": "lava testnet",
"enabled": true,
"imports": [
"COSMOSSDKFULL"
"COSMOSSDK"
],
"providers_types": 1,
"reliability_threshold": 268435455,
Expand Down Expand Up @@ -1383,6 +1383,78 @@
"stateful": 0
},
"extra_compute_units": 0
},
{
"name": "/lavanet/lava/subscription/estimated_validator_rewards/{validator}/{amount_delegator}",
"block_parsing": {
"parser_arg": [
"latest"
],
"parser_func": "DEFAULT"
},
"compute_units": 10,
"enabled": true,
"category": {
"deterministic": true,
"local": false,
"subscription": false,
"stateful": 0
},
"extra_compute_units": 0
},
{
"name": "/lavanet/lava/subscription/tracked_usage/{subscription}",
"block_parsing": {
"parser_arg": [
"latest"
],
"parser_func": "DEFAULT"
},
"compute_units": 10,
"enabled": true,
"category": {
"deterministic": true,
"local": false,
"subscription": false,
"stateful": 0
},
"extra_compute_units": 0
},
{
"name": "/lavanet/lava/subscription/estimated_rewards/{provider}/{chain_id}/{amount_delegator}",
"block_parsing": {
"parser_arg": [
"latest"
],
"parser_func": "DEFAULT"
},
"compute_units": 10,
"enabled": true,
"category": {
"deterministic": true,
"local": false,
"subscription": false,
"stateful": 0
},
"extra_compute_units": 0
},
{
"name": "/lavanet/lava/rewards/SpecTrackedInfo/{chain_id}/{provider}",
"block_parsing": {
"parser_arg": [
"latest"
],
"parser_func": "DEFAULT"
},
"compute_units": 10,
"enabled": true,
"category": {
"deterministic": true,
"local": false,
"subscription": false,
"stateful": 0
},
"extra_compute_units": 0
}
],
"headers": [],
Expand Down Expand Up @@ -2743,6 +2815,78 @@
"stateful": 0
},
"extra_compute_units": 0
},
{
"name": "lavanet.lava.subscription.Query/EstimatedRewards",
"block_parsing": {
"parser_arg": [
"latest"
],
"parser_func": "DEFAULT"
},
"compute_units": 10,
"enabled": true,
"category": {
"deterministic": true,
"local": false,
"subscription": false,
"stateful": 0
},
"extra_compute_units": 0
},
{
"name": "lavanet.lava.rewards.Query/SpecTrackedInfo",
"block_parsing": {
"parser_arg": [
"latest"
],
"parser_func": "DEFAULT"
},
"compute_units": 10,
"enabled": true,
"category": {
"deterministic": true,
"local": false,
"subscription": false,
"stateful": 0
},
"extra_compute_units": 0
},
{
"name": "lavanet.lava.subscription.Query/EstimatedValidatorRewards",
"block_parsing": {
"parser_arg": [
"latest"
],
"parser_func": "DEFAULT"
},
"compute_units": 10,
"enabled": true,
"category": {
"deterministic": true,
"local": false,
"subscription": false,
"stateful": 0
},
"extra_compute_units": 0
},
{
"name": "lavanet.lava.subscription.Query/TrackedUsage",
"block_parsing": {
"parser_arg": [
"latest"
],
"parser_func": "DEFAULT"
},
"compute_units": 10,
"enabled": true,
"category": {
"deterministic": true,
"local": false,
"subscription": false,
"stateful": 0
},
"extra_compute_units": 0
}
],
"headers": [],
Expand Down
Loading

0 comments on commit 1bd1d53

Please sign in to comment.