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

feat: implement new validator payout calculations #284

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
390e88c
feat: update params proto
shreyasbhat0 Sep 13, 2024
263ff06
chore: update arkeo module
shreyasbhat0 Sep 13, 2024
c323a7d
feat: add mint logic for distributing tokens
shreyasbhat0 Sep 13, 2024
34e7897
Increase claim timeout
toshiSat Sep 14, 2024
841a0cd
Fix claim timeout
toshiSat Sep 14, 2024
58d561e
feat: add new module accounts
shreyasbhat0 Sep 16, 2024
195ea70
feat: update validator payout
shreyasbhat0 Sep 16, 2024
bc765a5
feat: add module keys and update params
shreyasbhat0 Sep 16, 2024
a4fa054
chore: update changelog
shreyasbhat0 Sep 16, 2024
051443a
fix: module genesis init
shreyasbhat0 Sep 17, 2024
652f72c
fix: update regression tests
shreyasbhat0 Sep 17, 2024
085b6e8
Merge branch 'increase-claim-timeout' into feat/implement-logic-for-h…
shreyasbhat0 Sep 17, 2024
27db8c3
feat: update inflation handling and block reward
shreyasbhat0 Sep 17, 2024
0f4b467
fix: regression testing
shreyasbhat0 Sep 17, 2024
3bb1867
fix: test imports
shreyasbhat0 Sep 17, 2024
e4ffd8a
feat: update params
shreyasbhat0 Sep 18, 2024
8f4954f
feat: update foundational accounts for handling tokens
shreyasbhat0 Sep 18, 2024
31d1238
fix: update regression test
shreyasbhat0 Sep 18, 2024
38ffd86
feat: update param proto
shreyasbhat0 Sep 19, 2024
f7031a9
fix: regression testing
shreyasbhat0 Sep 19, 2024
73e535e
feat: update inflation and payout
shreyasbhat0 Sep 19, 2024
3b0e5ea
chore: update genesis file
shreyasbhat0 Sep 19, 2024
db0013d
fix: logging in modules
shreyasbhat0 Sep 19, 2024
62ba343
Merge branch 'master' into feat/implement-logic-for-handling-token-ec…
shreyasbhat0 Sep 19, 2024
1dd0b99
fix: regression tests
shreyasbhat0 Sep 19, 2024
87cd7e9
fix: go lint
shreyasbhat0 Sep 19, 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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ Contains all the PRs that improved the code without changing the behaviors.
- Thorchain Claims Proto Updates
- Documentation of Testnet Setup using local build and Cosmovisor
- Documentation update and addition of validator setup documentation
- New Module accounts to handle rewards
- New Params to Arkeo Module

## Fixed
- Testnet binary generation using go build
Expand All @@ -46,6 +48,7 @@ Contains all the PRs that improved the code without changing the behaviors.
- claim timeout
- Fixed module imports
- update module to implement APPModuleBasic and AppModule
- Updated Tests on arkeo module keeper

# v1.0.0-Prerelease

Expand Down
269 changes: 256 additions & 13 deletions api/arkeo/arkeo/params.pulsar.go

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,19 +201,18 @@ var (
// module account permissions
maccPerms = map[string][]string{
authtypes.FeeCollectorName: nil,
distrtypes.ModuleName: nil,
distrtypes.ModuleName: {authtypes.Minter},
icatypes.ModuleName: nil,
minttypes.ModuleName: {authtypes.Minter},
stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking},
stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking},
govtypes.ModuleName: {authtypes.Burner},
ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner},
claimmoduletypes.ModuleName: {authtypes.Minter},
arkeomoduletypes.ModuleName: {},
arkeomoduletypes.ModuleName: {authtypes.Minter},
arkeomoduletypes.ReserveName: {},
arkeomoduletypes.ProviderName: {},
arkeomoduletypes.ContractName: {},
// this line is used by starport scaffolding # stargate/app/maccPerms
}
)

Expand Down Expand Up @@ -595,6 +594,8 @@ func NewArkeoApp(
*app.Keepers.StakingKeeper,
govModuleAddr,
logger,
app.Keepers.MintKeeper,
app.Keepers.DistrKeeper,
)

