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

MUD indexer incorrectly decoding negative integers part of key tuple #3361

Open
dhvanipa opened this issue Nov 5, 2024 · 0 comments
Open

Comments

@dhvanipa
Copy link
Contributor

dhvanipa commented Nov 5, 2024

The following query is incorrectly decoding a negative int16 in the key of the following table:

Terrain table:

ReversePosition: {
  schema: {
    x: "int16",
    y: "int16",
    z: "int16",
    entityId: "bytes32",
  },
  key: ["x", "y", "z"],
}

Query:

curl 'https://indexer.mud.redstonechain.com/q' \
  -H 'content-type: application/json' \
  --data-raw '[{"address":"0xf75b1b7bdb6932e487c4aa8d210f4a682abeacf0","query":"SELECT x, y, z, entityId FROM ReversePosition LIMIT 10"}]'

Sample Result:

{"block_height":9297985,"result":[[["x","y","z","entityid"],["449","23","115792089237316195423570985008687907853269984665640564039457584007913129639733","0x00000000000000000000000000000000000000000000000000000000000004a6"],["417","19","115792089237316195423570985008687907853269984665640564039457584007913129639734","0x000000000000000000000000000000000000000000000000000000000000049d"],["397","17","115792089237316195423570985008687907853269984665640564039457584007913129639734","0x000000000000000000000000000000000000000000000000000000000000049b"],["448","20","115792089237316195423570985008687907853269984665640564039457584007913129639734","0x00000000000000000000000000000000000000000000000000000000000004a0"],["437","20","115792089237316195423570985008687907853269984665640564039457584007913129639734","0x000000000000000000000000000000000000000000000000000000000000049f"],["448","21","115792089237316195423570985008687907853269984665640564039457584007913129639734","0x00000000000000000000000000000000000000000000000000000000000004a1"],["448","22","115792089237316195423570985008687907853269984665640564039457584007913129639734","0x00000000000000000000000000000000000000000000000000000000000004a2"],["387","18","115792089237316195423570985008687907853269984665640564039457584007913129639724","0x000000000000000000000000000000000000000000000000000000000000049a"],["427","20","115792089237316195423570985008687907853269984665640564039457584007913129639733","0x000000000000000000000000000000000000000000000000000000000000049e"],["448","23","115792089237316195423570985008687907853269984665640564039457584007913129639734","0x00000000000000000000000000000000000000000000000000000000000004a3"]]]}

eg the first entry for z 115792089237316195423570985008687907853269984665640564039457584007913129639733 is actually a negative integer.

@dhvanipa dhvanipa changed the title MUD Indexer Incorrectly Decoding Negative Integers In The Key MUD indexer incorrectly decoding negative integers part of key tuple Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant