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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/runCall.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@ module.exports = function (opts, cb) {
var totalGas = results.gasUsed
if (!results.runState.vmError) {
var returnFee = results.return.length * fees.createDataGas.v

// 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.

}

totalGas = totalGas.addn(returnFee)
}
// if not enough gas
Expand Down
3 changes: 1 addition & 2 deletions tests/tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ const skipBroken = [
'TransactionCollisionToEmptyButCode', // temporary till fixed (2017-09-21)
'TransactionCollisionToEmptyButNonce', // temporary till fixed (2017-09-21)
'RevertDepthCreateAddressCollision', // test case is wrong
'randomStatetest642', // BROKEN, rustbn.js error
'randomStatetest643' // BROKEN, breaks tests run (leave at the end), rustbn.js error
'randomStatetest642' // BROKEN, rustbn.js error
]
// tests skipped due to system specifics / design considerations
const skipPermanent = [
Expand Down