-
Notifications
You must be signed in to change notification settings - Fork 21.3k
Closed
Closed
Copy link
Labels
Milestone
Description
Wanted to check/repro #21881 , and found that something is wonky with custom genesis and/or custom datadirs:
[user@work ~]$ cat gen.json
{
"config": {
"chainId": 12345,
"homesteadBlock": 0,
"eip150Block": 0,
"eip155Block": 0,
"eip158Block": 0,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"petersburgBlock": 0,
"istanbulBlock": 0,
"berlinBlock": 0,
"clique": {
"period": 5,
"epoch": 30000
}
},
"difficulty": "1",
"gasLimit": "30000",
"extradata": "0x00000000000000000000000000000000000000000000000000000000000000009Ccf0fC294d629719ecEF4570632Cd1FdEE02c770000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"alloc": {
"DE9aD14212772d071c65BE3E84c390EA462735B6": { "balance": "1606938044258990275541962092341162602522202993782792835301376" },
"6f095002ad09006dda6c5fecdc4e58550caab34e": { "balance": "1606938044258990275541962092341162602522202993782792835301376" },
"9Ccf0fC294d629719ecEF4570632Cd1FdEE02c77": { "balance": "1606938044258990275541962092341162602522202993782792835301376" }
}
}
[user@work ~]$ geth --datadir=/tmp/foobar init gen.json
INFO [02-21|10:19:31.392] Maximum peer count ETH=50 LES=0 total=50
INFO [02-21|10:19:31.407] Set global gas cap cap=50,000,000
INFO [02-21|10:19:31.410] Using leveldb as the backing database
INFO [02-21|10:19:31.410] Allocated cache and file handles database=/tmp/foobar/geth/chaindata cache=16.00MiB handles=16
INFO [02-21|10:19:31.412] Using LevelDB as the backing database
INFO [02-21|10:19:31.413] Opened ancient database database=/tmp/foobar/geth/chaindata/ancient/chain readonly=false
INFO [02-21|10:19:31.413] Writing custom genesis block
INFO [02-21|10:19:31.413] Persisted trie from memory database nodes=4 size=639.00B time="29.427µs" gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
INFO [02-21|10:19:31.413] Successfully wrote genesis state database=chaindata hash=170f6a..b53b17
INFO [02-21|10:19:31.413] Using leveldb as the backing database
INFO [02-21|10:19:31.413] Allocated cache and file handles database=/tmp/foobar/geth/lightchaindata cache=16.00MiB handles=16
INFO [02-21|10:19:31.414] Using LevelDB as the backing database
INFO [02-21|10:19:31.414] Opened ancient database database=/tmp/foobar/geth/lightchaindata/ancient/chain readonly=false
INFO [02-21|10:19:31.414] Writing custom genesis block
INFO [02-21|10:19:31.414] Persisted trie from memory database nodes=4 size=639.00B time="23.348µs" gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
INFO [02-21|10:19:31.415] Successfully wrote genesis state database=lightchaindata hash=170f6a..b53b17
[user@work ~]$ geth --datadir=/tmp/foobar dumpgenesis
INFO [02-21|10:19:36.009] Maximum peer count ETH=50 LES=0 total=50
INFO [02-21|10:19:36.019] Set global gas cap cap=50,000,000
INFO [02-21|10:19:36.022] Using leveldb as the backing database
INFO [02-21|10:19:36.022] Allocated cache and file handles database=/tmp/foobar/geth/chaindata cache=16.00MiB handles=16 readonly=true
INFO [02-21|10:19:36.026] Using LevelDB as the backing database
Fatal: failed to read genesis: genesis state missing from db