Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tokenomics] Post-scaffold cleanup & parameter updates foundation #287

Merged
merged 55 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
6f32dac
move protox to the right place
Olshansk Dec 10, 2023
1d4e475
Merge branch 'main' into issues/243/update_tokenomics_module
Olshansk Dec 20, 2023
86cca4f
Fix proto imports
Olshansk Dec 20, 2023
f317d89
Merge branch 'main' into issues/243/update_tokenomics_module
Olshansk Dec 21, 2023
2c44d26
Documented the plan for this PR before I forget
Olshansk Dec 22, 2023
4b1d025
Merge branch 'main' into issues/243/update_tokenomics_module
Olshansk Jan 5, 2024
f2519ea
Merge branch 'main' into issues/243/update_tokenomics_module
Olshansk Jan 5, 2024
c8b4b6b
Merge branch 'main' into issues/243/update_tokenomics_module
Olshansk Jan 8, 2024
6364101
Update deps
Olshansk Jan 8, 2024
9620a24
Unit test for updating tokenomic params succeeds
Olshansk Jan 8, 2024
5b4949d
Added a placeholder for SettleSessionAccounting
Olshansk Jan 8, 2024
565195b
Rename Compute to ComputeUnits
Olshansk Jan 8, 2024
ee71f7d
Remove some unused comments
Olshansk Jan 8, 2024
7fe5ecb
Before scaffold
Olshansk Jan 8, 2024
0079a32
Ran the following command to fill in some missing gaps: ignite scaffo…
Olshansk Jan 10, 2024
581c947
Merge branch 'main' into issues/243/update_tokenomics_module
Olshansk Jan 10, 2024
7939b4c
Incomplete unit tests for parameter update passing
Olshansk Jan 10, 2024
1c32614
Checkpoint for the day
Olshansk Jan 11, 2024
fa80df8
Merge with main
Olshansk Jan 15, 2024
ee787d0
Update /msg_server_update_params_test.go and figurign some stuff out …
Olshansk Jan 15, 2024
4aca865
Unit tests passing
Olshansk Jan 16, 2024
fe9a645
Remove session accounting implementation
Olshansk Jan 16, 2024
e32bc93
Completed self review
Olshansk Jan 16, 2024
398e4d6
Update x/tokenomics/client/cli/tx_update_params.go
Olshansk Jan 18, 2024
cab8bee
change k8s DNS endpoint for celestia secret (#314)
okdas Jan 16, 2024
d95e1f7
[LocalNet] Add sequencer block persistence (#277)
okdas Jan 17, 2024
fd9662c
[Config, Docs] Add supplier staking config documentation (#318)
red-0ne Jan 18, 2024
4eeda85
[Docs] Add AppGateServer config documentation (#317)
red-0ne Jan 18, 2024
6d566eb
[Config, Docs] Add gateway staking config documentation (#321)
red-0ne Jan 18, 2024
eda0816
[Config, Docs] Add application staking config documentation (#320)
red-0ne Jan 18, 2024
629bf6c
Fixed some tests
Olshansk Jan 18, 2024
9a79163
Update proto/pocket/tokenomics/query.proto
Olshansk Jan 19, 2024
fa45776
Update Makefile
Olshansk Jan 19, 2024
f149a74
Update x/tokenomics/client/cli/tx_update_params.go
Olshansk Jan 19, 2024
4b8a5b5
Update x/tokenomics/keeper/keeper.go
Olshansk Jan 19, 2024
de19c54
Reply to some review comments
Olshansk Jan 19, 2024
1871007
Ran make go_imports and make go_lint
Olshansk Jan 19, 2024
526d90e
Merge with main
Olshansk Jan 19, 2024
bdbbcc8
Start multi-lining
Olshansk Jan 19, 2024
d1fcf9b
Renamed some tokenomics errors
Olshansk Jan 19, 2024
23fb106
Reply to PR review comments
Olshansk Jan 19, 2024
7972eef
foundation/pnf
Olshansk Jan 19, 2024
3f92915
Ran make go_imports and make go_lint
Olshansk Jan 19, 2024
d708df0
Fix outdated test
Olshansk Jan 19, 2024
90b5255
Merge with main
Olshansk Jan 19, 2024
9faf89c
Fix log usage
Olshansk Jan 19, 2024
05a8924
Update Makefile
Olshansk Jan 22, 2024
70eea62
fix: add yarn.lock (#334)
bryanchriswhite Jan 22, 2024
4b92864
[Off-chain] Simplify `TxClient` with `EventsQueryClient` (#330)
bryanchriswhite Jan 22, 2024
3e447db
Merge branch 'main' into issues/243/update_tokenomics_module
Olshansk Jan 22, 2024
39a8209
Merge branch 'main' into issues/243/update_tokenomics_module
Olshansk Jan 23, 2024
3d9505e
Remove TokenomicsKeeperI and follow the same keeper naming convention
Olshansk Jan 23, 2024
a038791
Fix a few refactoring issues
Olshansk Jan 23, 2024
1a39f03
One last minor refactor fix
Olshansk Jan 23, 2024
093ddff
Empty commit
Olshansk Jan 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ require (
github.com/athanorlabs/go-dleq v0.1.0
github.com/cometbft/cometbft v0.37.2
github.com/cometbft/cometbft-db v0.8.0
github.com/cosmos/cosmos-proto v1.0.0-beta.2
github.com/cosmos/cosmos-sdk v0.47.3
github.com/cosmos/gogoproto v1.4.11
github.com/cosmos/ibc-go/v7 v7.1.0
Expand All @@ -46,7 +45,6 @@ require (
go.uber.org/multierr v1.11.0
golang.org/x/crypto v0.15.0
golang.org/x/sync v0.5.0
google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb
google.golang.org/grpc v1.59.0
gopkg.in/yaml.v2 v2.4.0
)
Expand Down Expand Up @@ -90,6 +88,7 @@ require (
github.com/containerd/cgroups v1.1.0 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/cosmos/btcutil v1.0.5 // indirect
github.com/cosmos/cosmos-proto v1.0.0-beta.2 // indirect
github.com/cosmos/go-bip39 v1.0.0 // indirect
github.com/cosmos/gogogateway v1.2.0 // indirect
github.com/cosmos/iavl v0.20.0 // indirect
Expand Down Expand Up @@ -285,6 +284,7 @@ require (
google.golang.org/api v0.143.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
Expand Down
3 changes: 2 additions & 1 deletion proto/pocket/supplier/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ option go_package = "github.com/pokt-network/poktroll/x/supplier/types";
// Params defines the parameters for the module.
message Params {
option (gogoproto.goproto_stringer) = false;

// TODO_BLOCKER: Add proof related submission window params
// TODO_BLOCKER: Add claim related submission window params
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
syntax = "proto3";
package poktroll.tokenomics;
package pocket.tokenomics;

import "gogoproto/gogo.proto";
import "poktroll/tokenomics/params.proto";
import "pocket/tokenomics/params.proto";

option go_package = "github.com/pokt-network/poktroll/x/tokenomics/types";

Expand Down
214 changes: 214 additions & 0 deletions proto/pocket/tokenomics/params.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
syntax = "proto3";
package pocket.tokenomics;

import "gogoproto/gogo.proto";

option go_package = "github.com/pokt-network/poktroll/x/tokenomics/types";

// Params defines the parameters for the module.
message Params {
option (gogoproto.goproto_stringer) = false;

uint64 computeToTokensMultiplier = 1 [(gogoproto.moretags) = "yaml:\"compute_to_tokens_multiplier\""];
/* Ideas:
- RelayToTokensMultiplier
- Application.MaxuPOKTPerRelay
- Application.MinuPOKTPerRelay
- Suppler.MaxuPOKTPerRelay
- Suppler.MinuPOKTPerRelay
- PercentageCutToDAO
- PercentageCutToSequencer
- PercentageCutToOthers?
*/
}


/*

TODO_IN_THIS_PR: Plan & implement the following before splitting it into smaller PRs:
Olshansk marked this conversation as resolved.
Show resolved Hide resolved
- Note how this has been deprecated: https://docs.cosmos.network/main/build/modules/params
- Introduce a MsgUpdateParams everywhere: https://github.com/cosmos/cosmos-sdk/blob/44be02175e8048a07b8ce3ea6ca5de05b77a9f95/proto/cosmos/gov/v1/tx.proto#L180
- Add all the params we need (or a starting point)
- Make the params updatable (and helpers + tests to update )
- Add Makefile helper that uses the `authority` address (x/auth? x/account?) to update the params
- Add the interaface for tokenomics
- Make it dependt on the banking module + w/e else we need
- Just focus on mint/burn with some simple logic
*/


/*
{
"app_params": [
{
"param_key": "application/ParticipationRateOn",
"param_value": "false"
},
{
"param_key": "application/ApplicationStakeMinimum",
"param_value": "1000000"
},
{
"param_key": "application/MaxApplications",
"param_value": "2295"
},
{
"param_key": "application/StabilityAdjustment",
"param_value": "0"
},
{
"param_key": "application/BaseRelaysPerPOKT",
"param_value": "200000"
},
{
"param_key": "application/AppUnstakingTime",
"param_value": "1814000000000000"
},
{
"param_key": "application/MaximumChains",
"param_value": "15"
}
],
"auth_params": [
{
"param_key": "auth/MaxMemoCharacters",
"param_value": "75"
},
{
"param_key": "auth/FeeMultipliers",
"param_value": "{\"fee_multiplier\":null,\"default\":\"1\"}"
},
{
"param_key": "auth/TxSigLimit",
"param_value": "8"
}
],
"gov_params": [
{
"param_key": "gov/daoOwner",
"param_value": "a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4"
},
{
"param_key": "gov/acl",
"param_value": "{\"type\":\"gov/non_map_acl\",\"value\":[{\"acl_key\":\"application/ApplicationStakeMinimum\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"application/AppUnstakingTime\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"application/BaseRelaysPerPOKT\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"application/MaxApplications\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"application/MaximumChains\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"application/ParticipationRateOn\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"application/StabilityAdjustment\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"auth/MaxMemoCharacters\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"auth/TxSigLimit\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"gov/acl\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"gov/daoOwner\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"gov/upgrade\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"pocketcore/ClaimExpiration\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"auth/FeeMultipliers\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"pocketcore/ReplayAttackBurnMultiplier\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"pos/ProposerPercentage\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"pocketcore/ClaimSubmissionWindow\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"pocketcore/MinimumNumberOfProofs\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"pocketcore/SessionNodeCount\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"pocketcore/SupportedBlockchains\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"pos/BlocksPerSession\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"pos/DAOAllocation\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"pos/DowntimeJailDuration\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"pos/MaxEvidenceAge\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"pos/MaximumChains\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"pos/MaxJailedBlocks\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"pos/MaxValidators\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"pos/MinSignedPerWindow\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"pos/RelaysToTokensMultiplier\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"pos/SignedBlocksWindow\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"pos/SlashFractionDoubleSign\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"pos/SlashFractionDowntime\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"pos/StakeDenom\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"pos/StakeMinimum\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"pos/UnstakingTime\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"pos/ServicerStakeFloorMultiplier\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"pos/ServicerStakeWeightMultiplier\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"pos/ServicerStakeWeightCeiling\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"pos/ServicerStakeFloorMultiplierExponent\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"},{\"acl_key\":\"pocketcore/BlockByteSize\",\"address\":\"a83172b67b5ffbfcb8acb95acc0fd0466a9d4bc4\"}]}"
},
{
"param_key": "gov/upgrade",
"param_value": "{\"type\":\"gov/upgrade\",\"value\":{\"Height\":\"102687\",\"Version\":\"0.10.4\",\"OldUpgradeHeight\":\"74616\",\"Features\":[\"BLOCK:102698\",\"CRVAL:102690\",\"MREL:69232\",\"NCUST:74620\",\"OEDIT:102695\",\"REDUP:57620\",\"RSCAL:69232\"]}}"
}
],
"node_params": [
{
"param_key": "pos/MaxJailedBlocks",
"param_value": "37960"
},
{
"param_key": "pos/RelaysToTokensMultiplier",
"param_value": "435"
},
{
"param_key": "pos/UnstakingTime",
"param_value": "1814000000000000"
},
{
"param_key": "pos/SlashFractionDoubleSign",
"param_value": "0.000001000000000000"
},
{
"param_key": "pos/StakeMinimum",
"param_value": "15000000000"
},
{
"param_key": "pos/MaxEvidenceAge",
"param_value": "120000000000"
},
{
"param_key": "pos/MaximumChains",
"param_value": "15"
},
{
"param_key": "pos/ServicerStakeFloorMultiplier",
"param_value": "15000000000"
},
{
"param_key": "pos/SlashFractionDowntime",
"param_value": "0.000001000000000000"
},
{
"param_key": "pos/DowntimeJailDuration",
"param_value": "3600000000000"
},
{
"param_key": "pos/ServicerStakeFloorMultiplierExponent",
"param_value": "1.000000000000000000"
},
{
"param_key": "pos/StakeDenom",
"param_value": "upokt"
},
{
"param_key": "pos/DAOAllocation",
"param_value": "10"
},
{
"param_key": "pos/MaxValidators",
"param_value": "1000"
},
{
"param_key": "pos/ServicerStakeWeightMultiplier",
"param_value": "3.026000000000000000"
},
{
"param_key": "pos/BlocksPerSession",
"param_value": "4"
},
{
"param_key": "pos/MinSignedPerWindow",
"param_value": "0.600000000000000000"
},
{
"param_key": "pos/ServicerStakeWeightCeiling",
"param_value": "60000000000"
},
{
"param_key": "pos/ProposerPercentage",
"param_value": "5"
},
{
"param_key": "pos/SignedBlocksWindow",
"param_value": "10"
}
],
"pocket_params": [
{
"param_key": "pocketcore/ClaimExpiration",
"param_value": "24"
},
{
"param_key": "pocketcore/SessionNodeCount",
"param_value": "24"
},
{
"param_key": "pocketcore/ClaimSubmissionWindow",
"param_value": "3"
},
{
"param_key": "pocketcore/MinimumNumberOfProofs",
"param_value": "10"
},
{
"param_key": "pocketcore/ReplayAttackBurnMultiplier",
"param_value": "3"
},
{
"param_key": "pocketcore/BlockByteSize",
"param_value": "8000000"
},
{
"param_key": "pocketcore/SupportedBlockchains",
"param_value": "[\"0001\",\"0003\",\"0004\",\"0005\",\"0006\",\"0009\",\"000A\",\"000B\",\"000C\",\"000F\",\"0010\",\"0012\",\"0021\",\"0022\",\"0024\",\"0025\",\"0026\",\"0027\",\"0028\",\"0040\",\"0044\",\"0046\",\"0047\",\"0048\",\"0049\",\"0050\",\"0051\",\"0052\",\"0053\",\"0054\",\"0056\",\"0057\",\"0058\",\"0059\",\"0060\",\"0061\",\"0063\",\"0065\",\"0066\",\"0067\",\"0068\",\"0069\",\"0070\",\"0071\",\"0072\",\"0074\",\"0075\",\"0076\",\"0077\",\"0078\",\"0079\",\"0080\",\"0081\",\"0082\",\"03DF\",\"C006\"]"
}
]
}

*/
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
syntax = "proto3";
package poktroll.tokenomics;
package pocket.tokenomics;

import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
import "poktroll/tokenomics/params.proto";
import "pocket/tokenomics/params.proto";

option go_package = "github.com/pokt-network/poktroll/x/tokenomics/types";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
syntax = "proto3";
package poktroll.tokenomics;
package pocket.tokenomics;

option go_package = "github.com/pokt-network/poktroll/x/tokenomics/types";

Expand Down
13 changes: 0 additions & 13 deletions proto/poktroll/tokenomics/params.proto

This file was deleted.