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

accounts/abi: fix bigInt topic encoding #28764

Merged
merged 1 commit into from
Jan 9, 2024

Conversation

rjl493456442
Copy link
Member

The bigInt encoding is wrong in contract topic if the bigInt is a negative number.

For example, the bigInt(-1) is encoded as 0000000000...000000000001, while it should be ffffffffff...ffff instead.

@holiman holiman added this to the 1.13.8 milestone Jan 9, 2024
@holiman holiman merged commit d0edc5a into ethereum:master Jan 9, 2024
2 of 3 checks passed
@MariusVanDerWijden MariusVanDerWijden modified the milestones: 1.13.8, 1.13.9 Jan 10, 2024
Dergarcon pushed a commit to specialmechanisms/mev-geth-0x2mev that referenced this pull request Jan 31, 2024
maoueh pushed a commit to streamingfast/go-ethereum that referenced this pull request Apr 29, 2024
holiman pushed a commit that referenced this pull request Nov 25, 2024
#28764 updated `func MakeTopics` to support negative `*big.Int`s.
However, it also changed the behavior of the function from just
_reading_ the input `*big.Int` via `Bytes()`, to leveraging
`big.U256Bytes` which is documented as being _destructive_:

This change updates `MakeTopics` to not mutate the original, and 
also applies the same change in signer/core/apitypes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants