Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Invalid opcode with byte code produced by solc v0.4.9 #526

Closed
8 tasks
NodeGuy opened this issue Mar 13, 2017 · 6 comments
Closed
8 tasks

Invalid opcode with byte code produced by solc v0.4.9 #526

NodeGuy opened this issue Mar 13, 2017 · 6 comments

Comments

@NodeGuy
Copy link

NodeGuy commented Mar 13, 2017

Please include in your bug report:

  • eris-db version (docker image tag or branch if built from source)

0.12.0

  • eris version (if applicable)

0.12.0

  • go version (if applicable)

go1.7.1 darwin/amd64

  • docker version (if applicable)

17.03.0-ce, build 60ccb22

  • operating system details (osx/windows/linux)

Mac OS

  • what you expected to happen

I compiled the following contract with solc v0.4.9 and deployed it to Eris DB. I expected it to work without errors as it did when compiled by solc v0.3.4.

    contract SimpleStorage {
        uint storedData;

        function set(uint x) {
            storedData = x;
        }

        function get() constant returns (uint retVal) {
            return storedData;
        }
    }
  • what actually happened
Eris DB error:  Call of method "transactAndHold" with parameters {
  "priv_key": "509C23F3C62CEC80BC65A3469995DE99725693E4844821E5D92030CA49E636080C042A82013C0331EBA235662B5B4A4A1A0D5FA2F33AB01D60EC44715800FC10",
  "address": "",
  "data": "60606040523415600b57fe5b5b60978061001a6000396000f300606060405263ffffffff60e060020a60003504166360fe47b18114602a5780636d4ce63c14603c575bfe5b3415603157fe5b603a600435605b565b005b3415604357fe5b60496064565b60408051918252519081900360200190f35b60008190555b50565b6000545b905600a165627a7a723058208e53003e967e78825a72cb55d6cd874952e373b8bb1e12bfed10820197680eaa0029",
  "gas_limit": 1000000,
  "fee": 0
} responded with "Error when transacting: Invalid opcode 4D697373696E67206F70636F64652030786665".
  • steps to reproduction

Check out https://github.com/eris-ltd/eris-contracts.js/tree/eris-db-%23526, run npm install, and TEST=record mocha test/HTTP.

@VoR0220
Copy link
Contributor

VoR0220 commented Mar 13, 2017

@NodeGuy do you mean the actual "Invalid" Opcode and we don't account for it?

@NodeGuy
Copy link
Author

NodeGuy commented Mar 13, 2017

Sorry, I hit Save by accident before I finished completing the issue. Please see my update.

@NodeGuy NodeGuy changed the title Invalid opcode with Solidity produced by solc v0.4.9 Invalid opcode with byte code produced by solc v0.4.9 Mar 13, 2017
@benjaminbollen
Copy link
Contributor

That would likely be caused by the new opcode introduced by EIP 141 "designated invalid instruction": ethereum/EIPs#141

and indeed that is introduced as of solc 0.4.9
https://github.com/ethereum/solidity/blob/develop/Changelog.md#049-2017-01-31

it is peculiar that the returned error does not return the actual opcode (that hex string is far too long); so that is a separate issue.

@oshin-gupta
Copy link

Also facing same problem...did anyone resolve it??

@silasdavis
Copy link
Contributor

I cannot reproduce this with solc 0.4.4, 0.4.9 or 0.4.20 - and I do not get the same payload as being sent their with transactAndHold. Will try with JS Libs

@compleatang
Copy link
Contributor

closing this issue as outdated. feel free to reopen if it arises again.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

6 participants