@@ -64,3 +64,110 @@ func TestMainnetTBDFeaturesInactiveBeforeActivation(t *testing.T) {
6464 require .False (t , rules .IsEIP5656Mcopy )
6565 require .False (t , rules .IsCXReceiptStateRollback )
6666}
67+
68+ func TestBloomEpochConfigured (t * testing.T ) {
69+ require .Equal (t , big .NewInt (7420 ), TestnetChainConfig .BloomEpoch )
70+ require .Equal (t , big .NewInt (53508 ), PartnerChainConfig .BloomEpoch )
71+ require .Equal (t , big .NewInt (5 ), LocalnetChainConfig .BloomEpoch )
72+
73+ require .True (t , TestnetChainConfig .BloomEpoch .Cmp (maxEpoch (testnetBloomFeatureEpochs ())) >= 0 )
74+ require .True (t , PartnerChainConfig .BloomEpoch .Cmp (maxEpoch (devnetBloomFeatureEpochs ())) >= 0 )
75+ require .True (t , LocalnetChainConfig .BloomEpoch .Cmp (maxEpoch (localnetBloomFeatureEpochs ())) >= 0 )
76+
77+ for _ , epoch := range localnetBloomFeatureEpochs () {
78+ require .Equal (t , big .NewInt (5 ), epoch )
79+ }
80+ }
81+
82+ func testnetBloomFeatureEpochs () []* big.Int {
83+ return []* big.Int {
84+ TestnetChainConfig .CXMerkleProofReplayFixEpoch ,
85+ TestnetChainConfig .CXReceiptStateRollbackEpoch ,
86+ TestnetChainConfig .TimestampValidationEpoch ,
87+ TestnetChainConfig .SlashExternalStakeDenomFixEpoch ,
88+ TestnetChainConfig .DuplicateCrossLinkEpoch ,
89+ TestnetChainConfig .ShardStateValidationEpoch ,
90+ TestnetChainConfig .RejectShard0CrossLinkEpoch ,
91+ TestnetChainConfig .EIP2537PrecompileEpoch ,
92+ TestnetChainConfig .EIP1153TransientStorageEpoch ,
93+ TestnetChainConfig .EIP7939CLZEpoch ,
94+ TestnetChainConfig .EIP5656McopyEpoch ,
95+ TestnetChainConfig .EIP3855Epoch ,
96+ TestnetChainConfig .EIP3860Epoch ,
97+ TestnetChainConfig .EIP6780Epoch ,
98+ TestnetChainConfig .EIP8024Epoch ,
99+ TestnetChainConfig .RejectDuplicateSlashEvidenceEpoch ,
100+ TestnetChainConfig .AllowlistEpoch ,
101+ TestnetChainConfig .LeaderRotationV2Epoch ,
102+ TestnetChainConfig .SlashGroupOrderFixEpoch ,
103+ TestnetChainConfig .ValidatorWrapperAddressBindEpoch ,
104+ TestnetChainConfig .BLSProofBindEpoch ,
105+ TestnetChainConfig .SlashBallotSignerFixEpoch ,
106+ TestnetChainConfig .VerifyBeaconHeaderSlashEpoch ,
107+ }
108+ }
109+
110+ func devnetBloomFeatureEpochs () []* big.Int {
111+ return []* big.Int {
112+ PartnerChainConfig .CXMerkleProofReplayFixEpoch ,
113+ PartnerChainConfig .CXReceiptStateRollbackEpoch ,
114+ PartnerChainConfig .TimestampValidationEpoch ,
115+ PartnerChainConfig .SlashExternalStakeDenomFixEpoch ,
116+ PartnerChainConfig .DuplicateCrossLinkEpoch ,
117+ PartnerChainConfig .ShardStateValidationEpoch ,
118+ PartnerChainConfig .RejectShard0CrossLinkEpoch ,
119+ PartnerChainConfig .EIP2537PrecompileEpoch ,
120+ PartnerChainConfig .EIP1153TransientStorageEpoch ,
121+ PartnerChainConfig .EIP7939CLZEpoch ,
122+ PartnerChainConfig .EIP5656McopyEpoch ,
123+ PartnerChainConfig .EIP3855Epoch ,
124+ PartnerChainConfig .EIP3860Epoch ,
125+ PartnerChainConfig .EIP6780Epoch ,
126+ PartnerChainConfig .EIP8024Epoch ,
127+ PartnerChainConfig .RejectDuplicateSlashEvidenceEpoch ,
128+ PartnerChainConfig .LeaderRotationV2Epoch ,
129+ PartnerChainConfig .SlashGroupOrderFixEpoch ,
130+ PartnerChainConfig .ValidatorWrapperAddressBindEpoch ,
131+ PartnerChainConfig .BLSProofBindEpoch ,
132+ PartnerChainConfig .SlashBallotSignerFixEpoch ,
133+ PartnerChainConfig .VerifyBeaconHeaderSlashEpoch ,
134+ }
135+ }
136+
137+ func localnetBloomFeatureEpochs () []* big.Int {
138+ return []* big.Int {
139+ LocalnetChainConfig .CXMerkleProofReplayFixEpoch ,
140+ LocalnetChainConfig .CXReceiptStateRollbackEpoch ,
141+ LocalnetChainConfig .TimestampValidationEpoch ,
142+ LocalnetChainConfig .SlashExternalStakeDenomFixEpoch ,
143+ LocalnetChainConfig .DuplicateCrossLinkEpoch ,
144+ LocalnetChainConfig .ShardStateValidationEpoch ,
145+ LocalnetChainConfig .RejectShard0CrossLinkEpoch ,
146+ LocalnetChainConfig .EIP2537PrecompileEpoch ,
147+ LocalnetChainConfig .EIP1153TransientStorageEpoch ,
148+ LocalnetChainConfig .EIP7939CLZEpoch ,
149+ LocalnetChainConfig .EIP5656McopyEpoch ,
150+ LocalnetChainConfig .EIP3855Epoch ,
151+ LocalnetChainConfig .EIP3860Epoch ,
152+ LocalnetChainConfig .EIP6780Epoch ,
153+ LocalnetChainConfig .EIP8024Epoch ,
154+ LocalnetChainConfig .RejectDuplicateSlashEvidenceEpoch ,
155+ LocalnetChainConfig .AllowlistEpoch ,
156+ LocalnetChainConfig .LeaderRotationV2Epoch ,
157+ LocalnetChainConfig .SlashGroupOrderFixEpoch ,
158+ LocalnetChainConfig .ValidatorWrapperAddressBindEpoch ,
159+ LocalnetChainConfig .BLSProofBindEpoch ,
160+ LocalnetChainConfig .SlashBallotSignerFixEpoch ,
161+ LocalnetChainConfig .VerifyBeaconHeaderSlashEpoch ,
162+ }
163+ }
164+
165+ func maxEpoch (epochs []* big.Int ) * big.Int {
166+ max := epochs [0 ]
167+ for _ , epoch := range epochs [1 :] {
168+ if epoch .Cmp (max ) > 0 {
169+ max = epoch
170+ }
171+ }
172+ return max
173+ }
0 commit comments