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] Refactoring claim settlement to enable Token Logic Modules #708

Merged
merged 51 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
a40ada7
WIP
Olshansk Jul 21, 2024
259a0db
Merge with main
Olshansk Jul 25, 2024
96a45a5
Early WIP
Olshansk Jul 26, 2024
7d49bb3
Work session with ramiro
Olshansk Jul 26, 2024
7cd7885
Merge with main
Olshansk Jul 30, 2024
8b33993
Code mostly cleaned up
Olshansk Jul 31, 2024
2a2f5e5
Compiles
Olshansk Jul 31, 2024
f09cbab
Unit tests beginning to pass
Olshansk Jul 31, 2024
beed2f7
Properly parsing consensus address
Olshansk Jul 31, 2024
c2ab024
Properly parsing consensus address
Olshansk Jul 31, 2024
0831311
Removed extra burn
Olshansk Jul 31, 2024
fe30985
Removed extra burn
Olshansk Jul 31, 2024
9247101
Fixed more unit tests
Olshansk Jul 31, 2024
757a84a
Tokenomic unit tests pass
Olshansk Jul 31, 2024
eade404
Update x/tokenomics/keeper/token_logic_modules.go
Olshansk Aug 2, 2024
66fb467
Update x/tokenomics/keeper/token_logic_modules.go
Olshansk Aug 2, 2024
b6310f0
[Quick PR] Add authz authorizations for core modules param changes (#…
okdas Jul 31, 2024
937d956
build(deps): bump github.com/docker/docker from 27.0.3+incompatible t…
dependabot[bot] Jul 31, 2024
adca883
Replying to review comments
Olshansk Aug 2, 2024
e029a5d
Compute units -> relays
Olshansk Aug 2, 2024
095e913
Merge branch 'main' into token_logic_module_base
Olshansk Aug 2, 2024
c902ef8
Update tests after fixing red0ne's bug
Olshansk Aug 2, 2024
362434b
Merge branch 'main' into token_logic_module_base
Olshansk Aug 5, 2024
45bba6d
Replying to review comments
Olshansk Aug 5, 2024
192521a
Reply to Red0ne's comment: https://github.com/pokt-network/poktroll/p…
Olshansk Aug 5, 2024
3253ba5
Empty commit
Olshansk Aug 5, 2024
9d0aa62
Skip flaky tests
Olshansk Aug 6, 2024
18d5276
Fixing flaky tests
Olshansk Aug 6, 2024
322d4c8
Fixing more tests
Olshansk Aug 6, 2024
cec5a90
More timeouts
Olshansk Aug 6, 2024
4cc2c3c
Self review
Olshansk Aug 6, 2024
4cf0a8a
Merge with skip_flaky_tests
Olshansk Aug 6, 2024
c6e25ed
Empty commit
Olshansk Aug 6, 2024
0058a8f
Empty commit
Olshansk Aug 6, 2024
6ea6974
fix another flaky test
Olshansk Aug 6, 2024
19dd7d1
Add source owners to genesis file
Olshansk Aug 6, 2024
ce7e2f9
Fixed TestFeatures/Relay_Namespace/
Olshansk Aug 6, 2024
b71809a
Merge branch 'skip_flaky_tests' into token_logic_module_base
Olshansk Aug 6, 2024
ab0ed2e
Update the show-service query and improve how we retrieve cupr from t…
Olshansk Aug 6, 2024
8447d4e
Verified tests work locally again
Olshansk Aug 7, 2024
7809bbf
Update pkg/relayer/session/sessiontree.go
Olshansk Aug 7, 2024
92d71b0
Reply to red0ne's comments
Olshansk Aug 7, 2024
4762ccb
Merge branch 'skip_flaky_tests' into token_logic_module_base
Olshansk Aug 7, 2024
2d50d85
Update TODOs in .proto files
Olshansk Aug 7, 2024
0d02517
Merge with main
Olshansk Aug 7, 2024
e82d432
Merge with main
Olshansk Aug 7, 2024
132391c
Merge with main
Olshansk Aug 7, 2024
e61849c
Fixed another test
Olshansk Aug 7, 2024
19258de
Fixed another test
Olshansk Aug 7, 2024
b0910c7
Comment out E2E test
Olshansk Aug 7, 2024
0f33c4f
Remove a breaking E2E test line
Olshansk Aug 7, 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
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -754,13 +754,13 @@ acc_balance_query: ## Query the balance of the account specified (make acc_balan

.PHONY: acc_balance_query_modules
acc_balance_query_modules: ## Query the balance of the network level module accounts
@echo "### Application ###"
@echo "### Application Module ###\n"
make acc_balance_query ACC=$(APPLICATION_MODULE_ADDRESS)
@echo "### Supplier ###"
@echo "### Supplier Module ###\n"
make acc_balance_query ACC=$(SUPPLIER_MODULE_ADDRESS)
@echo "### Gateway ###"
@echo "### Gateway Module ###\n"
make acc_balance_query ACC=$(GATEWAY_MODULE_ADDRESS)
@echo "### Service ###"
@echo "### Service Module ###\n"
make acc_balance_query ACC=$(SERVICE_MODULE_ADDRESS)

.PHONY: acc_balance_query_app1
Expand Down
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ func New(
//
// STAKING
//
// For provinding a different validator and consensus address codec, add it below.
// For providing a different validator and consensus address codec, add it below.
// By default the staking module uses the bech32 prefix provided in the auth config,
// and appends "valoper" and "valcons" for validator and consensus addresses respectively.
// When providing a custom address codec in auth, custom address codecs must be provided here as well.
Expand Down
12 changes: 12 additions & 0 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,21 @@ validators:
# We can persist arbitrary genesis values via 1 to 1 mapping to genesis.json
genesis:
app_state:
# https://docs.cosmos.network/main/build/modules/mint
mint:
params:
mint_denom: upokt
# Note that in Pocket Network, the majority of the inflation/deflation
# comes from the utility of network, not just the validators that
# secure it. Therefore, the inflation params of x/mint are set to 0.
# See x/tokenomics for all details related to token inflation.
inflation_rate_change: "0.0"
inflation_max: "0.0"
inflation_min: "0.0"
# These parameters are included for posterity but commented out for clarity
# goal_bonded: "NA"
# blocks_per_year: "NA"
# max_supply: "NA"
staking:
params:
bond_denom: upokt
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ require (
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/cometbft/cometbft-db v0.9.1 // indirect
github.com/containerd/continuity v0.4.2 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.15.1 // indirect
github.com/cosmos/btcutil v1.0.5 // indirect
github.com/cosmos/go-bip39 v1.0.0 // indirect
Expand Down Expand Up @@ -263,7 +264,7 @@ require (
github.com/vbatts/tar-split v0.11.5 // indirect
github.com/zondax/hid v0.9.2 // indirect
github.com/zondax/ledger-go v0.14.3 // indirect
go.etcd.io/bbolt v1.3.8 // indirect
go.etcd.io/bbolt v1.3.10 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,8 @@ github.com/cometbft/cometbft v0.38.7 h1:ULhIOJ9+LgSy6nLekhq9ae3juX3NnQUMMPyVdhZV
github.com/cometbft/cometbft v0.38.7/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY=
github.com/cometbft/cometbft-db v0.9.1 h1:MIhVX5ja5bXNHF8EYrThkG9F7r9kSfv8BX4LWaxWJ4M=
github.com/cometbft/cometbft-db v0.9.1/go.mod h1:iliyWaoV0mRwBJoizElCwwRA9Tf7jZJOURcRZF9m60U=
github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg=
github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM=
github.com/containerd/continuity v0.4.2 h1:v3y/4Yz5jwnvqPKJJ+7Wf93fyWoCB3F5EclWG023MDM=
github.com/containerd/continuity v0.4.2/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ=
github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=
github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo=
github.com/containerd/stargz-snapshotter/estargz v0.15.1 h1:eXJjw9RbkLFgioVaTG+G/ZW/0kEe2oEKCdS/ZxIyoCU=
Expand Down Expand Up @@ -1160,8 +1160,8 @@ github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWp
github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw=
github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI=
go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA=
go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw=
go.etcd.io/bbolt v1.3.10 h1:+BqfJTcCzTItrop8mq/lbzL8wSGtj94UO/3U31shqG0=
go.etcd.io/bbolt v1.3.10/go.mod h1:bK3UQLPJZly7IlNmV7uVHJDxfe5aK9Ll93e/74Y9oEQ=
go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg=
go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
Expand Down
2 changes: 1 addition & 1 deletion localnet/grafana-dashboards/claim_proof_logs.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
"uid": "P8E80F9AEF21F6940"
},
"editorMode": "builder",
"expr": "{container=\"poktrolld-validator\"} | json | method = `SettleSessionAccounting`",
"expr": "{container=\"poktrolld-validator\"} | json | method = `ProcessTokenLogicModules`",
"queryType": "range",
"refId": "Claim Settlement"
}
Expand Down
12 changes: 11 additions & 1 deletion testutil/integration/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,8 @@ func NewCompleteIntegrationApp(t *testing.T) *App {
accountKeeper,
blockedAddresses,
authority.String(),
logger)
logger,
)

// Prepare the shared keeper and module
sharedKeeper := sharedkeeper.NewKeeper(
Expand All @@ -280,6 +281,7 @@ func NewCompleteIntegrationApp(t *testing.T) *App {
cdc,
sharedKeeper,
accountKeeper,

bankKeeper,
)

Expand All @@ -289,6 +291,7 @@ func NewCompleteIntegrationApp(t *testing.T) *App {
runtime.NewKVStoreService(storeKeys[servicetypes.StoreKey]),
logger,
authority.String(),

bankKeeper,
)
serviceModule := service.NewAppModule(
Expand All @@ -304,6 +307,7 @@ func NewCompleteIntegrationApp(t *testing.T) *App {
runtime.NewKVStoreService(storeKeys[gatewaytypes.StoreKey]),
logger,
authority.String(),

bankKeeper,
)
gatewayModule := gateway.NewAppModule(
Expand Down Expand Up @@ -337,6 +341,7 @@ func NewCompleteIntegrationApp(t *testing.T) *App {
runtime.NewKVStoreService(storeKeys[suppliertypes.StoreKey]),
logger,
authority.String(),

bankKeeper,
sharedKeeper,
serviceKeeper,
Expand All @@ -355,6 +360,7 @@ func NewCompleteIntegrationApp(t *testing.T) *App {
runtime.NewKVStoreService(storeKeys[sessiontypes.StoreKey]),
logger,
authority.String(),

accountKeeper,
bankKeeper,
applicationKeeper,
Expand All @@ -374,6 +380,7 @@ func NewCompleteIntegrationApp(t *testing.T) *App {
runtime.NewKVStoreService(storeKeys[prooftypes.StoreKey]),
logger,
authority.String(),

sessionKeeper,
applicationKeeper,
accountKeeper,
Expand All @@ -391,12 +398,15 @@ func NewCompleteIntegrationApp(t *testing.T) *App {
runtime.NewKVStoreService(storeKeys[tokenomicstypes.StoreKey]),
logger,
authority.String(),

bankKeeper,
accountKeeper,
applicationKeeper,
supplierKeeper,
proofKeeper,
sharedKeeper,
sessionKeeper,
serviceKeeper,
)
tokenomicsModule := tokenomics.NewAppModule(
cdc,
Expand Down
3 changes: 0 additions & 3 deletions testutil/keeper/supplier.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,3 @@ func SupplierKeeper(t testing.TB) (keeper.Keeper, context.Context) {

return k, ctx
}

// TODO_OPTIMIZE: Index suppliers by service so we can easily query k.GetAllSuppliers(ctx, Service)
// func (k Keeper) GetAllSuppliers(ctx, sdkContext, serviceId string) (suppliers []sharedtypes.Supplier) {}
Loading
Loading