Skip to content

Commit 7a6d5d0

Browse files
rjl493456442karalabe
authored andcommitted
cmd/puppeth: integrate istanbul into puppeth (#19926)
* cmd/puppeth: integrate istanbul into puppeth * cmd/puppeth: address comment * cmd/puppeth: use hexutil.Big for fork indicator * cmd/puppeth: finalize istanbul fork * cmd/puppeth: fix 2200 for parity, rename is to eip1283ReenableTransition * cmd/puppeth: fix eip1108 * cmd/puppeth: add blake2f for parity * cmd/puppeth: add aleth istanbul precompiled * cmd/puppeth: use hexutil.Big * cmd/puppeth: fix unit tests * cmd/puppeth: update testdata
1 parent 0ff7380 commit 7a6d5d0

File tree

6 files changed

+414
-325
lines changed

6 files changed

+414
-325
lines changed

cmd/puppeth/genesis.go

Lines changed: 150 additions & 79 deletions
Large diffs are not rendered by default.

cmd/puppeth/genesis_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func TestParitySturebyConverter(t *testing.T) {
7676
if err := json.Unmarshal(blob, &genesis); err != nil {
7777
t.Fatalf("failed parsing genesis: %v", err)
7878
}
79-
spec, err := newParityChainSpec("Stureby", &genesis, []string{})
79+
spec, err := newParityChainSpec("stureby", &genesis, []string{})
8080
if err != nil {
8181
t.Fatalf("failed creating chainspec: %v", err)
8282
}
Lines changed: 89 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,112 +1,113 @@
11
{
2-
"sealEngine":"Ethash",
3-
"params":{
4-
"accountStartNonce":"0x00",
5-
"maximumExtraDataSize":"0x20",
6-
"homesteadForkBlock":"0x2710",
7-
"daoHardforkBlock":"0x00",
8-
"EIP150ForkBlock":"0x3a98",
9-
"EIP158ForkBlock":"0x59d8",
10-
"byzantiumForkBlock":"0x7530",
11-
"constantinopleForkBlock":"0x9c40",
12-
"minGasLimit":"0x1388",
13-
"maxGasLimit":"0x7fffffffffffffff",
14-
"tieBreakingGas":false,
15-
"gasLimitBoundDivisor":"0x0400",
16-
"minimumDifficulty":"0x20000",
17-
"difficultyBoundDivisor":"0x0800",
18-
"durationLimit":"0x0d",
19-
"blockReward":"0x4563918244F40000",
20-
"networkID":"0x4cb2e",
21-
"chainID":"0x4cb2e",
22-
"allowFutureBlocks":false
2+
"sealEngine": "Ethash",
3+
"params": {
4+
"accountStartNonce": "0x0",
5+
"maximumExtraDataSize": "0x20",
6+
"homesteadForkBlock": "0x2710",
7+
"daoHardforkBlock": "0x0",
8+
"EIP150ForkBlock": "0x3a98",
9+
"EIP158ForkBlock": "0x59d8",
10+
"byzantiumForkBlock": "0x7530",
11+
"constantinopleForkBlock": "0x9c40",
12+
"constantinopleFixForkBlock": "0x9c40",
13+
"istanbulForkBlock": "0xc350",
14+
"minGasLimit": "0x1388",
15+
"maxGasLimit": "0x7fffffffffffffff",
16+
"tieBreakingGas": false,
17+
"gasLimitBoundDivisor": "0x400",
18+
"minimumDifficulty": "0x20000",
19+
"difficultyBoundDivisor": "0x800",
20+
"durationLimit": "0xd",
21+
"blockReward": "0x4563918244f40000",
22+
"networkID": "0x4cb2e",
23+
"chainID": "0x4cb2e",
24+
"allowFutureBlocks": false
2325
},
24-
"genesis":{
25-
"nonce":"0x0000000000000000",
26-
"difficulty":"0x20000",
27-
"mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000",
28-
"author":"0x0000000000000000000000000000000000000000",
29-
"timestamp":"0x59a4e76d",
30-
"parentHash":"0x0000000000000000000000000000000000000000000000000000000000000000",
31-
"extraData":"0x0000000000000000000000000000000000000000000000000000000b4dc0ffee",
32-
"gasLimit":"0x47b760"
26+
"genesis": {
27+
"nonce": "0x0000000000000000",
28+
"difficulty": "0x20000",
29+
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
30+
"author": "0x0000000000000000000000000000000000000000",
31+
"timestamp": "0x59a4e76d",
32+
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
33+
"extraData": "0x0000000000000000000000000000000000000000000000000000000b4dc0ffee",
34+
"gasLimit": "0x47b760"
3335
},
34-
"accounts":{
35-
"0000000000000000000000000000000000000001":{
36-
"balance":"1",
37-
"precompiled":{
38-
"name":"ecrecover",
39-
"linear":{
40-
"base":3000,
41-
"word":0
36+
"accounts": {
37+
"0000000000000000000000000000000000000001": {
38+
"balance": "0x1",
39+
"precompiled": {
40+
"name": "ecrecover",
41+
"linear": {
42+
"base": 3000,
43+
"word": 0
4244
}
4345
}
4446
},
45-
"0000000000000000000000000000000000000002":{
46-
"balance":"1",
47-
"precompiled":{
48-
"name":"sha256",
49-
"linear":{
50-
"base":60,
51-
"word":12
47+
"0000000000000000000000000000000000000002": {
48+
"balance": "0x1",
49+
"precompiled": {
50+
"name": "sha256",
51+
"linear": {
52+
"base": 60,
53+
"word": 12
5254
}
5355
}
5456
},
55-
"0000000000000000000000000000000000000003":{
56-
"balance":"1",
57-
"precompiled":{
58-
"name":"ripemd160",
59-
"linear":{
60-
"base":600,
61-
"word":120
57+
"0000000000000000000000000000000000000003": {
58+
"balance": "0x1",
59+
"precompiled": {
60+
"name": "ripemd160",
61+
"linear": {
62+
"base": 600,
63+
"word": 120
6264
}
6365
}
6466
},
65-
"0000000000000000000000000000000000000004":{
66-
"balance":"1",
67-
"precompiled":{
68-
"name":"identity",
69-
"linear":{
70-
"base":15,
71-
"word":3
67+
"0000000000000000000000000000000000000004": {
68+
"balance": "0x1",
69+
"precompiled": {
70+
"name": "identity",
71+
"linear": {
72+
"base": 15,
73+
"word": 3
7274
}
7375
}
7476
},
75-
"0000000000000000000000000000000000000005":{
76-
"balance":"1",
77-
"precompiled":{
78-
"name":"modexp",
79-
"startingBlock":"0x7530"
77+
"0000000000000000000000000000000000000005": {
78+
"balance": "0x1",
79+
"precompiled": {
80+
"name": "modexp",
81+
"startingBlock": "0x7530"
8082
}
8183
},
82-
"0000000000000000000000000000000000000006":{
83-
"balance":"1",
84-
"precompiled":{
85-
"name":"alt_bn128_G1_add",
86-
"startingBlock":"0x7530",
87-
"linear":{
88-
"base":500,
89-
"word":0
90-
}
84+
"0000000000000000000000000000000000000006": {
85+
"balance": "0x1",
86+
"precompiled": {
87+
"name": "alt_bn128_G1_add",
88+
"startingBlock": "0x7530"
9189
}
9290
},
93-
"0000000000000000000000000000000000000007":{
94-
"balance":"1",
95-
"precompiled":{
96-
"name":"alt_bn128_G1_mul",
97-
"startingBlock":"0x7530",
98-
"linear":{
99-
"base":40000,
100-
"word":0
101-
}
91+
"0000000000000000000000000000000000000007": {
92+
"balance": "0x1",
93+
"precompiled": {
94+
"name": "alt_bn128_G1_mul",
95+
"startingBlock": "0x7530"
96+
}
97+
},
98+
"0000000000000000000000000000000000000008": {
99+
"balance": "0x1",
100+
"precompiled": {
101+
"name": "alt_bn128_pairing_product",
102+
"startingBlock": "0x7530"
102103
}
103104
},
104-
"0000000000000000000000000000000000000008":{
105-
"balance":"1",
106-
"precompiled":{
107-
"name":"alt_bn128_pairing_product",
108-
"startingBlock":"0x7530"
105+
"0000000000000000000000000000000000000009": {
106+
"balance": "0x1",
107+
"precompiled": {
108+
"name": "blake2_compression",
109+
"startingBlock": "0xc350"
109110
}
110111
}
111112
}
112-
}
113+
}
Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,54 @@
11
{
22
"config": {
3-
"ethash":{},
43
"chainId": 314158,
54
"homesteadBlock": 10000,
65
"eip150Block": 15000,
76
"eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
87
"eip155Block": 23000,
98
"eip158Block": 23000,
109
"byzantiumBlock": 30000,
11-
"constantinopleBlock": 40000
10+
"constantinopleBlock": 40000,
11+
"petersburgBlock": 40000,
12+
"istanbulBlock": 50000,
13+
"ethash": {}
1214
},
1315
"nonce": "0x0",
1416
"timestamp": "0x59a4e76d",
15-
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
1617
"extraData": "0x0000000000000000000000000000000000000000000000000000000b4dc0ffee",
1718
"gasLimit": "0x47b760",
1819
"difficulty": "0x20000",
1920
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
2021
"coinbase": "0x0000000000000000000000000000000000000000",
2122
"alloc": {
2223
"0000000000000000000000000000000000000001": {
23-
"balance": "0x01"
24+
"balance": "0x1"
2425
},
2526
"0000000000000000000000000000000000000002": {
26-
"balance": "0x01"
27+
"balance": "0x1"
2728
},
2829
"0000000000000000000000000000000000000003": {
29-
"balance": "0x01"
30+
"balance": "0x1"
3031
},
3132
"0000000000000000000000000000000000000004": {
32-
"balance": "0x01"
33+
"balance": "0x1"
3334
},
3435
"0000000000000000000000000000000000000005": {
35-
"balance": "0x01"
36+
"balance": "0x1"
3637
},
3738
"0000000000000000000000000000000000000006": {
38-
"balance": "0x01"
39+
"balance": "0x1"
3940
},
4041
"0000000000000000000000000000000000000007": {
41-
"balance": "0x01"
42+
"balance": "0x1"
4243
},
4344
"0000000000000000000000000000000000000008": {
44-
"balance": "0x01"
45+
"balance": "0x1"
46+
},
47+
"0000000000000000000000000000000000000009": {
48+
"balance": "0x1"
4549
}
46-
}
47-
}
50+
},
51+
"number": "0x0",
52+
"gasUsed": "0x0",
53+
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
54+
}

0 commit comments

Comments
 (0)