@@ -23,30 +23,33 @@ var EpochTBD = big.NewInt(10000000)
23
23
var (
24
24
// MainnetChainConfig is the chain parameters to run a node on the main network.
25
25
MainnetChainConfig = & ChainConfig {
26
- ChainID : MainnetChainID ,
27
- CrossTxEpoch : big .NewInt (28 ),
28
- CrossLinkEpoch : EpochTBD ,
29
- EIP155Epoch : big .NewInt (28 ),
30
- S3Epoch : big .NewInt (28 ),
26
+ ChainID : MainnetChainID ,
27
+ CrossTxEpoch : big .NewInt (28 ),
28
+ CrossLinkEpoch : EpochTBD ,
29
+ EIP155Epoch : big .NewInt (28 ),
30
+ S3Epoch : big .NewInt (28 ),
31
+ ReceiptLogEpoch : big .NewInt (101 ),
31
32
}
32
33
33
34
// TestnetChainConfig contains the chain parameters to run a node on the harmony test network.
34
35
TestnetChainConfig = & ChainConfig {
35
- ChainID : TestnetChainID ,
36
- CrossTxEpoch : big .NewInt (1 ),
37
- CrossLinkEpoch : big .NewInt (2 ),
38
- EIP155Epoch : big .NewInt (0 ),
39
- S3Epoch : big .NewInt (0 ),
36
+ ChainID : TestnetChainID ,
37
+ CrossTxEpoch : big .NewInt (1 ),
38
+ CrossLinkEpoch : big .NewInt (2 ),
39
+ EIP155Epoch : big .NewInt (0 ),
40
+ S3Epoch : big .NewInt (0 ),
41
+ ReceiptLogEpoch : big .NewInt (0 ),
40
42
}
41
43
42
44
// PangaeaChainConfig contains the chain parameters for the Pangaea network.
43
45
// All features except for CrossLink are enabled at launch.
44
46
PangaeaChainConfig = & ChainConfig {
45
- ChainID : PangaeaChainID ,
46
- CrossTxEpoch : big .NewInt (0 ),
47
- CrossLinkEpoch : EpochTBD ,
48
- EIP155Epoch : big .NewInt (0 ),
49
- S3Epoch : big .NewInt (0 ),
47
+ ChainID : PangaeaChainID ,
48
+ CrossTxEpoch : big .NewInt (0 ),
49
+ CrossLinkEpoch : EpochTBD ,
50
+ EIP155Epoch : big .NewInt (0 ),
51
+ S3Epoch : big .NewInt (0 ),
52
+ ReceiptLogEpoch : big .NewInt (0 ),
50
53
}
51
54
52
55
// AllProtocolChanges ...
58
61
big .NewInt (0 ), // CrossLinkEpoch
59
62
big .NewInt (0 ), // EIP155Epoch
60
63
big .NewInt (0 ), // S3Epoch
64
+ big .NewInt (0 ), // ReceiptLogEpoch
61
65
}
62
66
63
67
// TestChainConfig ...
69
73
big .NewInt (0 ), // CrossLinkEpoch
70
74
big .NewInt (0 ), // EIP155Epoch
71
75
big .NewInt (0 ), // S3Epoch
76
+ big .NewInt (0 ), // ReceiptLogEpoch
72
77
}
73
78
74
79
// TestRules ...
@@ -109,15 +114,19 @@ type ChainConfig struct {
109
114
110
115
// S3 epoch is the first epoch containing S3 mainnet and all ethereum update up to Constantinople
111
116
S3Epoch * big.Int `json:"s3-epoch,omitempty"`
117
+
118
+ // ReceiptLogEpoch is the first epoch support receiptlog
119
+ ReceiptLogEpoch * big.Int `json:"receipt-log-epoch,omitempty"`
112
120
}
113
121
114
122
// String implements the fmt.Stringer interface.
115
123
func (c * ChainConfig ) String () string {
116
- return fmt .Sprintf ("{ChainID: %v EIP155: %v CrossTx: %v CrossLink: %v}" ,
124
+ return fmt .Sprintf ("{ChainID: %v EIP155: %v CrossTx: %v CrossLink: %v ReceiptLog: %v }" ,
117
125
c .ChainID ,
118
126
c .EIP155Epoch ,
119
127
c .CrossTxEpoch ,
120
128
c .CrossLinkEpoch ,
129
+ c .ReceiptLogEpoch ,
121
130
)
122
131
}
123
132
@@ -151,6 +160,11 @@ func (c *ChainConfig) IsS3(epoch *big.Int) bool {
151
160
return isForked (c .S3Epoch , epoch )
152
161
}
153
162
163
+ // IsReceiptLog returns whether epoch is either equal to the ReceiptLog fork epoch or greater.
164
+ func (c * ChainConfig ) IsReceiptLog (epoch * big.Int ) bool {
165
+ return isForked (c .ReceiptLogEpoch , epoch )
166
+ }
167
+
154
168
// GasTable returns the gas table corresponding to the current phase (homestead or homestead reprice).
155
169
//
156
170
// The returned GasTable's fields shouldn't, under any circumstances, be changed.
@@ -259,8 +273,8 @@ func (err *ConfigCompatError) Error() string {
259
273
// Rules is a one time interface meaning that it shouldn't be used in between transition
260
274
// phases.
261
275
type Rules struct {
262
- ChainID * big.Int
263
- IsCrossLink , IsEIP155 , IsS3 bool
276
+ ChainID * big.Int
277
+ IsCrossLink , IsEIP155 , IsS3 , IsReceiptLog bool
264
278
}
265
279
266
280
// Rules ensures c's ChainID is not nil.
@@ -270,9 +284,10 @@ func (c *ChainConfig) Rules(epoch *big.Int) Rules {
270
284
chainID = new (big.Int )
271
285
}
272
286
return Rules {
273
- ChainID : new (big.Int ).Set (chainID ),
274
- IsCrossLink : c .IsCrossLink (epoch ),
275
- IsEIP155 : c .IsEIP155 (epoch ),
276
- IsS3 : c .IsS3 (epoch ),
287
+ ChainID : new (big.Int ).Set (chainID ),
288
+ IsCrossLink : c .IsCrossLink (epoch ),
289
+ IsEIP155 : c .IsEIP155 (epoch ),
290
+ IsS3 : c .IsS3 (epoch ),
291
+ IsReceiptLog : c .IsReceiptLog (epoch ),
277
292
}
278
293
}
0 commit comments