mirror of
https://github.com/corda/corda.git
synced 2025-06-15 13:48:14 +00:00
CORDA-2187 & CORDA-2038: reverting maxTransactionSize <= maxMessageSize (#4166)
* CORDA-2187 reverting maxTransactionSize <= maxMessageSize * Addressing review comments * Increasing the maxTransactionSize for the Bootstrapper * Updating the testNetworkParameters
This commit is contained in:
@ -86,7 +86,6 @@ data class NetworkParameters(
|
|||||||
require(epoch > 0) { "epoch must be at least 1" }
|
require(epoch > 0) { "epoch must be at least 1" }
|
||||||
require(maxMessageSize > 0) { "maxMessageSize must be at least 1" }
|
require(maxMessageSize > 0) { "maxMessageSize must be at least 1" }
|
||||||
require(maxTransactionSize > 0) { "maxTransactionSize must be at least 1" }
|
require(maxTransactionSize > 0) { "maxTransactionSize must be at least 1" }
|
||||||
require(maxTransactionSize <= maxMessageSize) { "maxTransactionSize cannot be bigger than maxMessageSize" }
|
|
||||||
require(!eventHorizon.isNegative) { "eventHorizon must be positive value" }
|
require(!eventHorizon.isNegative) { "eventHorizon must be positive value" }
|
||||||
require(noOverlap(packageOwnership.keys)) { "multiple packages added to the packageOwnership overlap." }
|
require(noOverlap(packageOwnership.keys)) { "multiple packages added to the packageOwnership overlap." }
|
||||||
}
|
}
|
||||||
|
@ -394,7 +394,7 @@ internal constructor(private val initSerEnv: Boolean,
|
|||||||
notaries = notaryInfos,
|
notaries = notaryInfos,
|
||||||
modifiedTime = Instant.now(),
|
modifiedTime = Instant.now(),
|
||||||
maxMessageSize = 10485760,
|
maxMessageSize = 10485760,
|
||||||
maxTransactionSize = 10485760,
|
maxTransactionSize = 524288000,
|
||||||
whitelistedContractImplementations = whitelist,
|
whitelistedContractImplementations = whitelist,
|
||||||
packageOwnership = packageOwnership.filterNotNullValues(),
|
packageOwnership = packageOwnership.filterNotNullValues(),
|
||||||
epoch = 1,
|
epoch = 1,
|
||||||
|
@ -76,19 +76,6 @@ class NetworkParametersTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
fun `maxTransactionSize must be bigger than maxMesssageSize`() {
|
|
||||||
assertThatExceptionOfType(IllegalArgumentException::class.java).isThrownBy {
|
|
||||||
NetworkParameters(1,
|
|
||||||
emptyList(),
|
|
||||||
2000,
|
|
||||||
2001,
|
|
||||||
Instant.now(),
|
|
||||||
1,
|
|
||||||
emptyMap())
|
|
||||||
}.withMessage("maxTransactionSize cannot be bigger than maxMessageSize")
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `package ownership checks are correct`() {
|
fun `package ownership checks are correct`() {
|
||||||
val key1 = generateKeyPair().public
|
val key1 = generateKeyPair().public
|
||||||
|
@ -13,7 +13,7 @@ fun testNetworkParameters(
|
|||||||
modifiedTime: Instant = Instant.now(),
|
modifiedTime: Instant = Instant.now(),
|
||||||
maxMessageSize: Int = 10485760,
|
maxMessageSize: Int = 10485760,
|
||||||
// TODO: Make this configurable and consistence across driver, bootstrapper, demobench and NetworkMapServer
|
// TODO: Make this configurable and consistence across driver, bootstrapper, demobench and NetworkMapServer
|
||||||
maxTransactionSize: Int = maxMessageSize,
|
maxTransactionSize: Int = maxMessageSize * 50,
|
||||||
whitelistedContractImplementations: Map<String, List<AttachmentId>> = emptyMap(),
|
whitelistedContractImplementations: Map<String, List<AttachmentId>> = emptyMap(),
|
||||||
epoch: Int = 1,
|
epoch: Int = 1,
|
||||||
eventHorizon: Duration = 30.days
|
eventHorizon: Duration = 30.days
|
||||||
|
Reference in New Issue
Block a user