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

Switch to SDK Fork to Address Distribution Bug #885

Merged
merged 6 commits into from
Aug 10, 2023
Merged

Conversation

shellvish
Copy link
Contributor

@shellvish shellvish commented Aug 8, 2023

Context and purpose of the change

Switches to a forked version of Cosmos SDK v0.47.4 in order to solve a Distribution bug with SDK v0.47.x.

This shows the full set of changes to the SDK (1 line change). Conceptually, we are allowing a 5 STRD margin of error on a distribution sanity-check.

In practice, this will only affect delegators to one specific validator, and this change should get removed after we can more properly test a permanent fix.

I've verified that only one validator is affected by this bug, and the 5 STRD should fully unblock this validator until the permanent fix is implemented.

Example Responses

This query should throw an error on the current Stride mainnet, as it surfaces the panic in the Distribution module.
strided q distribution validator-distribution-info stridevaloper1tlz6ksce084ndhwlq2usghamvh0dut9q4z2gxd
This is the specific error that's thrown on mainnet:

❯ stridedm q distribution validator-distribution-info stridevaloper1tlz6ksce084ndhwlq2usghamvh0dut9q4z2gxd
Error: rpc error: code = Unknown desc = calculated final stake for delegator stride1tlz6ksce084ndhwlq2usghamvh0dut9qkhw52g greater than current stake
	final stake:	1299740.017859101302827268
	current stake:	1299610.045783281703011063: panic

This is the response for the sample query AFTER this change (to the modified SDK) has been made

❯ strided q distribution validator-distribution-info stridevaloper1tlz6ksce084ndhwlq2usghamvh0dut9q4z2gxd
commission:
- amount: "2504749330704918944.564117224352139868"
  denom: staevmos
- amount: "23237153505572987.265384893681320834"
  denom: stinj
- amount: "520385.142521074943330305"
  denom: stuatom
- amount: "247990.101336654014465285"
  denom: stucmdx
- amount: "251313.519274144872194249"
  denom: stujuno
- amount: "158167.775327994163030678"
  denom: stuluna
- amount: "1185768.021759805497729134"
  denom: stuosmo
- amount: "7194170.056717414847297582"
  denom: stustars
- amount: "2197505.563436254948222869"
  denom: stuumee
- amount: "30185402.326312111961059306"
  denom: ustrd
operator_address: stride1tlz6ksce084ndhwlq2usghamvh0dut9qkhw52g
self_bond_rewards:
- amount: "7290978248597596.721816683607460603"
  denom: staevmos
- amount: "67260912126102.494009226432357734"
  denom: stinj
- amount: "1531.298971156388797561"
  denom: stuatom
- amount: "721.807978984898090003"
  denom: stucmdx
- amount: "737.535825212068224782"
  denom: stujuno
- amount: "463.614519164498308594"
  denom: stuluna
- amount: "3486.519471965841569394"
  denom: stuosmo
- amount: "21433.923898688915284018"
  denom: stustars
- amount: "6396.940616447205740492"
  denom: stuumee
- amount: "80161.671366798448170474"
  denom: ustrd

@shellvish shellvish requested a review from asalzmann August 8, 2023 21:22
@shellvish shellvish changed the title Switch to SDK Fork to Address Distribution Bux Switch to SDK Fork to Address Distribution Bug Aug 8, 2023
@github-actions github-actions bot added the dependencies Pull requests that update a dependency file label Aug 8, 2023
Copy link
Collaborator

@sampocs sampocs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! Great job tracking this down, this was a tricky one!!

@sampocs sampocs merged commit 058f58a into main Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants