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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

VM has a lot of consensus breaking bugs 馃悶 #167

Closed
axic opened this issue Aug 11, 2017 · 2 comments 路 Fixed by #174
Closed

VM has a lot of consensus breaking bugs 馃悶 #167

axic opened this issue Aug 11, 2017 · 2 comments 路 Fixed by #174

Comments

@axic
Copy link
Member

axic commented Aug 11, 2017

While doing #159 I've realised that all the opcodes using memory locations are very likely consensus-broken because they are straight converted using utils.bufferToInt to Javascript numbers.

If the input number is >= 53 bits it will not behave correctly - old ethereumjs-util truncated it silently, while the new one properly throws an exception.

In many of the cases, if such a large number is encountered, it should result on an OOG, but in our case it can fail very likely with INVALID_OPCODE.

Makes me wonder if the state tests have a good coverage (because we do pass them...) or they are left to the VM tests to check these bounds?

@axic
Copy link
Member Author

axic commented Aug 11, 2017

Simple test case 0 <54 bit number> MSTORE.

@axic
Copy link
Member Author

axic commented Aug 11, 2017

Affected opcodes:

  • ISZERO
  • BYTE
  • SHA3
  • CALLDATALOAD
  • CALLDATACOPY
  • CODECOPY
  • EXTCODECOPY
  • BLOCKHASH
  • MLOAD
  • MSTORE
  • MSTORE8
  • JUMP
  • JUMPI
  • LOG
  • CREATE
  • CALL
  • CALLCODE
  • DELEGATECALL
  • RETURN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants