diff --git a/src/it/resources/template.conf b/src/it/resources/template.conf index c68bbdbd5c5..77ff2aeb554 100644 --- a/src/it/resources/template.conf +++ b/src/it/resources/template.conf @@ -27,7 +27,7 @@ waves { reset-effective-balances-at-height = 0 allow-leased-balance-transfer-until = 0 enable-microblocks-after-height = 0 - block-version-3-after = 0 + block-version-3-after-height = 0 pre-activated-features = { 2 = 0 } diff --git a/src/main/resources/application.conf b/src/main/resources/application.conf index 6dc39d2452a..4fb5263b298 100644 --- a/src/main/resources/application.conf +++ b/src/main/resources/application.conf @@ -142,7 +142,7 @@ waves { # allow-unissued-assets-until = 0 # require-payment-unique-id-after = 0 # allow-leased-balance-transfer-until = 0 - # block-version-3-after = 0 + # block-version-3-after-height = 0 # pre-activated-features { # 1 = 100 # 2 = 200 diff --git a/src/main/scala/com/wavesplatform/Coordinator.scala b/src/main/scala/com/wavesplatform/Coordinator.scala index 2ac60f9c367..1c14f4e7084 100644 --- a/src/main/scala/com/wavesplatform/Coordinator.scala +++ b/src/main/scala/com/wavesplatform/Coordinator.scala @@ -207,10 +207,10 @@ object Coordinator extends ScorexLogging with Instrumented { (for { height <- history.heightOf(block.reference).toRight(s"history does not contain parent ${block.reference}") - _ <- Either.cond(height > fs.blockVersion3After + _ <- Either.cond(height > fs.blockVersion3AfterHeight || block.version == Block.GenesisBlockVersion || block.version == Block.PlainBlockVersion, - (), s"Block Version 3 can only appear at height greater than ${fs.blockVersion3After}") + (), s"Block Version 3 can only appear at height greater than ${fs.blockVersion3AfterHeight}") _ <- Either.cond(blockTime - currentTs < MaxTimeDrift, (), s"timestamp $blockTime is from future") _ <- Either.cond(blockTime < fs.requireSortedTransactionsAfter || height > fs.dontRequireSortedTransactionsAfter diff --git a/src/main/scala/com/wavesplatform/mining/Miner.scala b/src/main/scala/com/wavesplatform/mining/Miner.scala index 4634ef6b60a..e112975d6e2 100644 --- a/src/main/scala/com/wavesplatform/mining/Miner.scala +++ b/src/main/scala/com/wavesplatform/mining/Miner.scala @@ -83,7 +83,7 @@ class MinerImpl( history.read { implicit l => // should take last block right at the time of mining since microblocks might have been added val height = history.height() - val version = if (height <= blockchainSettings.functionalitySettings.blockVersion3After) PlainBlockVersion else NgBlockVersion + val version = if (height <= blockchainSettings.functionalitySettings.blockVersion3AfterHeight) PlainBlockVersion else NgBlockVersion val lastBlock = history.lastBlock.get val greatGrandParentTimestamp = history.parent(lastBlock, 2).map(_.timestamp) val referencedBlockInfo = history.bestLastBlockInfo(System.currentTimeMillis() - minMicroBlockDurationMills).get diff --git a/src/main/scala/com/wavesplatform/settings/BlockchainSettings.scala b/src/main/scala/com/wavesplatform/settings/BlockchainSettings.scala index 2c1b8916349..f08b4a0d156 100644 --- a/src/main/scala/com/wavesplatform/settings/BlockchainSettings.scala +++ b/src/main/scala/com/wavesplatform/settings/BlockchainSettings.scala @@ -24,9 +24,9 @@ case class FunctionalitySettings(featureCheckBlocksPeriod: Int, allowMultipleLeaseCancelTransactionUntilTimestamp: Long, resetEffectiveBalancesAtHeight: Long, allowLeasedBalanceTransferUntil: Long, - blockVersion3After: Long, + blockVersion3AfterHeight: Long, preActivatedFeatures: Map[Short, Int]) { - val dontRequireSortedTransactionsAfter: Long = blockVersion3After + val dontRequireSortedTransactionsAfter: Long = blockVersion3AfterHeight require(featureCheckBlocksPeriod > 0, "featureCheckBlocksPeriod must be greater than 0") require((blocksForFeatureActivation > 0) && (blocksForFeatureActivation <= featureCheckBlocksPeriod), s"blocksForFeatureActivation must be in range 1 to $featureCheckBlocksPeriod") @@ -48,7 +48,7 @@ object FunctionalitySettings { allowMultipleLeaseCancelTransactionUntilTimestamp = 1492768800000L, resetEffectiveBalancesAtHeight = 462000, allowLeasedBalanceTransferUntil = Long.MaxValue, - blockVersion3After = Long.MaxValue, + blockVersion3AfterHeight = Long.MaxValue, preActivatedFeatures = Map.empty) val TESTNET = apply( @@ -66,7 +66,7 @@ object FunctionalitySettings { allowMultipleLeaseCancelTransactionUntilTimestamp = 1492560000000L, resetEffectiveBalancesAtHeight = 51500, allowLeasedBalanceTransferUntil = 1495238400000L, - blockVersion3After = 1508144400000L, + blockVersion3AfterHeight = 161700, preActivatedFeatures = Map.empty) val configPath = "waves.blockchain.custom.functionality" diff --git a/src/test/scala/com/wavesplatform/settings/BlockchainSettingsSpecification.scala b/src/test/scala/com/wavesplatform/settings/BlockchainSettingsSpecification.scala index d5e1aa5c100..ab75f76a458 100644 --- a/src/test/scala/com/wavesplatform/settings/BlockchainSettingsSpecification.scala +++ b/src/test/scala/com/wavesplatform/settings/BlockchainSettingsSpecification.scala @@ -33,7 +33,7 @@ class BlockchainSettingsSpecification extends FlatSpec with Matchers { | allow-multiple-lease-cancel-transaction-until-timestamp = 14 | reset-effective-balances-at-height = 15 | allow-leased-balance-transfer-until = 17 - | block-version-3-after = 18 + | block-version-3-after-height = 18 | pre-activated-features { | 19 = 100 | 20 = 200 @@ -75,7 +75,7 @@ class BlockchainSettingsSpecification extends FlatSpec with Matchers { settings.functionalitySettings.allowMultipleLeaseCancelTransactionUntilTimestamp should be(14) settings.functionalitySettings.resetEffectiveBalancesAtHeight should be(15) settings.functionalitySettings.allowLeasedBalanceTransferUntil should be(17) - settings.functionalitySettings.blockVersion3After should be(18) + settings.functionalitySettings.blockVersion3AfterHeight should be(18) settings.functionalitySettings.preActivatedFeatures should be(Map(19 -> 100, 20 -> 200)) settings.genesisSettings.blockTimestamp should be(1460678400000L) settings.genesisSettings.timestamp should be(1460678400000L) diff --git a/src/test/scala/scorex/settings/TestFunctionalitySettings.scala b/src/test/scala/scorex/settings/TestFunctionalitySettings.scala index 7cd2637eefb..f0fdd5d56ac 100644 --- a/src/test/scala/scorex/settings/TestFunctionalitySettings.scala +++ b/src/test/scala/scorex/settings/TestFunctionalitySettings.scala @@ -14,7 +14,7 @@ object TestFunctionalitySettings { allowInvalidReissueInSameBlockUntilTimestamp = 0L, allowMultipleLeaseCancelTransactionUntilTimestamp = 0L, resetEffectiveBalancesAtHeight = 0, allowLeasedBalanceTransferUntil = 0L, - blockVersion3After = 0L, + blockVersion3AfterHeight = 0L, preActivatedFeatures = Map.empty ) diff --git a/waves-devnet.conf b/waves-devnet.conf index 18e52434b37..f4f2748bbfd 100644 --- a/waves-devnet.conf +++ b/waves-devnet.conf @@ -21,7 +21,7 @@ waves { allow-multiple-lease-cancel-transaction-until-timestamp: 1492128000000 reset-effective-balances-at-height: 4650 allow-leased-balance-transfer-until: 0 - block-version-3-after: 0 + block-version-3-after-height: 0 pre-activated-features {} } genesis {