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

evm t8n env file format #5134

Closed
winsvega opened this issue Feb 24, 2023 · 3 comments · Fixed by #5135
Closed

evm t8n env file format #5134

winsvega opened this issue Feb 24, 2023 · 3 comments · Fixed by #5135

Comments

@winsvega
Copy link

What format besu t8n is expecting from env file?

java.lang.NumberFormatException: For input string: "0x00"
	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
	at java.base/java.lang.Long.parseLong(Long.java:711)
	at java.base/java.lang.Long.parseLong(Long.java:836)
	at org.hyperledger.besu.ethereum.referencetests.ReferenceTestEnv.updateFromParentValues(ReferenceTestEnv.java:166)
	at org.hyperledger.besu.evmtool.T8nSubCommand.run(T8nSubCommand.java:267)
	at picocli.CommandLine.executeUserObject(CommandLine.java:1939)
	at picocli.CommandLine.access$1300(CommandLine.java:145)
	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2352)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2314)
	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
	at picocli.CommandLine$RunLast.execute(CommandLine.java:2316)
	at picocli.CommandLine.execute(CommandLine.java:2078)
	at org.hyperledger.besu.evmtool.EvmToolCommand.execute(EvmToolCommand.java:246)
	at org.hyperledger.besu.evmtool.EvmToolCommand.execute(EvmToolCommand.java:219)
	at org.hyperledger.besu.evmtool.EvmTool.main(EvmTool.java:27)

Env file I give:

Env:
{
    "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
    "currentNumber" : "0x01",
    "currentTimestamp" : "0x03e8",
    "currentGasLimit" : "0xff112233445566",
    "previousHash" : "0xb271e9e5796d0ff5a2fd519ba666393e42d4f38680854761121d84a7a96ff017",
    "parentTimestamp" : "0x00",
    "parentDifficulty" : "0x00",
    "parentUncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
    "currentRandom" : "0x0000000000000000000000000000000000000000000000000000000000020000",
    "parentBaseFee" : "0x0b",
    "parentGasUsed" : "0x00",
    "parentGasLimit" : "0xff112233445566",
    "blockHashes" : {
        "0" : "0xb271e9e5796d0ff5a2fd519ba666393e42d4f38680854761121d84a7a96ff017"
    }
}
@shemnon
Copy link
Contributor

shemnon commented Feb 24, 2023

Execution Spec Tests has been using base 10 for almost all of it's fields.

We can fix Besu's t8n, as long as hex always has a 0x prefix.

Here's a sample from what they send

{
      "currentCoinbase": "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
      "currentGasLimit": "100000000000000000",
      "currentNumber": "1",
      "currentTimestamp": "12",
      "currentRandom": "0",
      "currentDifficulty": "0",
      "parentDifficulty": "0",
      "parentBaseFee": "7",
      "parentGasUsed": "0",
      "parentGasLimit": "100000000000000000",
      "parentTimstamp": "0",
      "blockHashes": {
        "0": "0xea2d7e0192d890c222f0302d972a02db0bf0c6d08257d73aa1210d08d24f30c3"
      },
      "ommers": [],
      "withdrawals": [],
      "parentUncleHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
    }

Also, we currently don't have block hashes support. Will add that too.

@shemnon
Copy link
Contributor

shemnon commented Feb 24, 2023

Turns it's an error in just one case: London or later and for the parentGasUsed value. Fix is posted.

@winsvega
Copy link
Author

opened an issue about t8n versioning ethereum/tests#1165

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 a pull request may close this issue.

2 participants