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

pindexer: crash on "out of range integral type conversion" #4906

Closed
conorsch opened this issue Oct 28, 2024 · 1 comment · Fixed by #4907
Closed

pindexer: crash on "out of range integral type conversion" #4906

conorsch opened this issue Oct 28, 2024 · 1 comment · Fixed by #4907
Assignees
Labels
C-bug Category: a bug

Comments

@conorsch
Copy link
Contributor

Describe the bug
A running instance of pindexer version v0.80.7 recently crashed with error message:

Error: out of range integral type conversion attempted

After brief investigation, @cronokirby pointed to a possible underflow in how pindexer reconciles VCB events. Possible solutions are to enforce ordering in the emission of ABCI events, or just make pindexer more forgiving. We've already confirmed that total counts of the ins and outs of the dex in a pindexer database sum to 0, which is as expected, so any variation would happen with a single block and should be forgiven.

@github-actions github-actions bot added the needs-refinement unclear, incomplete, or stub issue that needs work label Oct 28, 2024
@conorsch conorsch removed the needs-refinement unclear, incomplete, or stub issue that needs work label Oct 28, 2024
@cronokirby cronokirby added the C-bug Category: a bug label Oct 28, 2024
@cronokirby
Copy link
Contributor

cronokirby commented Oct 28, 2024

dex: current.dex - removed,
is where the issue is sourced from, and happens when this subtraction underflows, causing the value to not fit in a u64.

The reason this happens is because there's no guaranteed ordering between the debit and credit events of a block, so in particular the dex supply can "temporarily" be negative.
I've empirically confirmed that on mainnet, this value never stays negative by the end of a block, so this issue is purely an event processing related concern, and there's no indication that event emission has a bug in any way.

The simplest fix is probably just to allow this value in the supply app view to be negative, which shouldn't ever be observable unless currently processing the events for a given block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: a bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants