Skip to content

[ETCM-354] Move difficulty bomb block numbers to ForkBlockNumbers #1014

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/it/scala/io/iohk/ethereum/txExecTest/ECIP1017Test.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ class ECIP1017Test extends AnyFlatSpec with Matchers {
forkBlockNumbers = ForkBlockNumbers(
frontierBlockNumber = 0,
homesteadBlockNumber = 1150000,
difficultyBombPauseBlockNumber = Long.MaxValue,
difficultyBombContinueBlockNumber = Long.MaxValue,
difficultyBombRemovalBlockNumber = Long.MaxValue,
eip106BlockNumber = Long.MaxValue,
eip150BlockNumber = 2500000,
eip160BlockNumber = 3000000,
Expand All @@ -44,9 +47,6 @@ class ECIP1017Test extends AnyFlatSpec with Matchers {
customGenesisFileOpt = None,
customGenesisJsonOpt = None,
daoForkConfig = None,
difficultyBombPauseBlockNumber = Long.MaxValue,
difficultyBombContinueBlockNumber = Long.MaxValue,
difficultyBombRemovalBlockNumber = Long.MaxValue,
bootstrapNodes = Set(),
accountStartNonce = UInt256.Zero,
ethCompatibleStorage = true,
Expand Down
6 changes: 3 additions & 3 deletions src/it/scala/io/iohk/ethereum/txExecTest/ForksTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ class ForksTest extends AnyFlatSpec with Matchers {
eip155BlockNumber = 0,
eip106BlockNumber = Long.MaxValue,
eip161BlockNumber = Long.MaxValue,
difficultyBombPauseBlockNumber = Long.MaxValue,
difficultyBombContinueBlockNumber = Long.MaxValue,
difficultyBombRemovalBlockNumber = Long.MaxValue,
byzantiumBlockNumber = Long.MaxValue,
constantinopleBlockNumber = Long.MaxValue,
istanbulBlockNumber = Long.MaxValue,
Expand All @@ -43,9 +46,6 @@ class ForksTest extends AnyFlatSpec with Matchers {
maxCodeSize = None,
customGenesisFileOpt = None,
customGenesisJsonOpt = None,
difficultyBombPauseBlockNumber = Long.MaxValue,
difficultyBombContinueBlockNumber = Long.MaxValue,
difficultyBombRemovalBlockNumber = Long.MaxValue,
accountStartNonce = UInt256.Zero,
daoForkConfig = None,
gasTieBreaker = false,
Expand Down
3 changes: 3 additions & 0 deletions src/main/scala/io/iohk/ethereum/jsonrpc/TestService.scala
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ class TestService(
eip155BlockNumber = byzantiumBlockNumber,
eip160BlockNumber = byzantiumBlockNumber,
eip161BlockNumber = byzantiumBlockNumber,
difficultyBombPauseBlockNumber = neverOccuringBlock,
difficultyBombContinueBlockNumber = neverOccuringBlock,
difficultyBombRemovalBlockNumber = neverOccuringBlock,
byzantiumBlockNumber = byzantiumBlockNumber,
ecip1049BlockNumber = None,
ecip1097BlockNumber = neverOccuringBlock,
Expand Down
12 changes: 6 additions & 6 deletions src/main/scala/io/iohk/ethereum/utils/BlockchainConfig.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ case class BlockchainConfig(
forkBlockNumbers: ForkBlockNumbers,
treasuryAddress: Address,
maxCodeSize: Option[BigInt],
difficultyBombPauseBlockNumber: BigInt,
difficultyBombContinueBlockNumber: BigInt,
difficultyBombRemovalBlockNumber: BigInt,
customGenesisFileOpt: Option[String],
customGenesisJsonOpt: Option[String],
daoForkConfig: Option[DaoForkConfig],
Expand Down Expand Up @@ -46,6 +43,9 @@ case class ForkBlockNumbers(
eip155BlockNumber: BigInt,
eip160BlockNumber: BigInt,
eip161BlockNumber: BigInt,
difficultyBombPauseBlockNumber: BigInt,
difficultyBombContinueBlockNumber: BigInt,
difficultyBombRemovalBlockNumber: BigInt,
byzantiumBlockNumber: BigInt,
constantinopleBlockNumber: BigInt,
istanbulBlockNumber: BigInt,
Expand Down Expand Up @@ -139,6 +139,9 @@ object BlockchainConfig {
eip155BlockNumber = eip155BlockNumber,
eip160BlockNumber = eip160BlockNumber,
eip161BlockNumber = eip161BlockNumber,
difficultyBombPauseBlockNumber = difficultyBombPauseBlockNumber,
difficultyBombContinueBlockNumber = difficultyBombContinueBlockNumber,
difficultyBombRemovalBlockNumber = difficultyBombRemovalBlockNumber,
byzantiumBlockNumber = byzantiumBlockNumber,
constantinopleBlockNumber = constantinopleBlockNumber,
istanbulBlockNumber = istanbulBlockNumber,
Expand All @@ -153,9 +156,6 @@ object BlockchainConfig {
),
treasuryAddress = treasuryAddress,
maxCodeSize = maxCodeSize,
difficultyBombPauseBlockNumber = difficultyBombPauseBlockNumber,
difficultyBombContinueBlockNumber = difficultyBombContinueBlockNumber,
difficultyBombRemovalBlockNumber = difficultyBombRemovalBlockNumber,
customGenesisFileOpt = customGenesisFileOpt,
customGenesisJsonOpt = customGenesisJsonOpt,
daoForkConfig = daoForkConfig,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,6 @@ class BlockGeneratorSpec extends AnyFlatSpec with Matchers with ScalaCheckProper

it should "generate block before eip155 and filter out chain specific tx" in new TestSetup {
override lazy val blockchainConfig = BlockchainConfig(
difficultyBombPauseBlockNumber = 3000000,
difficultyBombContinueBlockNumber = 5000000,
difficultyBombRemovalBlockNumber = 5900000,
chainId = 0x3d.toByte,
networkId = 1,
customGenesisFileOpt = Some("test-genesis.json"),
Expand All @@ -223,6 +220,9 @@ class BlockGeneratorSpec extends AnyFlatSpec with Matchers with ScalaCheckProper
forkBlockNumbers = ForkBlockNumbers(
frontierBlockNumber = 0,
homesteadBlockNumber = 1150000,
difficultyBombPauseBlockNumber = 3000000,
difficultyBombContinueBlockNumber = 5000000,
difficultyBombRemovalBlockNumber = 5900000,
eip155BlockNumber = Long.MaxValue,
eip106BlockNumber = Long.MaxValue,
byzantiumBlockNumber = Long.MaxValue,
Expand Down Expand Up @@ -284,6 +284,9 @@ class BlockGeneratorSpec extends AnyFlatSpec with Matchers with ScalaCheckProper
homesteadBlockNumber = 1150000,
eip155BlockNumber = Long.MaxValue,
eip106BlockNumber = Long.MaxValue,
difficultyBombPauseBlockNumber = 3000000,
difficultyBombContinueBlockNumber = 5000000,
difficultyBombRemovalBlockNumber = 5900000,
byzantiumBlockNumber = Long.MaxValue,
constantinopleBlockNumber = Long.MaxValue,
istanbulBlockNumber = Long.MaxValue,
Expand All @@ -299,9 +302,6 @@ class BlockGeneratorSpec extends AnyFlatSpec with Matchers with ScalaCheckProper
ecip1099BlockNumber = Long.MaxValue,
ecip1049BlockNumber = None
),
difficultyBombPauseBlockNumber = 3000000,
difficultyBombContinueBlockNumber = 5000000,
difficultyBombRemovalBlockNumber = 5900000,
chainId = 0x3d.toByte,
networkId = 1,
customGenesisFileOpt = Some("test-genesis.json"),
Expand Down Expand Up @@ -657,6 +657,9 @@ class BlockGeneratorSpec extends AnyFlatSpec with Matchers with ScalaCheckProper
eip155BlockNumber = 0,
eip106BlockNumber = Long.MaxValue,
byzantiumBlockNumber = Long.MaxValue,
difficultyBombPauseBlockNumber = 3000000,
difficultyBombContinueBlockNumber = 5000000,
difficultyBombRemovalBlockNumber = 5900000,
constantinopleBlockNumber = Long.MaxValue,
istanbulBlockNumber = Long.MaxValue,
eip160BlockNumber = Long.MaxValue,
Expand All @@ -671,9 +674,6 @@ class BlockGeneratorSpec extends AnyFlatSpec with Matchers with ScalaCheckProper
ecip1099BlockNumber = Long.MaxValue,
ecip1049BlockNumber = None
),
difficultyBombPauseBlockNumber = 3000000,
difficultyBombContinueBlockNumber = 5000000,
difficultyBombRemovalBlockNumber = 5900000,
chainId = 0x3d.toByte,
networkId = 1,
customGenesisFileOpt = Some("test-genesis.json"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,9 @@ class EthashBlockHeaderValidatorSpec
forkBlockNumbers = ForkBlockNumbers(
frontierBlockNumber = 0,
homesteadBlockNumber = 1150000,
difficultyBombPauseBlockNumber = 3000000,
difficultyBombContinueBlockNumber = 5000000,
difficultyBombRemovalBlockNumber = 5900000,
byzantiumBlockNumber = 4370000,
constantinopleBlockNumber = 7280000,
istanbulBlockNumber = 9069000,
Expand All @@ -396,9 +399,6 @@ class EthashBlockHeaderValidatorSpec
ecip1099BlockNumber = Long.MaxValue,
ecip1049BlockNumber = None
),
difficultyBombPauseBlockNumber = 3000000,
difficultyBombContinueBlockNumber = 5000000,
difficultyBombRemovalBlockNumber = 5900000,
daoForkConfig = Some(new DaoForkConfig {
override val blockExtraData: Option[ByteString] =
if (supportsDaoFork) Some(ProDaoForkBlock.header.extraData) else None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ class RestrictedEthashBlockHeaderValidatorSpec
forkBlockNumbers = ForkBlockNumbers(
frontierBlockNumber = 0,
homesteadBlockNumber = 1150000,
difficultyBombPauseBlockNumber = 3000000,
difficultyBombContinueBlockNumber = 5000000,
difficultyBombRemovalBlockNumber = 5900000,
byzantiumBlockNumber = 4370000,
constantinopleBlockNumber = 7280000,
istanbulBlockNumber = 9069000,
Expand All @@ -88,9 +91,6 @@ class RestrictedEthashBlockHeaderValidatorSpec
ecip1099BlockNumber = Long.MaxValue,
ecip1049BlockNumber = None
),
difficultyBombPauseBlockNumber = 3000000,
difficultyBombContinueBlockNumber = 5000000,
difficultyBombRemovalBlockNumber = 5900000,
daoForkConfig = None,
// unused
maxCodeSize = None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,9 @@ class PersonalServiceSpec
eip155BlockNumber = 12345,
eip161BlockNumber = 0,
frontierBlockNumber = 0,
difficultyBombPauseBlockNumber = 0,
difficultyBombContinueBlockNumber = 0,
difficultyBombRemovalBlockNumber = Long.MaxValue,
homesteadBlockNumber = 0,
eip150BlockNumber = 0,
eip160BlockNumber = 0,
Expand All @@ -420,9 +423,6 @@ class PersonalServiceSpec
ecip1099BlockNumber = Long.MaxValue,
ecip1049BlockNumber = None
),
difficultyBombPauseBlockNumber = 0,
difficultyBombContinueBlockNumber = 0,
difficultyBombRemovalBlockNumber = Long.MaxValue,
customGenesisFileOpt = None,
customGenesisJsonOpt = None,
accountStartNonce = UInt256.Zero,
Expand Down
6 changes: 3 additions & 3 deletions src/test/scala/io/iohk/ethereum/ledger/StxLedgerSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ trait ScenarioSetup extends EphemBlockchainTestSetup {
eip161BlockNumber = 0,
frontierBlockNumber = 0,
homesteadBlockNumber = 0,
difficultyBombPauseBlockNumber = 0,
difficultyBombContinueBlockNumber = 0,
difficultyBombRemovalBlockNumber = Long.MaxValue,
eip150BlockNumber = 0,
eip160BlockNumber = 0,
eip106BlockNumber = 0,
Expand All @@ -129,9 +132,6 @@ trait ScenarioSetup extends EphemBlockchainTestSetup {
chainId = 0x03.toByte,
networkId = 1,
maxCodeSize = None,
difficultyBombPauseBlockNumber = 0,
difficultyBombContinueBlockNumber = 0,
difficultyBombRemovalBlockNumber = Long.MaxValue,
customGenesisFileOpt = None,
customGenesisJsonOpt = None,
accountStartNonce = UInt256.Zero,
Expand Down