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

Istanbule #628

Closed
wants to merge 2 commits into from
Closed

Istanbule #628

wants to merge 2 commits into from

Conversation

winsvega
Copy link
Collaborator

No description provided.

@holiman
Copy link
Contributor

holiman commented Aug 23, 2019

I tested one of these, getting errors:

[user@work go-ethereum]$ build/bin/evm --json statetest /home/user/workspace/tests/GeneralStateTests/stExample/balance.json 

...

{"pc":0,"op":115,"gas":"0x5c878","gasCost":"0x3","memory":"0x","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH20","error":""}
{"pc":21,"op":49,"gas":"0x5c875","gasCost":"0x2bc","memory":"0x","memSize":0,"stack":["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b"],"depth":1,"refund":0,"opName":"BALANCE","error":""}
{"pc":22,"op":96,"gas":"0x5c5b9","gasCost":"0x3","memory":"0x","memSize":0,"stack":["0xde0b6b3a75c5ee0"],"depth":1,"refund":0,"opName":"PUSH1","error":""}
{"pc":24,"op":85,"gas":"0x5c5b6","gasCost":"0x4e20","memory":"0x","memSize":0,"stack":["0xde0b6b3a75c5ee0","0x0"],"depth":1,"refund":0,"opName":"SSTORE","error":""}
{"pc":25,"op":90,"gas":"0x57796","gasCost":"0x2","memory":"0x","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"GAS","error":""}
{"pc":26,"op":96,"gas":"0x57794","gasCost":"0x3","memory":"0x","memSize":0,"stack":["0x57794"],"depth":1,"refund":0,"opName":"PUSH1","error":""}
{"pc":28,"op":85,"gas":"0x57791","gasCost":"0x4e20","memory":"0x","memSize":0,"stack":["0x57794","0x1"],"depth":1,"refund":0,"opName":"SSTORE","error":""}
{"pc":29,"op":0,"gas":"0x52971","gasCost":"0x0","memory":"0x","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"STOP","error":""}
{"output":"","gasUsed":"0x9f07","time":94037}
{"stateRoot": "f7a339c45ef0416f9510ecffbbf6b33a92e48e3e4e3411d0fc58d06507c895ba"}

So, basically,

  {
    "name": "balance",
    "pass": false,
    "fork": "Istanbul",
    "error": "post state root mismatch: got f7a339c45ef0416f9510ecffbbf6b33a92e48e3e4e3411d0fc58d06507c895ba, want ab994f2aec0b19c80b5ae8bd380aaea9c51f5dec81efc8fc9882dfc6f3b91ccb"
  }

Any idea why that would be? Is it possible to compare the traces with what you have?

@holiman
Copy link
Contributor

holiman commented Aug 23, 2019

This is my post-state dump

  {
    "name": "balance",
    "pass": false,
    "fork": "Istanbul",
    "error": "post state root mismatch: got f7a339c45ef0416f9510ecffbbf6b33a92e48e3e4e3411d0fc58d06507c895ba, want ab994f2aec0b19c80b5ae8bd380aaea9c51f5dec81efc8fc9882dfc6f3b91ccb",
    "state": {
      "root": "f7a339c45ef0416f9510ecffbbf6b33a92e48e3e4e3411d0fc58d06507c895ba",
      "accounts": {
        "0x095e7baea6a6c7c4c2dfeb977efac326af552d87": {
          "balance": "1000000000000100000",
          "nonce": 0,
          "root": "d21666f10c9002aff6a5ab0ed905be5033b36488e56074e259e7d63a4d902dff",
          "codeHash": "2012537f03e1d111ae5709bd80f4ad3bf9895640dca549539823c3dabd98ca4d",
          "code": "73a94f5374fce5edbc8e2a8697c15331677e6ebf0b316000555a600155",
          "storage": {
            "0x0000000000000000000000000000000000000000000000000000000000000000": "0de0b6b3a75c5ee0",
            "0x0000000000000000000000000000000000000000000000000000000000000001": "057794"
          }
        },
        "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba": {
          "balance": "61711",
          "nonce": 0,
          "root": "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
          "codeHash": "c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"
        },
        "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b": {
          "balance": "999999999999838289",
          "nonce": 1,
          "root": "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
          "codeHash": "c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"
        }
      }
    }
  }

"code" : "0x73a94f5374fce5edbc8e2a8697c15331677e6ebf0b316000555a600155",
"storage" : {
"0x00" : "0x0de0b6b3a75c5ee0",
"0x01" : "0x0578c0"
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm getting 0x057794, which is exactly 300 less

Copy link
Contributor

Choose a reason for hiding this comment

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

I suspect that this file was generated with BALANCE cost at 400, not increased to 700, which is why this file has 300 more gas remaining after the execution

Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

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

Needs to be regenerated with gascost for BALANCE at 700

@holiman
Copy link
Contributor

holiman commented Aug 23, 2019

Aha! It was generated by geth/retesteth! You will need ethereum/go-ethereum#19993 in order to do this

"value" : -1
},
"//comment" : "hard fork order: Frontier, Homestead, EIP150, EIP155, Byzantium, Constantinople, ConstantinopleFix",
"network" : [">=ConstantinopleFix"],
Copy link
Member

Choose a reason for hiding this comment

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

Is this supposed to be [>=Istanbul]?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

With Retesteth config files you can specify your own Fork names and fork order

@winsvega
Copy link
Collaborator Author

winsvega commented Aug 23, 2019

This is a workshop branch for the demonstration at Ethereum Berlin Dappcon

@winsvega
Copy link
Collaborator Author

Would be nice to have this at the debug RPC

'{"pc":0,"op":115,"gas":"0x5c878","gasCost":"0x3","memory":"0x","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH20","error":""} {"pc":21,"op":49,"gas":"0x5c875","gasCost":"0x2bc","memory":"0x","memSize":0,"stack":["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b"],"depth":1,"refund":0,"opName":"BALANCE","error":""} {"pc":22,"op":'

@holiman
Copy link
Contributor

holiman commented Aug 23, 2019

Would be nice to have this at the debug RPC

Yes, although, it could be very very big. Otoh, if you have the filled test, it's easy to just run it and obtain the trace via evm

@winsvega
Copy link
Collaborator Author

With evm trace rpc it is possible to run one test on both clients and determine exact step the mismatch has occurred

@winsvega winsvega closed this Aug 30, 2019
@winsvega winsvega deleted the istanbule branch June 20, 2020 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants