ignore bnb tx hash on token imbalances query that causes overflow - #381
Merged
bram-vdberg merged 3 commits intoAug 25, 2026
Merged
Conversation
bram-vdberg
approved these changes
Aug 25, 2026
bram-vdberg
deleted the
ignore_random_transfer_on_bnb_that_overflows_token_imbalances_query
branch
August 25, 2026 08:10
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.
Alternative solution to PR #380
Problem
The raw slippage query (4059683) fails with Overflow in INT256 cast of UINT256: 115792089237316...639935 for any BNB time window containing 2026-08-22 (reported in Slack).
Root cause: a spam token (0xf0e8fc6211feb9a1ea9f94609c245bc39973e4d7 on BNB) emitted a fake Transfer event of 2^256 − 1 atoms to the settlement contract in tx 0xf06378e10b27ccc35de3c8c2ba53fc6da2a5c837d9be5b10a584ab24dfa8a710 — a direct EOA→token call, not a settlement; there is no corresponding row in cow_protocol_bnb.trades. The token imbalances query (4021644) does cast(amount as int256) on every transfer amount, and max-uint256 does not fit into int256.