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

Fixes randomStatetest643 exception #235

Merged
merged 2 commits into from
Nov 25, 2017

Conversation

hugo-dc
Copy link
Contributor

@hugo-dc hugo-dc commented Nov 22, 2017

Current exception in randomStatetest is because an assertion in the bn.js module, it checks that the number to be added is less than 0x4000000

https://github.com/indutny/bn.js/blob/master/lib/bn.js#L2129

These changes checks returnFee, if its greater than gasLimit set it as gasLimit + 1, this avoids BN assertion failure when returnFee is bigger than 0x4000000 and ending as an OOG exception as expected.

Closes #195

@jwasinger
Copy link
Contributor

jwasinger commented Nov 23, 2017

Thanks for the fix. Pls change this line (https://github.com/ethereumjs/ethereumjs-vm/blob/master/tests/tester.js#L16) as well so that the test is run. then rebase against master, and I will approve.

@hugo-dc
Copy link
Contributor Author

hugo-dc commented Nov 25, 2017

@jwasinger , removed test from skipped tests and rebased against master.

@jwasinger jwasinger merged commit c7a14fe into ethereumjs:master Nov 25, 2017
@jwasinger
Copy link
Contributor

Thanks


// avoid BN assertion failure when returnFee is greater than 0x4000000
if (returnFee > gasLimit.toNumber()) {
returnFee = gasLimit.toNumber() + 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this instead emit an "internal error" here? It would be more straightfoward as this one is causing an OOG below, but it is not clear without reading the next if.

@axic axic self-assigned this Feb 13, 2018
holgerd77 added a commit that referenced this pull request Mar 11, 2021
Add basic API tests for re-exports
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

randomStatetest643 is broken
4 participants