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

Add overflow checks for addition of AccessList cost in IntrinsicGas #290

Open
wants to merge 1 commit into
base: celo10
Choose a base branch
from

Conversation

Kourin1996
Copy link

Fixes https://github.com/celo-org/celo-blockchain-planning/issues/805

This PR adds overflow check before adding AccessList cost in IntrinsicGas function

@Kourin1996 Kourin1996 self-assigned this Dec 4, 2024
@palango
Copy link

palango commented Dec 4, 2024

Any idea why those checks aren't in upstream?

@Kourin1996
Copy link
Author

@palango As far as I see, I have no idea why. I checked the PR in geth but there was no comment for that.
Also I checked the code of erigon and nethermind. Erigon has such checks but nethermind doesn't have. (Maybe nethermind catches overflow by different way)

@Kourin1996
Copy link
Author

Btw, the case the audit report mentioned might not occur actually because it calls with only 10 bytes data and 1 access list item.

I checked all calls of IntrinsicGas and this issue might happen in normal case (adding tx into tx pool). But you need to give 16777216 TB data or 2^31 items of access list, maybe? (If I ignoring order of constant values) Does it occur actually? HTTP server should reject it before validating Tx.

@palango
Copy link

palango commented Dec 6, 2024

@Kourin1996 The changes look good but I'd still like to hear from upstream. Could you open a PR with those changes for go-ethereum?

@Kourin1996
Copy link
Author

Kourin1996 commented Dec 9, 2024

@palango Opened a issue to make sure it's necessary in ethereum/go-ethereum/issues/30880

@Kourin1996 Kourin1996 changed the base branch from celo10 to celo11 December 17, 2024 13:46
@Kourin1996 Kourin1996 changed the base branch from celo11 to celo10 December 17, 2024 13:47
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.

2 participants