Skip to content

Provide basic tolerance to EIP-1559 data #467

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

Merged
merged 2 commits into from
Mar 23, 2022
Merged

Provide basic tolerance to EIP-1559 data #467

merged 2 commits into from
Mar 23, 2022

Conversation

mloit
Copy link
Contributor

@mloit mloit commented Feb 10, 2022

Provides some basic tolerance if a EIP-1559 [or future] unknown envelope is encountered. Decoding is abandoned if the field type is present and not 0. Otherwise if 0 or not present decoding is allowed as it is a legacy encoding.

Also included are some range checks at specific places to prevent the overflow condition from happening that results in the precondition trigger in the BigUInt library from halting execution. The result of the subsequent calculation will be incorrect, but the data going in was incorrect anyway... at least it doesn't crash.

fixes #463

Test for the envelope 'type' if 0 or not present we assume legacy and can continue, otherwise abort as it is 1559 [or future] and we don't know its encoding
Added some basic garbage-in garbage out checks to prevent calculations from generating an overflow. This will mean what comes out is garbage, but at least it didn't crash.
@yaroslavyaroslav yaroslavyaroslav self-requested a review March 15, 2022 15:21
@mloit
Copy link
Contributor Author

mloit commented Mar 20, 2022

Just a heads up: This PR will soon be obsoleted by a new one coming in the next few days that brings in EIP-2718, EIP-2930, and EIP-1559 with full encode/decode support

@yaroslavyaroslav
Copy link
Collaborator

@mloit should i merge it or wait for coming one?

@mloit
Copy link
Contributor Author

mloit commented Mar 22, 2022

@mloit should i merge it or wait for coming one?

you can merge it. While I may get the PR out before your Wednesday time [took a break to do something else today] I expect it will take a while to be evaluated and reviewed.

@yaroslavyaroslav yaroslavyaroslav merged commit f85ab50 into web3swift-team:develop Mar 23, 2022
@mloit mloit deleted the tolerate1559 branch March 23, 2022 12:05
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.

getTransactionDetails() on EIP-1159 transaction crashes
3 participants