[Bug] Read a map-era slash that takes the supplier below its minimum stake - #98
Merged
Merged
Conversation
The GraphQL descriptions of get_income and get_supplier_distribution named by_reason but not the column it fills, so a reader of the schema alone could not find the relay / global split.
…nimum stake The map-era bank segmentation took a burn as a slash burn only when the next event was EventSupplierSlashed, but when the slash leaves the stake below the minimum poktroll emits EventSupplierUnbondingBegin between the two (settle_pending_claims.go), so the history job stopped on beta 133,593 with "0 slash burns after the last claim, expected 1". The unbonding event is now allowed in between, and that real block is a fixture of the map-era payload tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
EventSupplierUnbondingBeginbetween the slash burn andEventSupplierSlashed(x/tokenomics/keeper/settle_pending_claims.go, the same order from v0.1.27 to v0.1.32), and the bank segmentation only accepted the slash right after the burn.get_incomeandget_supplier_distributionsay thatby_reasonsplits in thefamilycolumn (relay / global).Issue
The beta history job stopped at height 133,593 (map_all_bonded_deflation) with
0 slash burns after the last claim, expected 1. Mainnet has 34 map-era heights with a slash and a below-minimum unbonding in the same block, so its history job would stop the same way when it reaches those eras.Testing
yarn test:unit: the map-era payload test reads the real beta block 133,593 (fixture) and checks its 31 claims, their 558 upokt and the 1 upokt slash; it fails without the fix with the job's error. A synthetic test checks that any other event between the burn and the slash is still refused.yarn test:money(PostgreSQL).Deploy
The live indexer only reads the batched_vrd era today, so it needs no change. The history jobs need an image of this commit: beta resumes from 133,593, and mainnet's job switches to it before it reaches the map eras (below 703,870). The description wording is already applied in pnf by
COMMENT ON FUNCTION.