8383 HIP32Epoch : big .NewInt (2152 ), // 2024-10-31 13:02 UTC
8484 IsOneSecondEpoch : EpochTBD ,
8585 EIP2537PrecompileEpoch : EpochTBD ,
86+ EIP5656McopyEpoch : EpochTBD ,
8687 }
8788
8889 // TestnetChainConfig contains the chain parameters to run a node on the harmony test network.
@@ -134,6 +135,7 @@ var (
134135 IsOneSecondEpoch : EpochTBD ,
135136 EIP2537PrecompileEpoch : EpochTBD ,
136137 EIP1153TransientStorageEpoch : big .NewInt (6280 ),
138+ EIP5656McopyEpoch : EpochTBD ,
137139 }
138140 // PangaeaChainConfig contains the chain parameters for the Pangaea network.
139141 // All features except for CrossLink are enabled at launch.
@@ -184,6 +186,7 @@ var (
184186 TestnetExternalEpoch : EpochTBD ,
185187 IsOneSecondEpoch : EpochTBD ,
186188 EIP2537PrecompileEpoch : EpochTBD ,
189+ EIP5656McopyEpoch : EpochTBD ,
187190 }
188191
189192 // PartnerChainConfig contains the chain parameters for the Partner network.
@@ -236,6 +239,7 @@ var (
236239 IsOneSecondEpoch : big .NewInt (17436 ),
237240 EIP2537PrecompileEpoch : EpochTBD ,
238241 EIP1153TransientStorageEpoch : big .NewInt (35626 ),
242+ EIP5656McopyEpoch : EpochTBD ,
239243 }
240244
241245 // StressnetChainConfig contains the chain parameters for the Stress test network.
@@ -287,6 +291,7 @@ var (
287291 TestnetExternalEpoch : EpochTBD ,
288292 IsOneSecondEpoch : EpochTBD ,
289293 EIP2537PrecompileEpoch : EpochTBD ,
294+ EIP5656McopyEpoch : EpochTBD ,
290295 }
291296
292297 // LocalnetChainConfig contains the chain parameters to run for local development.
@@ -337,6 +342,7 @@ var (
337342 TestnetExternalEpoch : EpochTBD ,
338343 IsOneSecondEpoch : big .NewInt (4 ),
339344 EIP2537PrecompileEpoch : EpochTBD ,
345+ EIP5656McopyEpoch : EpochTBD ,
340346 }
341347
342348 // AllProtocolChanges ...
@@ -391,6 +397,7 @@ var (
391397 big .NewInt (0 ),
392398 big .NewInt (0 ), // EIP2537PrecompileEpoch
393399 big .NewInt (0 ), // 1153 transient storage
400+ big .NewInt (0 ), // EIP5656McopyEpoch
394401 }
395402
396403 // TestChainConfig ...
@@ -445,6 +452,7 @@ var (
445452 big .NewInt (0 ),
446453 big .NewInt (0 ), // EIP2537PrecompileEpoch
447454 big .NewInt (0 ), // 1153 transient storage
455+ big .NewInt (0 ), // EIP5656McopyEpoch
448456 }
449457
450458 // TestRules ...
@@ -634,11 +642,14 @@ type ChainConfig struct {
634642
635643 // EIP2537PrecompileEpoch is the first epoch to support the EIP-2537 precompiles
636644 EIP1153TransientStorageEpoch * big.Int `json:"eip1153-transient-storage-epoch,omitempty"`
645+
646+ // EIP5656McopyEpoch is the first epoch to support the EIP-5656 MCOPY opcode
647+ EIP5656McopyEpoch * big.Int `json:"eip5656-mcopy-epoch,omitempty"`
637648}
638649
639650// String implements the fmt.Stringer interface.
640651func (c * ChainConfig ) String () string {
641- return fmt .Sprintf ("{ChainID: %v EthCompatibleChainID: %v EIP155: %v CrossTx: %v Staking: %v CrossLink: %v ReceiptLog: %v SHA3Epoch: %v StakingPrecompileEpoch: %v ChainIdFixEpoch: %v CrossShardXferPrecompileEpoch: %v EIP2537PrecompileEpoch: %v EIP1153TransientStorageEpoch: %v}" ,
652+ return fmt .Sprintf ("{ChainID: %v EthCompatibleChainID: %v EIP155: %v CrossTx: %v Staking: %v CrossLink: %v ReceiptLog: %v SHA3Epoch: %v StakingPrecompileEpoch: %v ChainIdFixEpoch: %v CrossShardXferPrecompileEpoch: %v EIP2537PrecompileEpoch: %v EIP1153TransientStorageEpoch: %v EIP5656McopyEpoch: %v }" ,
642653 c .ChainID ,
643654 c .EthCompatibleChainID ,
644655 c .EIP155Epoch ,
@@ -652,6 +663,7 @@ func (c *ChainConfig) String() string {
652663 c .CrossShardXferPrecompileEpoch ,
653664 c .EIP2537PrecompileEpoch ,
654665 c .EIP1153TransientStorageEpoch ,
666+ c .EIP5656McopyEpoch ,
655667 )
656668}
657669
@@ -878,6 +890,11 @@ func (c *ChainConfig) IsEIP1153TransientStorage(epoch *big.Int) bool {
878890 return isForked (c .EIP1153TransientStorageEpoch , epoch )
879891}
880892
893+ // IsEIP5656Mcopy determines whether EIP-5656 MCOPY opcode is available in the EVM
894+ func (c * ChainConfig ) IsEIP5656Mcopy (epoch * big.Int ) bool {
895+ return isForked (c .EIP5656McopyEpoch , epoch )
896+ }
897+
881898// IsChainIdFix returns whether epoch is either equal to the ChainId Fix fork epoch or greater.
882899func (c * ChainConfig ) IsChainIdFix (epoch * big.Int ) bool {
883900 return isForked (c .ChainIdFixEpoch , epoch )
@@ -1009,6 +1026,7 @@ type Rules struct {
10091026 IsValidatorCodeFix bool
10101027 IsYoloV2 bool
10111028 Is1153TransientStorage bool
1029+ IsEIP5656Mcopy bool
10121030}
10131031
10141032// Rules ensures c's ChainID is not nil.
@@ -1041,5 +1059,6 @@ func (c *ChainConfig) Rules(epoch *big.Int) Rules {
10411059 IsValidatorCodeFix : c .IsValidatorCodeFix (epoch ),
10421060 IsEIP2537Precompile : c .IsEIP2537Precompile (epoch ),
10431061 Is1153TransientStorage : c .IsEIP1153TransientStorage (epoch ),
1062+ IsEIP5656Mcopy : c .IsEIP5656Mcopy (epoch ),
10441063 }
10451064}
0 commit comments