-
Notifications
You must be signed in to change notification settings - Fork 420
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NODE-2632 Delayed Light Node block structure (#3917)
- Loading branch information
Showing
28 changed files
with
352 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...orm/it/sync/LightNodeBroadcastSuite.scala → ...c/lightnode/LightNodeBroadcastSuite.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 16 additions & 11 deletions
27
node-it/src/test/scala/com/wavesplatform/it/sync/lightnode/LightNodeMiningSuite.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,31 @@ | ||
package com.wavesplatform.it.sync.lightnode | ||
|
||
import com.typesafe.config.Config | ||
import com.wavesplatform.features.BlockchainFeatures.LightNode | ||
import com.wavesplatform.it.api.SyncHttpApi.* | ||
import com.wavesplatform.it.{BaseFunSuite, NodeConfigs, TransferSending} | ||
import com.wavesplatform.test.NumericExt | ||
|
||
class LightNodeMiningSuite extends BaseFunSuite with TransferSending { | ||
override def nodeConfigs: Seq[Config] = | ||
NodeConfigs.newBuilder | ||
.overrideBase(_.lightNode) | ||
.withDefault(2) | ||
.overrideBase(_.preactivatedFeatures(LightNode.id.toInt -> 2)) | ||
.overrideBase(_.raw("waves.blockchain.custom.functionality.light-node-block-fields-absence-interval = 2")) | ||
.withDefault(1) | ||
.withSpecial(1, _.lightNode) | ||
.buildNonConflicting() | ||
|
||
test("nodes can mine in light mode") { | ||
val first = nodes.head | ||
val second = nodes.last | ||
test("node can mine in light mode after light-node-block-fields-absence-interval") { | ||
val lightNode = nodes.find(_.settings.enableLightMode).get | ||
val fullNode = nodes.find(!_.settings.enableLightMode).get | ||
val lightNodeAddress = lightNode.keyPair.toAddress.toString | ||
val fullNodeAddress = fullNode.keyPair.toAddress.toString | ||
|
||
val tx1 = first.transfer(first.keyPair, second.address, 1, waitForTx = true) | ||
nodes.waitForHeightArise() | ||
second.transactionStatus(tx1.id).applicationStatus.get shouldBe "succeeded" | ||
nodes.waitForHeight(5) | ||
fullNode.transfer(fullNode.keyPair, lightNodeAddress, fullNode.balance(fullNodeAddress).balance - 1.waves) | ||
lightNode.blockSeq(2, 5).foreach(_.generator shouldBe fullNodeAddress) | ||
|
||
val tx2 = second.transfer(second.keyPair, first.address, 1, waitForTx = true) | ||
nodes.waitForHeightArise() | ||
first.transactionStatus(tx2.id).applicationStatus.get shouldBe "succeeded" | ||
lightNode.waitForHeight(6) | ||
lightNode.blockAt(6).generator shouldBe lightNodeAddress | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
...form/it/sync/LightNodeRollbackSuite.scala → ...nc/lightnode/LightNodeRollbackSuite.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.