diff --git a/core/src/main/kotlin/net/corda/core/node/NetworkParameters.kt b/core/src/main/kotlin/net/corda/core/node/NetworkParameters.kt index cca7c1433b..f2d16c20fb 100644 --- a/core/src/main/kotlin/net/corda/core/node/NetworkParameters.kt +++ b/core/src/main/kotlin/net/corda/core/node/NetworkParameters.kt @@ -9,7 +9,7 @@ import java.time.Instant * correctly interoperate with each other. * @property minimumPlatformVersion Minimum version of Corda platform that is required for nodes in the network. * @property notaries List of well known and trusted notary identities with information on validation type. - * @property maxMessageSize Maximum P2P message sent over the wire in bytes. + * @property maxMessageSize This is currently ignored. However, it will be wired up in a future release. * @property maxTransactionSize Maximum permitted transaction size in bytes. * @property modifiedTime Last modification time of network parameters set. * @property epoch Version number of the network parameters. Starting from 1, this will always increment on each new set diff --git a/docs/source/network-map.rst b/docs/source/network-map.rst index 7ec1d0e53c..efd4276065 100644 --- a/docs/source/network-map.rst +++ b/docs/source/network-map.rst @@ -66,13 +66,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. 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 910c454e74..fd6d106f90 100644 --- a/node/src/main/kotlin/net/corda/node/internal/Node.kt +++ b/node/src/main/kotlin/net/corda/node/internal/Node.kt @@ -2,7 +2,6 @@ package net.corda.node.internal import com.codahale.metrics.JmxReporter import net.corda.core.concurrent.CordaFuture -import net.corda.core.internal.GlobalProperties.networkParameters import net.corda.core.internal.concurrent.openFuture import net.corda.core.internal.concurrent.thenMatch import net.corda.core.internal.div @@ -90,6 +89,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 @@ -156,14 +158,14 @@ open class Node(configuration: NodeConfiguration, val serverAddress = configuration.messagingServerAddress ?: makeLocalMessageBroker() val rpcServerAddresses = if (configuration.rpcOptions.standAloneBroker) BrokerAddresses(configuration.rpcOptions.address!!, configuration.rpcOptions.adminAddress) else startLocalRpcBroker() val advertisedAddress = info.addresses.single() - bridgeControlListener = BridgeControlListener(configuration, serverAddress, networkParameters.maxMessageSize) + bridgeControlListener = BridgeControlListener(configuration, serverAddress, /*networkParameters.maxMessageSize*/MAX_FILE_SIZE) printBasicNodeInfo("Incoming connection address", advertisedAddress.toString()) 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" } @@ -178,7 +180,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) } @@ -190,9 +192,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, exportJMXto.isNotEmpty(), rpcBrokerDirectory) + ArtemisRpcBroker.withSsl(this.address!!, sslConfig, securityManager, certificateChainCheckPolicies, /*networkParameters.maxMessageSize*/MAX_FILE_SIZE, exportJMXto.isNotEmpty(), rpcBrokerDirectory) } else { - ArtemisRpcBroker.withoutSsl(this.address!!, adminAddress!!, sslConfig, securityManager, certificateChainCheckPolicies, networkParameters.maxMessageSize, exportJMXto.isNotEmpty(), rpcBrokerDirectory) + ArtemisRpcBroker.withoutSsl(this.address!!, adminAddress!!, sslConfig, securityManager, certificateChainCheckPolicies, /*networkParameters.maxMessageSize*/MAX_FILE_SIZE, exportJMXto.isNotEmpty(), rpcBrokerDirectory) } } return rpcBroker!!.addresses @@ -202,7 +204,7 @@ open class Node(configuration: NodeConfiguration, private fun makeLocalMessageBroker(): 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) } }