-
Notifications
You must be signed in to change notification settings - Fork 790
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
Fix homestead [WIP] #125
Fix homestead [WIP] #125
Conversation
try { | ||
subGas(runState, new BN(fees.callNewAccountGas.v)) | ||
} catch (e) { | ||
done(e.error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be within a if (homestead)
check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the rule that a 0-value call creates a new account (and pays the new account gas fee) was there in frontier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, the commit log was a bit misleading. It fixes a bug when there wasn't sufficient gas left.
@@ -12,7 +12,7 @@ const codes = { | |||
0x08: ['ADDMOD', 8, 3, 1, false], | |||
0x09: ['MULMOD', 8, 3, 1, false], | |||
0x0a: ['EXP', 10, 2, 1, false], | |||
0x0b: ['SIGNEXTEND', 5, 1, 1, false], | |||
0x0b: ['SIGNEXTEND', 5, 2, 1, false], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you review the rest of the opcodes? Others might have bugs :)
lib/runCode.js
Outdated
@@ -131,6 +128,10 @@ module.exports = function (opts, cb) { | |||
return done(ERROR.STACK_UNDERFLOW) | |||
} | |||
|
|||
if (runState.stack.length - opInfo.in + opInfo.out > 1024) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you enclose the left side in parentheses?
Note that #84 will also be needed to complete homestead. |
There is another bug, |
Added eth_getBlockTransactionCountByHash RPC method
…refactoring Base trie code documentation and function clustering
The first commit prevents
runState.gasLimit
from going negative and failing the test case call_OOG_additionalGasCosts1 under Homestead.The second commit fixes the shallowStack_d10g0v0_Homestead test case, which executes the bytecode
0x60010b600055
:and should throw an OOG due to a stack underflow.
The third commit fixes some failing edge cases in the stackOverflow tests.