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)
This commit is contained in:
Shams Asari 2018-03-05 17:26:08 +00:00 committed by GitHub
parent 382b424810
commit 84ff1c875a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 23 deletions

View File

@ -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.

View File

@ -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)
}
}