# Test vectors for the Merge(tm) by Marius van der Wijden generated with https://github.com/ethereum/go-ethereum/pull/23607 Test vectors are on v1.0.0.alpha.2 last updated on 3.10.2021 **The last update changed the gas limit thus the genesis hash without actually updating the interaction** ## Genesis The following genesis should create a block with hash `0x3b8fb240d288781d4aac94d3fd16809ee413bc99294a085798a589dae51ddd4a` ``` { "config": { "chainId":1, "homesteadBlock":0, "eip150Block":0, "eip155Block":0, "eip158Block":0, "byzantiumBlock":0, "constantinopleBlock":0, "petersburgBlock":0, "istanbulBlock":0, "muirGlacierBlock":0, "berlinBlock":0, "londonBlock":0, "clique": { "period": 5, "epoch": 30000 }, "terminalTotalDifficulty":0 }, "nonce":"0x42", "timestamp":"0x0", "extraData":"0x0000000000000000000000000000000000000000000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "gasLimit":"0x1C9C380", "difficulty":"0x400000000", "mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000", "coinbase":"0x0000000000000000000000000000000000000000", "alloc":{ "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b":{"balance":"0x6d6172697573766477000000"} }, "number":"0x0", "gasUsed":"0x0", "parentHash":"0x0000000000000000000000000000000000000000000000000000000000000000", "baseFeePerGas":"0x7" } ``` ## Walkthrough Initialize the chain with the genesis `./build/bin/geth --catalyst --datadir "~/ethereum/taunus" init genesis.json` Start the node `./build/bin/geth --catalyst --http --ws -http.api "engine" --datadir "~/ethereum/taunus" console` ### Prepare a payload ``` curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"engine_preparePayload","params":[{"parentHash":"0x3b8fb240d288781d4aac94d3fd16809ee413bc99294a085798a589dae51ddd4a", "timestamp":"0x5", "random":"0x0000000000000000000000000000000000000000000000000000000000000000", "feeRecipient":"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b"}],"id":67}' http://localhost:8545 ``` should return `{"jsonrpc":"2.0","id":67,"result":{"payloadId":"0x0"}}` ### Get the payload ``` curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"engine_getPayload","params":["0x0"],"id":67}' http://localhost:8545 ``` should return ``` {"jsonrpc":"2.0","id":67,"result":{"blockHash":"0x3559e851470f6e7bbed1db474980683e8c315bfce99b2a6ef47c057c04de7858","parentHash":"0x3b8fb240d288781d4aac94d3fd16809ee413bc99294a085798a589dae51ddd4a","coinbase":"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b","stateRoot":"0xca3149fa9e37db08d1cd49c9061db1002ef1cd58db2210f2115c8c989b2bdf45","receiptRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","random":"0x0000000000000000000000000000000000000000000000000000000000000000","blockNumber":"0x1","gasLimit":"0x1c9c380","gasUsed":"0x0","timestamp":"0x5","extraData":"0x","baseFeePerGas":"0x7","transactions":[]}} ``` ### Execute the payload ``` curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"engine_executePayload","params":[{"blockHash":"0x3559e851470f6e7bbed1db474980683e8c315bfce99b2a6ef47c057c04de7858","parentHash":"0x3b8fb240d288781d4aac94d3fd16809ee413bc99294a085798a589dae51ddd4a","coinbase":"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b","stateRoot":"0xca3149fa9e37db08d1cd49c9061db1002ef1cd58db2210f2115c8c989b2bdf45","receiptRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","random":"0x0000000000000000000000000000000000000000000000000000000000000000","blockNumber":"0x1","gasLimit":"0x1c9c380","gasUsed":"0x0","timestamp":"0x5","extraData":"0x","baseFeePerGas":"0x7","transactions":[]}],"id":67}' http://localhost:8545 ``` should return `{"jsonrpc":"2.0","id":67,"result":{"status":"VALID"}}` ### Mark the payload as valid ``` curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"engine_consensusValidated","params":[{"blockHash":"0x3559e851470f6e7bbed1db474980683e8c315bfce99b2a6ef47c057c04de7858", "status":"VALID"}],"id":67}' http://localhost:8545 ``` should return `{"jsonrpc":"2.0","id":67,"result":null}` ### Update the fork choice ``` curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"engine_forkchoiceUpdated","params":[{"headBlockHash":"0x3559e851470f6e7bbed1db474980683e8c315bfce99b2a6ef47c057c04de7858", "finalizedBlockHash":"0x3559e851470f6e7bbed1db474980683e8c315bfce99b2a6ef47c057c04de7858"}],"id":67}' http://localhost:8545 ``` should return `{"jsonrpc":"2.0","id":67,"result":null}` ## Error cases ### unknown payload ``` curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"engine_getPayload","params":["0x123"],"id":67}' http://localhost:8545 ``` should produce `{"jsonrpc":"2.0","id":67,"error":{"code":5,"message":"unknown payload"}}` ### unknown header ``` curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"engine_consensusValidated","params":[{"blockHash":"0x0000000000000000000000000000000000000000000000000000000000000000", "status":"VALID"}],"id":67}' http://localhost:8545 ``` should produce `{"jsonrpc":"2.0","id":67,"error":{"code":4,"message":"unknown header"}}`