/**** Module Options ****/
Expand Down
6 changes: 4 additions & 2 deletions app/app_regtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,14 @@ var (
// module account permissions
maccPerms = map[string][]string{
authtypes.FeeCollectorName: nil,
distrtypes.ModuleName: nil,
distrtypes.ModuleName: {authtypes.Minter},
icatypes.ModuleName: nil,
minttypes.ModuleName: {authtypes.Minter},
stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking},
stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking},
govtypes.ModuleName: {authtypes.Burner},
ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner},
arkeomoduletypes.ModuleName: {},
arkeomoduletypes.ModuleName: {authtypes.Minter},
arkeomoduletypes.ReserveName: {},
arkeomoduletypes.ProviderName: {},
arkeomoduletypes.ContractName: {},
Expand Down Expand Up @@ -602,6 +602,8 @@ func NewArkeoApp(
*app.Keepers.StakingKeeper,
govModuleAddr,
logger,
app.Keepers.MintKeeper,
app.Keepers.DistrKeeper,
)
arkeoModule := arkeomodule.NewAppModule(appCodec, app.ArkeoKeeper, app.Keepers.AccountKeeper, app.Keepers.BankKeeper, *app.Keepers.StakingKeeper)

Expand Down
9 changes: 8 additions & 1 deletion proto/arkeo/arkeo/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@ syntax = "proto3";
package arkeo.arkeo;

import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";
import "cosmos_proto/cosmos.proto";

option go_package = "github.com/arkeonetwork/arkeo/x/arkeo/types";

// Params defines the parameters for the module.
message Params { option (gogoproto.goproto_stringer) = false; }
message Params {
option (gogoproto.goproto_stringer) = false;
string CommunityPoolPercentage= 1 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false];
string DevFundPercentage= 2 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false];
string GrantFundPercentage= 3 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false];
}
9 changes: 9 additions & 0 deletions scripts/genesis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,15 @@ if [ ! -f ~/.arkeo/config/genesis.json ]; then
add_account "$BOB" $TOKEN 1000000000000000 # bob, 1m
add_claim_records "ARKEO" "$BOB" 1000 1000 1000 true

# Add Foundational Accounts
# FoundationCommunityAccount = "tarkeo1v50hrsxx0mxar4653aujcnqyjft07w0npcxrjx"
add_account "tarkeo1v50hrsxx0mxar4653aujcnqyjft07w0npcxrjx" $TOKEN 10000
# FoundationDevAccount = "tarkeo10sav33v67743s6cl2cvjmmua7c5arysw3txz9r"
add_account "tarkeo10sav33v67743s6cl2cvjmmua7c5arysw3txz9r" $TOKEN 10000
# FoundationGrantsAccount = "tarkeo16k3k0erkwaanqnup20dxxenpd6wh058nh4pgup"
add_account "tarkeo16k3k0erkwaanqnup20dxxenpd6wh058nh4pgup" $TOKEN 10000


