From 84ff1c875a2d2f2a1a498847977cc08d65edc7e9 Mon Sep 17 00:00:00 2001 From: Shams Asari Date: Mon, 5 Mar 2018 17:26:08 +0000 Subject: [PATCH] CORDA-1006: Undoing the wiring of maxMessageSize as it's not correctly implemented and updating the docs to clarify its status. (#2501) (#2729) The network parameter was just fed into Artemis' minLargeMessageSize property which isn't the same thing. (cherry picked from commit 49f75da) --- docs/source/network-map.rst | 9 +++++- .../kotlin/net/corda/node/internal/Node.kt | 32 ++++++------------- 2 files changed, 18 insertions(+), 23 deletions(-) diff --git a/docs/source/network-map.rst b/docs/source/network-map.rst index 0e0b922b88..c5f83f7d29 100644 --- a/docs/source/network-map.rst +++ b/docs/source/network-map.rst @@ -99,13 +99,20 @@ The current set of network parameters: :minimumPlatformVersion: The minimum platform version that the nodes must be running. Any node which is below this will not start. + :notaries: List of identity and validation type (either validating or non-validating) of the notaries which are permitted in the compatibility zone. -:maxMessageSize: Maximum allowed size in bytes of an individual message sent over the wire. Note that attachments are + +:maxMessageSize: (This is currently ignored. However, it will be wired up in a future release.) + +.. TODO Replace the above with this once wired: Maximum allowed size in bytes of an individual message sent over the wire. Note that attachments are a special case and may be fragmented for streaming transfer, however, an individual transaction or flow message may not be larger than this value. + :maxTransactionSize: Maximum allowed size in bytes of a transaction. This is the size of the transaction object and its attachments. + :modifiedTime: The time when the network parameters were last modified by the compatibility zone operator. + :epoch: Version number of the network parameters. Starting from 1, this will always increment whenever any of the parameters change. :whitelistedContractImplementations: List of whitelisted versions of contract code. diff --git a/node/src/main/kotlin/net/corda/node/internal/Node.kt b/node/src/main/kotlin/net/corda/node/internal/Node.kt index dca482551a..6a3b71534f 100644 --- a/node/src/main/kotlin/net/corda/node/internal/Node.kt +++ b/node/src/main/kotlin/net/corda/node/internal/Node.kt @@ -92,6 +92,9 @@ open class Node(configuration: NodeConfiguration, CordappLoader.createDefaultWithTestPackages(configuration, scanPackages.split(scanPackagesSeparator)) } ?: CordappLoader.createDefault(configuration.baseDirectory) } + + // TODO Wire up maxMessageSize + const val MAX_FILE_SIZE = 10485760 } override val log: Logger get() = staticLog @@ -165,14 +168,14 @@ open class Node(configuration: NodeConfiguration, startLocalRpcBroker(networkParameters) } val advertisedAddress = info.addresses[0] - bridgeControlListener = BridgeControlListener(configuration, serverAddress, networkParameters.maxMessageSize) + bridgeControlListener = BridgeControlListener(configuration, serverAddress, /*networkParameters.maxMessageSize*/MAX_FILE_SIZE) printBasicNodeInfo("Advertised P2P messaging addresses", info.addresses.joinToString()) rpcServerAddresses?.let { - rpcMessagingClient = RPCMessagingClient(configuration.rpcOptions.sslConfig, it.admin, networkParameters.maxMessageSize) + rpcMessagingClient = RPCMessagingClient(configuration.rpcOptions.sslConfig, it.admin, /*networkParameters.maxMessageSize*/MAX_FILE_SIZE) } verifierMessagingClient = when (configuration.verifierType) { - VerifierType.OutOfProcess -> VerifierMessagingClient(configuration, serverAddress, services.monitoringService.metrics, networkParameters.maxMessageSize) + VerifierType.OutOfProcess -> VerifierMessagingClient(configuration, serverAddress, services.monitoringService.metrics, /*networkParameters.maxMessageSize*/MAX_FILE_SIZE) VerifierType.InMemory -> null } require(info.legalIdentities.size in 1..2) { "Currently nodes must have a primary address and optionally one serviced address" } @@ -187,7 +190,7 @@ open class Node(configuration: NodeConfiguration, database, services.networkMapCache, advertisedAddress, - networkParameters.maxMessageSize, + /*networkParameters.maxMessageSize*/MAX_FILE_SIZE, isDrainingModeOn = nodeProperties.flowsDrainingMode::isEnabled, drainingModeWasChangedEvents = nodeProperties.flowsDrainingMode.values) } @@ -199,24 +202,9 @@ open class Node(configuration: NodeConfiguration, val rpcBrokerDirectory: Path = baseDirectory / "brokers" / "rpc" with(rpcOptions) { rpcBroker = if (useSsl) { - ArtemisRpcBroker.withSsl( - this.address!!, - sslConfig, - securityManager, - certificateChainCheckPolicies, - networkParameters.maxMessageSize, - jmxMonitoringHttpPort != null, - rpcBrokerDirectory) + ArtemisRpcBroker.withSsl(this.address!!, sslConfig, securityManager, certificateChainCheckPolicies, /*networkParameters.maxMessageSize*/MAX_FILE_SIZE, jmxMonitoringHttpPort != null, rpcBrokerDirectory) } else { - ArtemisRpcBroker.withoutSsl( - this.address!!, - adminAddress!!, - sslConfig, - securityManager, - certificateChainCheckPolicies, - networkParameters.maxMessageSize, - jmxMonitoringHttpPort != null, - rpcBrokerDirectory) + ArtemisRpcBroker.withoutSsl(this.address!!, adminAddress!!, sslConfig, securityManager, certificateChainCheckPolicies, /*networkParameters.maxMessageSize*/MAX_FILE_SIZE, jmxMonitoringHttpPort != null, rpcBrokerDirectory) } } return rpcBroker!!.addresses @@ -226,7 +214,7 @@ open class Node(configuration: NodeConfiguration, private fun makeLocalMessageBroker(networkParameters: NetworkParameters): NetworkHostAndPort { with(configuration) { - messageBroker = ArtemisMessagingServer(this, p2pAddress.port, networkParameters.maxMessageSize) + messageBroker = ArtemisMessagingServer(this, p2pAddress.port, /*networkParameters.maxMessageSize*/MAX_FILE_SIZE) return NetworkHostAndPort("localhost", p2pAddress.port) } }