From 3f43d8ad21fa4e928c52309bd26c703e202afc1d Mon Sep 17 00:00:00 2001 From: Christian Sailer Date: Mon, 30 Oct 2017 11:55:04 +0000 Subject: [PATCH 01/70] Add helper for checking whether to check checkpoints and unit test it. --- .../net/corda/node/services/config/NodeConfiguration.kt | 4 ++++ .../node/services/statemachine/StateMachineManagerImpl.kt | 3 ++- .../node/services/config/NodeConfigurationImplTest.kt | 8 ++++---- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/node/src/main/kotlin/net/corda/node/services/config/NodeConfiguration.kt b/node/src/main/kotlin/net/corda/node/services/config/NodeConfiguration.kt index 43a07000f3..8423384d90 100644 --- a/node/src/main/kotlin/net/corda/node/services/config/NodeConfiguration.kt +++ b/node/src/main/kotlin/net/corda/node/services/config/NodeConfiguration.kt @@ -49,6 +49,10 @@ interface NodeConfiguration : NodeSSLConfiguration { val detectPublicIp: Boolean get() = true } +fun NodeConfiguration.shouldCheckCheckpoints(): Boolean{ + return this.devMode && this.devModeOptions?.disableCheckpointChecker != true +} + data class NotaryConfig(val validating: Boolean, val raft: RaftConfig? = null, val bftSMaRt: BFTSMaRtConfiguration? = null, diff --git a/node/src/main/kotlin/net/corda/node/services/statemachine/StateMachineManagerImpl.kt b/node/src/main/kotlin/net/corda/node/services/statemachine/StateMachineManagerImpl.kt index 78dd79cdaa..391b636684 100644 --- a/node/src/main/kotlin/net/corda/node/services/statemachine/StateMachineManagerImpl.kt +++ b/node/src/main/kotlin/net/corda/node/services/statemachine/StateMachineManagerImpl.kt @@ -31,6 +31,7 @@ import net.corda.node.internal.InitiatedFlowFactory import net.corda.node.services.api.Checkpoint import net.corda.node.services.api.CheckpointStorage import net.corda.node.services.api.ServiceHubInternal +import net.corda.node.services.config.shouldCheckCheckpoints import net.corda.node.services.messaging.ReceivedMessage import net.corda.node.services.messaging.TopicSession import net.corda.node.utilities.* @@ -88,7 +89,7 @@ class StateMachineManagerImpl( private val scheduler = FiberScheduler() private val mutex = ThreadBox(InnerState()) // This thread (only enabled in dev mode) deserialises checkpoints in the background to shake out bugs in checkpoint restore. - private val checkpointCheckerThread = if (serviceHub.configuration.devModeOptions?.disableCheckpointChecker != true) { + private val checkpointCheckerThread = if (serviceHub.configuration.shouldCheckCheckpoints()) { newNamedSingleThreadExecutor("CheckpointChecker") } else { null diff --git a/node/src/test/kotlin/net/corda/node/services/config/NodeConfigurationImplTest.kt b/node/src/test/kotlin/net/corda/node/services/config/NodeConfigurationImplTest.kt index 0bdf58e6f8..bb5c405ee6 100644 --- a/node/src/test/kotlin/net/corda/node/services/config/NodeConfigurationImplTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/config/NodeConfigurationImplTest.kt @@ -23,10 +23,10 @@ class NodeConfigurationImplTest { @Test fun `check devModeOptions flag helper`() { - assertFalse { configDebugOptions(true, null).devModeOptions?.disableCheckpointChecker == true } - assertFalse { configDebugOptions(true, DevModeOptions()).devModeOptions?.disableCheckpointChecker == true } - assertFalse { configDebugOptions(true, DevModeOptions(false)).devModeOptions?.disableCheckpointChecker == true } - assertTrue { configDebugOptions(true, DevModeOptions(true)).devModeOptions?.disableCheckpointChecker == true } + assertTrue { configDebugOptions(true, null).shouldCheckCheckpoints() } + assertTrue { configDebugOptions(true, DevModeOptions()).shouldCheckCheckpoints() } + assertTrue { configDebugOptions(true, DevModeOptions(false)).shouldCheckCheckpoints() } + assertFalse { configDebugOptions(true, DevModeOptions(true)).shouldCheckCheckpoints() } } private fun configDebugOptions(devMode: Boolean, devModeOptions: DevModeOptions?) : NodeConfiguration { From bad31658fb2e61333e49ea5f23d32622f8a600fc Mon Sep 17 00:00:00 2001 From: Christian Sailer Date: Mon, 30 Oct 2017 13:49:08 +0000 Subject: [PATCH 02/70] Fix whitespace --- .../kotlin/net/corda/node/services/config/NodeConfiguration.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/src/main/kotlin/net/corda/node/services/config/NodeConfiguration.kt b/node/src/main/kotlin/net/corda/node/services/config/NodeConfiguration.kt index 8423384d90..d46618e0ac 100644 --- a/node/src/main/kotlin/net/corda/node/services/config/NodeConfiguration.kt +++ b/node/src/main/kotlin/net/corda/node/services/config/NodeConfiguration.kt @@ -49,7 +49,7 @@ interface NodeConfiguration : NodeSSLConfiguration { val detectPublicIp: Boolean get() = true } -fun NodeConfiguration.shouldCheckCheckpoints(): Boolean{ +fun NodeConfiguration.shouldCheckCheckpoints(): Boolean { return this.devMode && this.devModeOptions?.disableCheckpointChecker != true } From 68481765e10b0e5a4212d06a8a55c459827684a4 Mon Sep 17 00:00:00 2001 From: Christian Sailer Date: Fri, 3 Nov 2017 16:16:23 +0000 Subject: [PATCH 03/70] Clean up build gradle files --- samples/irs-demo/build.gradle | 4 ---- samples/irs-demo/cordapp/build.gradle | 6 +++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/samples/irs-demo/build.gradle b/samples/irs-demo/build.gradle index 8a9ee0699e..5b5b51ecf9 100644 --- a/samples/irs-demo/build.gradle +++ b/samples/irs-demo/build.gradle @@ -21,10 +21,6 @@ apply plugin: 'kotlin' apply plugin: 'idea' apply plugin: 'org.springframework.boot' apply plugin: 'net.corda.plugins.quasar-utils' -apply plugin: 'net.corda.plugins.publish-utils' -apply plugin: 'net.corda.plugins.cordapp' -apply plugin: 'net.corda.plugins.cordformation' -apply plugin: 'maven-publish' apply plugin: 'application' mainClassName = 'net.corda.irs.IRSDemo' diff --git a/samples/irs-demo/cordapp/build.gradle b/samples/irs-demo/cordapp/build.gradle index 9edccf8968..74dfa92b45 100644 --- a/samples/irs-demo/cordapp/build.gradle +++ b/samples/irs-demo/cordapp/build.gradle @@ -61,7 +61,7 @@ task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) { notary = [validating : true] p2pPort 10002 rpcPort 10003 - cordapps = ["net.corda:finance:$corda_release_version"] + cordapps = ["${project.group}:finance:$corda_release_version"] rpcUsers = ext.rpcUsers useTestClock true } @@ -69,7 +69,7 @@ task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) { name "O=Bank A,L=London,C=GB" p2pPort 10005 rpcPort 10006 - cordapps = ["net.corda:finance:$corda_release_version"] + cordapps = ["${project.group}:finance:$corda_release_version"] rpcUsers = ext.rpcUsers useTestClock true } @@ -77,7 +77,7 @@ task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) { name "O=Bank B,L=New York,C=US" p2pPort 10008 rpcPort 10009 - cordapps = ["net.corda:finance:$corda_release_version"] + cordapps = ["${project.group}:finance:$corda_release_version"] rpcUsers = ext.rpcUsers useTestClock true } From 1b332e2cb34c8d78ae100d2d1cf550b8d10cb31b Mon Sep 17 00:00:00 2001 From: Christian Sailer Date: Mon, 6 Nov 2017 14:34:09 +0000 Subject: [PATCH 04/70] Add extra version pinning for spring.boot gradle plug-in --- samples/network-visualiser/build.gradle | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/samples/network-visualiser/build.gradle b/samples/network-visualiser/build.gradle index b5b20986d6..9767030c79 100644 --- a/samples/network-visualiser/build.gradle +++ b/samples/network-visualiser/build.gradle @@ -10,6 +10,14 @@ buildscript { } } +// Spring Boot plugin adds a numerous hardcoded dependencies in the version much lower then Corda expects +// causing the problems in runtime. Those can be changed by manipulating above properties +// See https://github.com/spring-gradle-plugins/dependency-management-plugin/blob/master/README.md#changing-the-value-of-a-version-property +// This has to be repeated here as otherwise the order of files does matter +ext['artemis.version'] = "$artemis_version" +ext['hibernate.version'] = "$hibernate_version" + + apply plugin: 'java' apply plugin: 'kotlin' apply plugin: 'idea' From 20a8ab5e775103597ac0d6e3dce2fd0dde1d964e Mon Sep 17 00:00:00 2001 From: Katelyn Baker Date: Mon, 6 Nov 2017 14:49:00 +0000 Subject: [PATCH 05/70] RELEASE - post 2.0 nump build no on master --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 224e4ba215..0743b5a5ee 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ buildscript { file("$projectDir/constants.properties").withInputStream { constants.load(it) } // Our version: bump this on release. - ext.corda_release_version = "2.0-SNAPSHOT" + ext.corda_release_version = "3.0-SNAPSHOT" // Increment this on any release that changes public APIs anywhere in the Corda platform // TODO This is going to be difficult until we have a clear separation throughout the code of what is public and what is internal ext.corda_platform_version = 1 From 4e1578c19a77942cf42a79edc89aa50d855f99e6 Mon Sep 17 00:00:00 2001 From: Konstantinos Chalkias Date: Mon, 6 Nov 2017 18:36:19 +0000 Subject: [PATCH 06/70] Remove retired IntegrationTestCategory reference (#2007) --- .../integration-test/kotlin/net/corda/vega/SimmValuationTest.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/samples/simm-valuation-demo/src/integration-test/kotlin/net/corda/vega/SimmValuationTest.kt b/samples/simm-valuation-demo/src/integration-test/kotlin/net/corda/vega/SimmValuationTest.kt index 6c9c6cff74..d09d8f5a8c 100644 --- a/samples/simm-valuation-demo/src/integration-test/kotlin/net/corda/vega/SimmValuationTest.kt +++ b/samples/simm-valuation-demo/src/integration-test/kotlin/net/corda/vega/SimmValuationTest.kt @@ -5,7 +5,6 @@ import net.corda.core.identity.CordaX500Name import net.corda.core.utilities.getOrThrow import net.corda.testing.DUMMY_BANK_A import net.corda.testing.DUMMY_BANK_B -import net.corda.testing.IntegrationTestCategory import net.corda.testing.driver.driver import net.corda.testing.http.HttpApi import net.corda.vega.api.PortfolioApi From a4be26a296cf9ca203974a28022ae37f554e9306 Mon Sep 17 00:00:00 2001 From: Shams Asari Date: Mon, 6 Nov 2017 21:28:20 +0000 Subject: [PATCH 07/70] Removed unnecessary calls to MockNetwork.runNetwork (b/c there is no more P2P node registration) and removed redundant entries in cordappPackages --- .../BankOfCordaDriverKt___Issue_Web.xml | 1 - .../BankOfCordaDriverKt___Run_Stack.xml | 1 - .idea/runConfigurations/Explorer___demo_nodes.xml | 1 - .../Explorer___demo_nodes__simulation_.xml | 1 - .../java/net/corda/core/flows/FlowsInJavaTest.java | 3 --- .../kotlin/net/corda/core/flows/AttachmentTests.kt | 7 ------- .../corda/core/flows/CollectSignaturesFlowTests.kt | 9 ++------- .../net/corda/core/flows/ContractUpgradeFlowTest.kt | 12 ++++-------- .../kotlin/net/corda/core/flows/FinalityFlowTests.kt | 1 - .../core/internal/ResolveTransactionsFlowTest.kt | 1 - .../serialization/AttachmentSerializationTest.kt | 1 - .../docs/tutorial/mocknetwork/TutorialMockNetwork.kt | 3 --- .../kotlin/net/corda/docs/CustomVaultQueryTest.kt | 10 +--------- .../net/corda/docs/FxTransactionBuildTutorialTest.kt | 4 +--- .../net/corda/finance/flows/CashExitFlowTests.kt | 2 -- .../net/corda/finance/flows/CashIssueFlowTests.kt | 1 - .../net/corda/finance/flows/CashPaymentFlowTests.kt | 1 - .../corda/node/messaging/TwoPartyTradeFlowTests.kt | 10 +--------- .../net/corda/node/services/NotaryChangeTests.kt | 1 - .../node/services/network/NetworkMapCacheTest.kt | 6 +----- .../node/services/schema/NodeSchemaServiceTest.kt | 1 - .../node/services/statemachine/FlowFrameworkTests.kt | 6 +----- .../node/services/transactions/NotaryServiceTests.kt | 1 - .../transactions/ValidatingNotaryServiceTests.kt | 1 - .../kotlin/net/corda/netmap/simulation/Simulation.kt | 2 +- 25 files changed, 12 insertions(+), 75 deletions(-) diff --git a/.idea/runConfigurations/BankOfCordaDriverKt___Issue_Web.xml b/.idea/runConfigurations/BankOfCordaDriverKt___Issue_Web.xml index b4b35f6ef4..321d3d2d06 100644 --- a/.idea/runConfigurations/BankOfCordaDriverKt___Issue_Web.xml +++ b/.idea/runConfigurations/BankOfCordaDriverKt___Issue_Web.xml @@ -1,7 +1,6 @@ -