# Thorchain derived test addresses
add_account "tarkeo1dllfyp57l4xj5umqfcqy6c2l3xfk0qk6zpc3t7" $TOKEN 1000000000000000 # bob, 10m
add_claim_records "ARKEO" "tarkeo1dllfyp57l4xj5umqfcqy6c2l3xfk0qk6zpc3t7" 1000 1000 1000 true
Expand Down
125 changes: 113 additions & 12 deletions test/regression/mnt/exports/suites_contracts_pay-as-you-go.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@
}
],
"next_contract_id": "2",
"params": {},
"params": {
"CommunityPoolPercentage": "10",
"DevFundPercentage": "20",
"GrantFundPercentage": "20"
},
"providers": [
{
"bond": "1000000000000",
Expand Down Expand Up @@ -115,17 +119,31 @@
},
"sequence": "2"
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"account_number": "11",
"address": "tarkeo1v50hrsxx0mxar4653aujcnqyjft07w0npcxrjx",
"pub_key": null,
"sequence": "0"
},
{
"@type": "/cosmos.auth.v1beta1.ModuleAccount",
"base_account": {
"account_number": "9",
"account_number": "14",
"address": "tarkeo1d0m97ywk2y4vq58ud6q5e0r3q9khj9e3unfe4t",
"pub_key": null,
"sequence": "0"
},
"name": "arkeo-reserve",
"permissions": []
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"account_number": "13",
"address": "tarkeo1w3shy6m9damxzmr0wpjhyvtgdeuhjdr8wq6hgempwfcxwvmcw5m8wdtrwu685umewp58svnv09nxudf5wd5qsks9jp",
"pub_key": null,
"sequence": "0"
},
{
"@type": "/cosmos.auth.v1beta1.ModuleAccount",
"base_account": {
Expand All @@ -139,6 +157,13 @@
"burner"
]
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"account_number": "10",
"address": "tarkeo10sav33v67743s6cl2cvjmmua7c5arysw3txz9r",
"pub_key": null,
"sequence": "0"
},
{
"@type": "/cosmos.auth.v1beta1.ModuleAccount",
"base_account": {
Expand All @@ -148,19 +173,34 @@
"sequence": "0"
},
"name": "distribution",
"permissions": []
"permissions": [
"minter"
]
},
{
"@type": "/cosmos.auth.v1beta1.ModuleAccount",
"base_account": {
"account_number": "10",
"account_number": "15",
"address": "tarkeo1kz2dkl8zlxwte008astc5e65htrxdcse6x3h3h",
"pub_key": null,
"sequence": "0"
},
"name": "contracts",
"permissions": []
},
{
"@type": "/cosmos.auth.v1beta1.ModuleAccount",
"base_account": {
"account_number": "9",
"address": "tarkeo1k8925g52vwe5jgfp4nqr7ljuhs7nzu2f8g0za5",
"pub_key": null,
"sequence": "0"
},
"name": "arkeo",
"permissions": [
"minter"
]
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"account_number": "0",
Expand All @@ -171,6 +211,13 @@
},
"sequence": "1"
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"account_number": "12",
"address": "tarkeo16k3k0erkwaanqnup20dxxenpd6wh058nh4pgup",
"pub_key": null,
"sequence": "0"
},
{
"@type": "/cosmos.auth.v1beta1.ModuleAccount",
"base_account": {
Expand Down Expand Up @@ -246,6 +293,15 @@
}
]
},
{
"address": "tarkeo1v50hrsxx0mxar4653aujcnqyjft07w0npcxrjx",
"coins": [
{
"amount": "621404328",
"denom": "uarkeo"
}
]
},
{
"address": "tarkeo1d0m97ywk2y4vq58ud6q5e0r3q9khj9e3unfe4t",
"coins": [
Expand All @@ -255,11 +311,47 @@
}
]
},
{
"address": "tarkeo10sav33v67743s6cl2cvjmmua7c5arysw3txz9r",
"coins": [
{
"amount": "643005225",
"denom": "uarkeo"
}
]
},
{
"address": "tarkeo1jv65s3grqf6v6jl3dp4t6c9t9rk99cd8t6gr9e",
"coins": [
{
"amount": "16066162928",
"amount": "15766261669",
"denom": "uarkeo"
}
]
},
{
"address": "tarkeo1k8925g52vwe5jgfp4nqr7ljuhs7nzu2f8g0za5",
"coins": [
{
"amount": "107167575",
"denom": "uarkeo"
}
]
},
{
"address": "tarkeo1hnyy4gp5tgarpg3xu6w5cw4zsyphx2lyvls9rz",
"coins": [
{
"amount": "1498845173",
"denom": "uarkeo"
}
]
},
{
"address": "tarkeo16k3k0erkwaanqnup20dxxenpd6wh058nh4pgup",
"coins": [
{
"amount": "643005225",
"denom": "uarkeo"
}
]
Expand All @@ -272,6 +364,15 @@
"denom": "uarkeo"
}
]
},
{
"address": "tarkeo1w3shy6m9damxzmr0wpjhyvtgdeuhjdr8wq6hgempwfcxwvmcw5m8wdtrwu685umewp58svnv09nxudf5wd5qsks9jp",
"coins": [
{
"amount": "1500352",
"denom": "uarkeo"
}
]
}
],
"denom_metadata": [],
Expand All @@ -282,7 +383,7 @@
"send_enabled": [],
"supply": [
{
"amount": "52001016066162928",
"amount": "52001019281189547",
"denom": "uarkeo"
}
]
Expand Down Expand Up @@ -357,7 +458,7 @@
"fee_pool": {
"community_pool": [
{
"amount": "321323258.560000000000000000",
"amount": "21421544.840000000000000000",
"denom": "uarkeo"
}
]
Expand All @@ -366,7 +467,7 @@
{
"outstanding_rewards": [
{
"amount": "15744839669.440000000000000000",
"amount": "15744840124.160000000000000000",
"denom": "uarkeo"
}
],
Expand All @@ -385,7 +486,7 @@
"accumulated": {
"commission": [
{
"amount": "1574483966.944000000000000000",
"amount": "1574484012.416000000000000000",
"denom": "uarkeo"
}
]
Expand All @@ -399,7 +500,7 @@
"period": "2",
"rewards": [
{
"amount": "14170355702.496000000000000000",
"amount": "14170356111.744000000000000000",
"denom": "uarkeo"
}
]
Expand Down Expand Up @@ -574,8 +675,8 @@
},
"mint": {
"minter": {
"annual_provisions": "6760124958900879.440734825593079684",
"inflation": "0.129999865570695682"
"annual_provisions": "6760125348991042.808880506171119200",
"inflation": "0.129999865570708475"
},
"params": {
"blocks_per_year": "6311520",
Expand Down
Loading
Loading