-
Notifications
You must be signed in to change notification settings - Fork 20.4k
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
Negative signed integers as indexed event inputs are not decoded correctly #20266
Comments
gballet
pushed a commit
that referenced
this issue
Dec 18, 2019
…fields (#20269) * fix parseTopics() and add tests * remove printf * add ParseTopicsIntoMap() tests * fix FixedBytesTy * fix int and fixed bytes * golint topics_test.go
enriquefynn
pushed a commit
to enriquefynn/go-ethereum
that referenced
this issue
Mar 10, 2021
…d event fields (ethereum#20269) * fix parseTopics() and add tests * remove printf * add ParseTopicsIntoMap() tests * fix FixedBytesTy * fix int and fixed bytes * golint topics_test.go
gzliudan
pushed a commit
to gzliudan/XDPoSChain
that referenced
this issue
Jan 3, 2025
…d event fields (ethereum#20269) * fix parseTopics() and add tests * remove printf * add ParseTopicsIntoMap() tests * fix FixedBytesTy * fix int and fixed bytes * golint topics_test.go
gzliudan
added a commit
to gzliudan/XDPoSChain
that referenced
this issue
Jan 3, 2025
…d event fields (ethereum#20269) * fix parseTopics() and add tests * remove printf * add ParseTopicsIntoMap() tests * fix FixedBytesTy * fix int and fixed bytes * golint topics_test.go
gzliudan
added a commit
to gzliudan/XDPoSChain
that referenced
this issue
Jan 4, 2025
…d event fields (ethereum#20269) * fix parseTopics() and add tests * remove printf * add ParseTopicsIntoMap() tests * fix FixedBytesTy * fix int and fixed bytes * golint topics_test.go
gzliudan
added a commit
to gzliudan/XDPoSChain
that referenced
this issue
Jan 6, 2025
…d event fields (ethereum#20269) * fix parseTopics() and add tests * remove printf * add ParseTopicsIntoMap() tests * fix FixedBytesTy * fix int and fixed bytes * golint topics_test.go
gzliudan
added a commit
to gzliudan/XDPoSChain
that referenced
this issue
Jan 7, 2025
…d event fields (ethereum#20269) * fix parseTopics() and add tests * remove printf * add ParseTopicsIntoMap() tests * fix FixedBytesTy * fix int and fixed bytes * golint topics_test.go
gzliudan
added a commit
to gzliudan/XDPoSChain
that referenced
this issue
Jan 7, 2025
…d event fields (ethereum#20269) * fix parseTopics() and add tests * remove printf * add ParseTopicsIntoMap() tests * fix FixedBytesTy * fix int and fixed bytes * golint topics_test.go
gzliudan
added a commit
to gzliudan/XDPoSChain
that referenced
this issue
Jan 7, 2025
…d event fields (ethereum#20269) * fix parseTopics() and add tests * remove printf * add ParseTopicsIntoMap() tests * fix FixedBytesTy * fix int and fixed bytes * golint topics_test.go
gzliudan
added a commit
to gzliudan/XDPoSChain
that referenced
this issue
Jan 9, 2025
…d event fields (ethereum#20269) * fix parseTopics() and add tests * remove printf * add ParseTopicsIntoMap() tests * fix FixedBytesTy * fix int and fixed bytes * golint topics_test.go
gzliudan
added a commit
to gzliudan/XDPoSChain
that referenced
this issue
Jan 10, 2025
…d event fields (ethereum#20269) * fix parseTopics() and add tests * remove printf * add ParseTopicsIntoMap() tests * fix FixedBytesTy * fix int and fixed bytes * golint topics_test.go
gzliudan
added a commit
to gzliudan/XDPoSChain
that referenced
this issue
Jan 10, 2025
…d event fields (ethereum#20269) * fix parseTopics() and add tests * remove printf * add ParseTopicsIntoMap() tests * fix FixedBytesTy * fix int and fixed bytes * golint topics_test.go
gzliudan
added a commit
to gzliudan/XDPoSChain
that referenced
this issue
Jan 10, 2025
…d event fields (ethereum#20269) * fix parseTopics() and add tests * remove printf * add ParseTopicsIntoMap() tests * fix FixedBytesTy * fix int and fixed bytes * golint topics_test.go
gzliudan
added a commit
to gzliudan/XDPoSChain
that referenced
this issue
Jan 10, 2025
…d event fields (ethereum#20269) * fix parseTopics() and add tests * remove printf * add ParseTopicsIntoMap() tests * fix FixedBytesTy * fix int and fixed bytes * golint topics_test.go
gzliudan
added a commit
to gzliudan/XDPoSChain
that referenced
this issue
Jan 14, 2025
…d event fields (ethereum#20269) * fix parseTopics() and add tests * remove printf * add ParseTopicsIntoMap() tests * fix FixedBytesTy * fix int and fixed bytes * golint topics_test.go
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
System information
Geth version:
OS & Version: macOS 10.14.6
Expected behaviour
Events which emit negative signed integers with size >64 bits are decoded correctly.
Actual behaviour
They are treated as unsigned integers and not decoded correctly.
Steps to reproduce the behaviour
The problem is here:
go-ethereum/accounts/abi/bind/topics.go
Lines 214 to 215 in de2259d
For integers with size >64 bits, negative values will be encoded by the EVM with a size larger than
max(int256)
. For example, -1 for anint256
(orint192
, etc.) is2^256-1
, -2 is2^256-2
, etc.Non-indexed inputs are decoded correctly via
readInteger()
inaccounts/abi/unpack.go
:go-ethereum/accounts/abi/unpack.go
Lines 56 to 71 in de2259d
To reproduce:
send192(-1)
andsend192Indexed(-1)
.The text was updated successfully, but these errors were encountered: