Istanbul node crashes on smart contract deployment
System information
Geth version: geth version
OS & Version: Ubuntu (Docker)
Branch, Commit Hash or Release: 2.0.2
Expected behaviour
I can deploy a smart contract
Actual behaviour
Geth crashes:
Steps to reproduce the behavior
I started three Istanbul nodes with the following genesis block and joined them together (I used the genesis json from the 7 nodes example):
{
"config": {
"chainId": 1,
"eip150Block": 2,
"eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"eip155Block": 3,
"eip158Block": 3,
"istanbul": {
"epoch": 30000,
"policy": 0
},
"byzantiumBlock": 1,
"isQuorum": true
},
"nonce": "0x0",
"timestamp": "0x00",
"extraData": "0x0000000000000000000000000000000000000000000000000000000000000000f885f83f940000000000000000000000000000000000000000940000000000000000000000000000000000000000940000000000000000000000000000000000000000b8410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0",
"gasLimit": "0xE0000000",
"difficulty": "0x0",
"mixhash": "0x00000000000000000000000000000000000000647572616c65787365646c6578",
"coinbase": "0x0000000000000000000000000000000000000000",
"alloc": {},
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
Start up flags:
geth --datadir /qdata/dd --port 30303 --identity btxcx --mine --minerthreads 1 --istanbul.requesttimeout 10000 --istanbul.blockperiod 1 --emitcheckpoints --rpc --rpcport 8545 --rpcaddr 0.0.0.0 --rpcapi admin,db,eth,debug,miner,net,shh,txpool,personal,web3,quorum --networkid 1 --permissioned --nodiscover --verbosity 5 --unlock 0 --password /k8s/secrets/accountPassword
admin.peers
> admin.peers
[{
caps: ["istanbul/64"],
id: "1864e15e43764b12c26b1a3fe5cd47a4d1dee2688aca08eb25d4157a33dea0f24ef59ef26d48e55c735b1f15b633e7d9f6ae978f2c0d29db2e5dfbd99e039e6a",
name: "Geth/coxbl/v1.7.2-stable/linux-amd64/go1.9.2",
network: {
localAddress: "100.96.0.223:30303",
remoteAddress: "100.96.0.226:48390"
},
protocols: {
istanbul: {
difficulty: 0,
head: "0xccff59453a5e4f09d555778188f08cbfd5b995df6b82a64a317e15883dbb0a32",
version: 64
}
}
}, {
caps: ["istanbul/64"],
id: "e6e3cab3e79e74b6f27f8a0aa01f1dcd88967c18e7c0ca52d0a63ad4a71d3b6b824366370ade31dbc148bfe91c5507aa6db1b7cf0398748fee258bad223bdc86",
name: "Geth/nwmgo/v1.7.2-stable/linux-amd64/go1.9.2",
network: {
localAddress: "100.96.0.223:30303",
remoteAddress: "100.96.0.225:37154"
},
protocols: {
istanbul: {
difficulty: 0,
head: "0xccff59453a5e4f09d555778188f08cbfd5b995df6b82a64a317e15883dbb0a32",
version: 64
}
}
}]
block height:
> eth.blockNumber
0
Backtrace
TRACE[07-09|23:24:04] Catch up round address=0x78E46f8125052B884cD5d94c9c594EB460633804 old_round=4 old_seq=1 old_proposer=nil new_round=5 new_seq=1 new_proposer="&{validators:[] policy:0 proposer:<nil> validatorMu:{w:{state:0 sema:0} writerSem:0 readerSem:0 readerCount:0 readerWait:0} selector:0xbbf1e0}"
ERROR[07-09|23:24:04] Failed to decode message from payload address=0x78E46f8125052B884cD5d94c9c594EB460633804 err="unauthorized address"
...
ERROR[07-09|23:24:21] goroutine 313 [running]:
github.com/ethereum/go-ethereum/rpc.(*Server).serveRequest.func1(0xc420293ce0, 0x19e4aa0, 0xc420514d20)
/quorum-2.0.2/build/_workspace/src/github.com/ethereum/go-ethereum/rpc/server.go:135 +0x11e
panic(0xef3fe0, 0x199f930)
/usr/local/go/src/runtime/panic.go:491 +0x283
github.com/ethereum/go-ethereum/miner.(*worker).pending(0xc420086500, 0x0, 0x0, 0x0)
/quorum-2.0.2/build/_workspace/src/github.com/ethereum/go-ethereum/miner/worker.go:192 +0x196
github.com/ethereum/go-ethereum/miner.(*Miner).Pending(0xc42024ca00, 0x38, 0x4, 0x2d800000001)
/quorum-2.0.2/build/_workspace/src/github.com/ethereum/go-ethereum/miner/miner.go:168 +0x2f
github.com/ethereum/go-ethereum/eth.(*EthApiBackend).StateAndHeaderByNumber(0xc4202bc440, 0x19dfb40, 0xc42050dd40, 0xfffffffffffffffe, 0xc42050dd40, 0x19dfb40, 0xc42050dd40, 0x0, 0x0)
/quorum-2.0.2/build/_workspace/src/github.com/ethereum/go-ethereum/eth/api_backend.go:100 +0x1dd
github.com/ethereum/go-ethereum/internal/ethapi.(*PublicTransactionPoolAPI).GetTransactionCount(0xc4201353a0, 0x19dfb40, 0xc42050dd40, 0x7d2e8944aa407567, 0x4f1e44745eb43b01, 0x44a9c7ef, 0xfffffffffffffffe, 0x0, 0x0, 0x0)
/quorum-2.0.2/build/_workspace/src/github.com/ethereum/go-ethereum/internal/ethapi/api.go:962 +0x5e
reflect.Value.call(0xc42009d100, 0xc42020f788, 0x13, 0x1044825, 0x4, 0xc4205b8060, 0x4, 0x4, 0x0, 0xc4205b8060, ...)
/usr/local/go/src/reflect/value.go:434 +0x905
reflect.Value.Call(0xc42009d100, 0xc42020f788, 0x13, 0xc4205b8060, 0x4, 0x4, 0x2, 0x2, 0x2)
/usr/local/go/src/reflect/value.go:302 +0xa4
github.com/ethereum/go-ethereum/rpc.(*Server).handle(0xc420293ce0, 0x19dfb40, 0xc42050dd40, 0x19e4aa0, 0xc420514d20, 0xc4205b8000, 0xc420514d90, 0x0, 0xedee00)
/quorum-2.0.2/build/_workspace/src/github.com/ethereum/go-ethereum/rpc/server.go:311 +0x6ce
github.com/ethereum/go-ethereum/rpc.(*Server).exec(0xc420293ce0, 0x19dfb40, 0xc42050dd40, 0x19e4aa0, 0xc420514d20, 0xc4205b8000)
/quorum-2.0.2/build/_workspace/src/github.com/ethereum/go-ethereum/rpc/server.go:333 +0x1ba
github.com/ethereum/go-ethereum/rpc.(*Server).serveRequest(0xc420293ce0, 0x19e4aa0, 0xc420514d20, 0x8c6701, 0x1, 0x0, 0x0)
/quorum-2.0.2/build/_workspace/src/github.com/ethereum/go-ethereum/rpc/server.go:194 +0x38f
github.com/ethereum/go-ethereum/rpc.(*Server).ServeSingleRequest(0xc420293ce0, 0x19e4aa0, 0xc420514d20, 0x1)
/quorum-2.0.2/build/_workspace/src/github.com/ethereum/go-ethereum/rpc/server.go:225 +0x4e
github.com/ethereum/go-ethereum/rpc.(*Server).ServeHTTP(0xc420293ce0, 0x19de6c0, 0xc42055d340, 0xc4205b6000)
/quorum-2.0.2/build/_workspace/src/github.com/ethereum/go-ethereum/rpc/http.go:167 +0x362
net/http.serverHandler.ServeHTTP(0xc4204c7e10, 0x19de6c0, 0xc42055d340, 0xc4205b6000)
/usr/local/go/src/net/http/server.go:2619 +0xb4
net/http.(*conn).serve(0xc4205881e0, 0x19dfb40, 0xc42050dc40)
/usr/local/go/src/net/http/server.go:1801 +0x71d
created by net/http.(*Server).Serve
/usr/local/go/src/net/http/server.go:2720 +0x288
I just realized that my extra data didn't encode anything for some reason. Will fix my code and give an update.
Updates (still not working):
- I fixed the extra data field
- I'm using 4 instead of 3 nodes
New genesis json:
{
"config": {
"chainId": 1,
"eip150Block": 2,
"eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"eip155Block": 3,
"eip158Block": 3,
"istanbul": {
"epoch": 30000,
"policy": 0
},
"byzantiumBlock": 1,
"isQuorum": true
},
"nonce": "0x0",
"timestamp": "0x00",
"extraData": "0x0000000000000000000000000000000000000000000000000000000000000000f89af85494521a73746c01f434b05e2e526d60855747f2fffd94f305345b06ec079e2e5e354c12a70ab8945e1b64942374a9f1b351c4174c71b4c488c2f771abdc96c294f0e51723fd2391f04257ea29f309787c5a461c4ab8410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0",
"gasLimit": "0xE0000000",
"difficulty": "0x0",
"mixhash": "0x00000000000000000000000000000000000000647572616c65787365646c6578",
"coinbase": "0x0000000000000000000000000000000000000000",
"alloc": {
"0x2374A9f1b351c4174c71b4C488c2f771ABDC96c2": {
"balance": "0x446c3b15f9926687d2c40534fdb564000000000000"
},
"0x521a73746C01f434b05E2e526D60855747F2FFfD": {
"balance": "0x446c3b15f9926687d2c40534fdb564000000000000"
},
"0xF305345B06EC079e2E5e354C12A70AB8945E1b64": {
"balance": "0x446c3b15f9926687d2c40534fdb564000000000000"
},
"0xf0E51723fd2391F04257ea29F309787C5a461c4A": {
"balance": "0x446c3b15f9926687d2c40534fdb564000000000000"
}
},
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
Decoded extra data:
$ ./istanbul extra decode --extradata 0x0000000000000000000000000000000000000000000000000000000000000000f89af85494521a73746c01f434b05e2e526d60855747f2fffd94f305345b06ec079e2e5e354c12a70ab8945e1b64942374a9f1b351c4174c71b4c488c2f771abdc96c294f0e51723fd2391f04257ea29f309787c5a461c4ab8410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0
vanity: 0x0000000000000000000000000000000000000000000000000000000000000000
validator: 0x521a73746C01f434b05E2e526D60855747F2FFfD
validator: 0xF305345B06EC079e2E5e354C12A70AB8945E1b64
validator: 0x2374A9f1b351c4174c71b4C488c2f771ABDC96c2
validator: 0xf0E51723fd2391F04257ea29F309787C5a461c4A
seal: 0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Error logs:
TRACE[07-10|21:02:17] Catch up round address=0xC669037528A9D060CFdA861bdC8F0e6eBa1e7e8e old_round=6 old_seq=1 old_proposer=nil new_round=7 new_seq=1 new_proposer="&{validators:[] policy:0 proposer:<nil> validatorMu:{w:{state:0 sema:0} writerSem:0 readerSem:0 readerCount:0 readerWait:0} selector:0xbbf1e0}"
ERROR[07-10|21:02:17] Failed to decode message from payload address=0xC669037528A9D060CFdA861bdC8F0e6eBa1e7e8e err="unauthorized address"
The interesting thing is that none of my nodes has the account 0xC669037528A9D060CFdA861bdC8F0e6eBa1e7e8e but I can't figure out where it comes from.
You're using a chain ID of 1, which is the public ethereum chain ID. You should generate a genesis block using a different ID.
@jmcnevin Thanks! I don't think it makes a difference which ID to use (although you're correct I should not use chain ID 1 in production). I tried ID 2017 but that didn't fix the issue.
I found the issue and it at least creates one block now. I didn't use the node key to generate an account. This is why different addresses where showing up in the log.
Now, it is actually generating a block but it stops after (eth.blockNumber is 1). Note that since I generate accounts, in the logs below my accounts are different than in my logs above.
...
TRACE[07-11|21:55:34] Catch up round address=0x64bE41881ae6e84c24D7f567cB5aC56Bc58B4e0a old_round=5 old_seq=1 old_proposer=0x64bE41881ae6e84c24D7f567cB5aC56Bc58B4e0a new_round=6 new_seq=1 new_proposer="&{validators:[0xc4204caea0 0xc4204cae60 0xc4204cae80 0xc4204caec0] policy:0 proposer:0xc4204cae60 validatorMu:{w:{state:0 sema:0} writerSem:0 readerSem:0 readerCount:0 readerWait:0} selector:0xbbf1e0}"
TRACE[07-11|21:55:34] Stop processing backlog address=0x64bE41881ae6e84c24D7f567cB5aC56Bc58B4e0a from=0xa89026Ba6742A1ebcb0A0878062908CC7f1B8e3e state="Accept request" msg="{Code: 3, Address: 0xa89026Ba6742A1ebcb0A0878062908CC7f1B8e3e}"
DEBUG[07-11|21:55:34] New round address=0x64bE41881ae6e84c24D7f567cB5aC56Bc58B4e0a old_round=6 old_seq=1 old_proposer=0x64bE41881ae6e84c24D7f567cB5aC56Bc58B4e0a new_round=6 new_seq=1 new_proposer=0xFa58B3928CFcCC8C1d005B6108F6D3B8ae9043AF valSet="[0x10658B14A9D7DCBaaC959fC5cd6192CEeDF384e1 0x64bE41881ae6e84c24D7f567cB5aC56Bc58B4e0a 0xFa58B3928CFcCC8C1d005B6108F6D3B8ae9043AF 0xa89026Ba6742A1ebcb0A0878062908CC7f1B8e3e]" size=4 isProposer=false
TRACE[07-11|21:55:34] Stop processing backlog address=0x64bE41881ae6e84c24D7f567cB5aC56Bc58B4e0a from=0xa89026Ba6742A1ebcb0A0878062908CC7f1B8e3e state=Prepared msg="{Code: 3, Address: 0xa89026Ba6742A1ebcb0A0878062908CC7f1B8e3e}"
TRACE[07-11|21:55:34] Stop processing backlog address=0x64bE41881ae6e84c24D7f567cB5aC56Bc58B4e0a from=0xa89026Ba6742A1ebcb0A0878062908CC7f1B8e3e state=Committed msg="{Code: 3, Address: 0xa89026Ba6742A1ebcb0A0878062908CC7f1B8e3e}"
INFO [07-11|21:55:34] Committed address=0x64bE41881ae6e84c24D7f567cB5aC56Bc58B4e0a hash=8b3d1f…97c22c number=1
DEBUG[07-11|21:55:34] Queued propagated block peer=istanbul number=1 hash=8b3d1f…97c22c queued=1
DEBUG[07-11|21:55:34] Importing propagated block peer=istanbul number=1 hash=8b3d1f…97c22c
ERROR[07-11|21:55:34] not a valid address err="recovery failed"
I am using this genesis block:
{
"config": {
"chainId": 2017,
"homesteadBlock": 1,
"eip150Block": 2,
"eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"eip155Block": 3,
"eip158Block": 3,
"istanbul": {
"epoch": 30000,
"policy": 0
},
"isQuorum": true
},
"nonce": "0x0",
"timestamp": "0x5b467c35",
"extraData": "0x0000000000000000000000000000000000000000000000000000000000000000f89af8549464be41881ae6e84c24d7f567cb5ac56bc58b4e0a94fa58b3928cfccc8c1d005b6108f6d3b8ae9043af9410658b14a9d7dcbaac959fc5cd6192ceedf384e194a89026ba6742a1ebcb0a0878062908cc7f1b8e3eb8410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0",
"gasLimit": "0x47b760",
"difficulty": "0x1",
"mixHash": "0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365",
"coinbase": "0x0000000000000000000000000000000000000000",
"alloc": {
"10658b14a9d7dcbaac959fc5cd6192ceedf384e1": {
"balance": "0xde0b6b3a7640000"
},
"64be41881ae6e84c24d7f567cb5ac56bc58b4e0a": {
"balance": "0xde0b6b3a7640000"
},
"a89026ba6742a1ebcb0a0878062908cc7f1b8e3e": {
"balance": "0xde0b6b3a7640000"
},
"fa58b3928cfccc8c1d005b6108f6d3b8ae9043af": {
"balance": "0xde0b6b3a7640000"
}
}
}
Just out of curiosity, I created just a single node. This seems to work.
I'm deploying my nodes on a Kubernetes cluster and it takes some time for the nodes to connect to each other (about 70 seconds from node start to everyone being connected to everyone). Could it be that all 4 nodes actually mine their own block since they think they are the only validator and therefore the network ends up with 4 different chains? (of 1 block for each chain)?
@michaelkunzmann-sap you are supposed to use istanbul-tools to create initial genesis for when you know that you are priming the network with more than a single node. After the network is primed and you have nodes joining, you may modify the validator list through istanbul api.
Assuming shared genesis, all nodes joining the network will fetch the blocks from validators, regardless of the block content of the local chain.