Skip to content

Conversation

@IvanKavaldzhiev
Copy link
Contributor

@IvanKavaldzhiev IvanKavaldzhiev commented Oct 3, 2025

Description:
It seems users are passing evm address value as token addresses, which results to decoding them in a very big number that overflows Long type and produces TokenID with negative num value.

In case of such a wrong input in the calldata this PR returns null, instead of trying to decode this TokenID, the PR changes the logic to just return a null value and most likely lead to the transaction getting reverted. This will also clear out Grafana logs with unnecessary exception statements.

Fixes #12082

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@IvanKavaldzhiev IvanKavaldzhiev self-assigned this Oct 3, 2025
@IvanKavaldzhiev IvanKavaldzhiev requested a review from a team as a code owner October 3, 2025 19:05
@IvanKavaldzhiev IvanKavaldzhiev added the bug Type: Something isn't working label Oct 3, 2025
@IvanKavaldzhiev IvanKavaldzhiev added the web3 Area: Web3 API label Oct 3, 2025
@lfdt-bot
Copy link

lfdt-bot commented Oct 3, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

@IvanKavaldzhiev IvanKavaldzhiev changed the title Return null in case token with negative num value is getting fetched Return null in case token with negative num value is being read Oct 3, 2025
@steven-sheehy steven-sheehy added this to the 0.141.0 milestone Oct 3, 2025
@codacy-production
Copy link

codacy-production bot commented Oct 6, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-31.44% (target: -1.00%) 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (a893f6e) 36899 33614 91.10%
Head commit (48f5ee5) 60887 (+23988) 36321 (+2707) 59.65% (-31.44%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#12124) 3 3 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Copy link
Contributor

@steven-sheehy steven-sheehy left a comment

Choose a reason for hiding this comment

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

LGTM

@steven-sheehy steven-sheehy merged commit aa23bad into main Oct 7, 2025
32 of 34 checks passed
@steven-sheehy steven-sheehy deleted the 12082-return-null-for-invalid-token-id branch October 7, 2025 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Type: Something isn't working web3 Area: Web3 API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

InvalidEntityException: Invalid entity ID

6 participants