Skip to content

fix(indexer): fix indexer bugs affecting zombie leases calculations#299

Merged
Redm4x merged 4 commits intomainfrom
fix/numeric-as-strings
Aug 13, 2024
Merged

fix(indexer): fix indexer bugs affecting zombie leases calculations#299
Redm4x merged 4 commits intomainfrom
fix/numeric-as-strings

Conversation

@Redm4x
Copy link
Contributor

@Redm4x Redm4x commented Aug 12, 2024

Bug 1 : Wrong type for decimal columns

Three columns were recently changed from bigint type to decimal. Those changes were applied to the database, but the typings were not updated accordingly. Sequelize handle decimal columns as string which caused some undetected issues in the indexer.

This PR sets the correct type (string) and adjust the code accordingly to restore the expected behavior. Calculations are still done using js numbers which could cause issues due to floating point inaccuracy. The BigInt type could be used in the future to improve that.

Bug 2 : Missing v1beta4 handler for MsgWithdrawLease

There was a missing handler for the v1beta4 version of MsgWithdrawLease. This means MsgWithdrawLease messages have not been processed since Nov 20, 2023. This resulted in the leases predictedClosedHeight being incorrectly updated. This PR adds the missing handler.

Impact & Resolution

Those 2 bugs affected the calculations of leased resources and spent amount when zombie leases occurs. However, since zombie leases issues are mostly mitigated now, the effect it had on reported stats is minimal (<0.001%). The fixes will be released shortly to prevent any more impact.

@Redm4x Redm4x marked this pull request as ready for review August 12, 2024 20:47
@Redm4x Redm4x force-pushed the fix/numeric-as-strings branch from 2e606c1 to de52ec1 Compare August 13, 2024 13:33
@Redm4x Redm4x changed the title fix(indexer): fix two indexer bugs affecting zombie leases calculations fix(indexer): fix indexer bugs affecting zombie leases calculations Aug 13, 2024
@Redm4x Redm4x merged commit a1a19ff into main Aug 13, 2024
@Redm4x Redm4x deleted the fix/numeric-as-strings branch August 13, 2024 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments