-
Notifications
You must be signed in to change notification settings - Fork 8
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] Harden settlement (part 1: TLM isolation) #889
base: main
Are you sure you want to change the base?
Conversation
The CI will now also run the e2e tests on devnet, which increases the time it takes to complete all CI checks. You may need to run GCP workloads (requires changing the namespace to 889) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
linter-name (fail-on-found)
x/tokenomics/token_logic_module/result.go|76 col 4| // TODO_IN_THIS_COMMIT: godoc...
x/tokenomics/token_logic_module/result.go|88 col 4| // TODO_IN_THIS_COMMIT: godoc...
x/tokenomics/token_logic_module/result.go|93 col 4| // TODO_IN_THIS_COMMIT: godoc...
x/tokenomics/token_logic_module/result.go|98 col 4| // TODO_IN_THIS_COMMIT: godoc...
x/tokenomics/token_logic_module/result.go|103 col 4| // TODO_IN_THIS_COMMIT: godoc...
x/tokenomics/token_logic_module/result.go|108 col 4| // TODO_IN_THIS_COMMIT: godoc...
x/tokenomics/token_logic_module/result.go|113 col 4| // TODO_IN_THIS_COMMIT: godoc... use for determinstic loops
x/tokenomics/token_logic_module/result.go|118 col 4| // TODO_IN_THIS_COMMIT: godoc...
x/tokenomics/token_logic_module/result.go|123 col 4| // TODO_IN_THIS_COMMIT: godoc...
x/tokenomics/token_logic_module/result.go|128 col 4| // TODO_IN_THIS_COMMIT: godoc...
x/tokenomics/token_logic_module/result.go|133 col 4| // TODO_IN_THIS_COMMIT: godoc...
x/tokenomics/token_logic_module/result.go|138 col 4| // TODO_IN_THIS_COMMIT: godoc...
x/tokenomics/token_logic_module/result.go|152 col 4| // TODO_IN_THIS_COMMIT: godoc...
x/tokenomics/token_logic_module/result.go|166 col 4| // TODO_IN_THIS_COMMIT: godoc...
x/tokenomics/token_logic_module/result.go|172 col 4| // TODO_IN_THIS_COMMIT: godoc...
x/tokenomics/token_logic_module/result.go|180 col 4| // TODO_IN_THIS_COMMIT: godoc...
x/tokenomics/token_logic_module/result.go|188 col 4| // TODO_IN_THIS_COMMIT: godoc... use for determinstic loops
x/tokenomics/token_logic_module/result.go|196 col 4| // TODO_IN_THIS_COMMIT: godoc... // SHOULD NEVER be used for loops
x/tokenomics/token_logic_module/result.go|213 col 4| // TODO_IN_THIS_COMMIT: godoc... // SHOULD NEVER be used for loops
2df9645
to
77a3944
Compare
3731434
to
65c9499
Compare
- Isolate TLM processors from the tokenomics keeper - Restructure TLM processors to avoid non-deterministic execution - Consolidate and postpone ALL state modification until the end of settlement
d5eb029
to
24ceb12
Compare
tests/integration/tokenomics/token_logic_modules/commutative_test.go
Outdated
Show resolved
Hide resolved
tests/integration/tokenomics/token_logic_modules/commutative_test.go
Outdated
Show resolved
Hide resolved
tests/integration/tokenomics/token_logic_modules/commutative_test.go
Outdated
Show resolved
Hide resolved
tests/integration/tokenomics/token_logic_modules/commutative_test.go
Outdated
Show resolved
Hide resolved
tests/integration/tokenomics/token_logic_modules/tlm_processor_suite_test.go
Outdated
Show resolved
Hide resolved
tests/integration/tokenomics/token_logic_modules/tlm_processor_suite_test.go
Outdated
Show resolved
Hide resolved
tests/integration/tokenomics/token_logic_modules/tlm_processor_suite_test.go
Outdated
Show resolved
Hide resolved
tests/integration/tokenomics/token_logic_modules/tlm_processor_suite_test.go
Outdated
Show resolved
Hide resolved
tests/integration/tokenomics/token_logic_modules/tlm_processor_suite_test.go
Outdated
Show resolved
Hide resolved
tests/integration/tokenomics/token_logic_modules/tlm_processor_suite_test.go
Outdated
Show resolved
Hide resolved
871cf8b
to
6335d3d
Compare
|
||
// GetNumComputeUnits returns the number of claimed compute units in the result's claim. | ||
func (r *SettlementResult) GetNumComputeUnits() (uint64, error) { | ||
return r.Claim.GetNumClaimedComputeUnits() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OPTIONAL NIT (here and below):
if r.Claim == nil {
return 0, fmt.Errorf("Claim is nil in SettlementResult")
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#Claim
is not a pointer.
logger.Error(fmt.Sprintf("error slashing supplier %s: %s", expiredResult.GetSupplierOperatorAddr(), err)) | ||
return err | ||
} | ||
//} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rm
//slices.Sort(expiredClaimSupplierOperatorAddresses) | ||
//for _, supplierOperatorAddress := range expiredClaimSupplierOperatorAddresses { | ||
// slashingCount := supplierToExpiredClaimCount[supplierOperatorAddress] | ||
if err := k.slashSupplierStake(ctx, expiredResult, expiredResult.GetSupplierOperatorAddr()); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just pass expiredResult
and that's it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for calling this out! 🙌
I think this was an incomplete refactor. This PR has gotten quite large and has been around for a bit. 😅 🎂 ➕
if err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, suppliertypes.ModuleName, tokenomicstypes.ModuleName, cosmostypes.NewCoins(totalSlashingCoin)); err != nil { | ||
return err | ||
} | ||
//if err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, suppliertypes.ModuleName, tokenomicstypes.ModuleName, cosmostypes.NewCoins(slashingCoin)); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rm
Co-authored-by: Daniel Olshansky <[email protected]>
* todo_beta/upnext: [C&P] Populate NumEstimatedComputeUnits and ClaimedUpokt of Claim and Proof events (#927) [Tokenomics] feat: add `dao_reward_address` param to tokenomics module (#922) chore: review feedback improvements chore: review feedback improvements [Service] Return the default RelayMinerDifficuly for services that have none. (#926) [Upgrade] Alpha TestNet v0.0.10 upgrade (#894) Update reviewdog.yml
…tlement * pokt/main: [Tokenomics] Consolidate `mint_allocation_<actor>` params & CLI cleanup (#923)
Summary
Refactors claim settlement and token logic module processing:
Issue
Type of change
Select one or more from the following:
consensus-breaking
label if so. See [Infra] Automatically add theconsensus-breaking
label #791 for detailsTesting
make docusaurus_start
; only needed if you make doc changesmake go_develop_and_test
make test_e2e
devnet-test-e2e
label to the PR.Sanity Checklist