mirror of
https://github.com/corda/corda.git
synced 2024-12-18 20:47:57 +00:00
ENT-12491: Commands were being deserialized in captured serialisation… (#7887)
* ENT-12491: Commands were being deserialized in captured serialisation context which did not include the serialisation context with attachments class loader. Now make the deserialisation lazy. * ENT-12491: Disable carpenter in the external verifier.
This commit is contained in:
parent
8ebf4ad835
commit
0322b8c6ce
@ -28,6 +28,7 @@ import net.corda.core.internal.SerializedStateAndRef
|
|||||||
import net.corda.core.internal.SerializedTransactionState
|
import net.corda.core.internal.SerializedTransactionState
|
||||||
import net.corda.core.internal.TransactionDeserialisationException
|
import net.corda.core.internal.TransactionDeserialisationException
|
||||||
import net.corda.core.internal.createComponentGroups
|
import net.corda.core.internal.createComponentGroups
|
||||||
|
import net.corda.core.internal.deserialiseCommands
|
||||||
import net.corda.core.internal.deserialiseComponentGroup
|
import net.corda.core.internal.deserialiseComponentGroup
|
||||||
import net.corda.core.internal.equivalent
|
import net.corda.core.internal.equivalent
|
||||||
import net.corda.core.internal.getGroup
|
import net.corda.core.internal.getGroup
|
||||||
@ -196,10 +197,15 @@ class WireTransaction(componentGroups: List<ComponentGroup>, val privacySalt: Pr
|
|||||||
verificationSupport.getParties(signersGroup.flatten().toSet())
|
verificationSupport.getParties(signersGroup.flatten().toSet())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val authenticatedCommands = commands.lazyMapped { cmd, _ ->
|
|
||||||
val parties = verificationSupport.getParties(cmd.signers).filterNotNull()
|
val lazyCommands: List<Command<*>> by lazy { deserialiseCommands(componentGroups, digestService = digestService) }
|
||||||
CommandWithParties(cmd.signers, parties, cmd.value)
|
val commandsComponentGroup = componentGroups.getGroup(COMMANDS_GROUP)
|
||||||
}
|
val commandComponents = commandsComponentGroup?.components ?: emptyList()
|
||||||
|
val authenticatedCommands = commandComponents.lazyMapped { _, index ->
|
||||||
|
val cmd = lazyCommands[index]
|
||||||
|
val parties = verificationSupport.getParties(cmd.signers).filterNotNull()
|
||||||
|
CommandWithParties(cmd.signers, parties, cmd.value)
|
||||||
|
}
|
||||||
|
|
||||||
// Ensure that the lazy mappings will use the correct SerializationContext.
|
// Ensure that the lazy mappings will use the correct SerializationContext.
|
||||||
val serializationFactory = SerializationFactory.defaultFactory
|
val serializationFactory = SerializationFactory.defaultFactory
|
||||||
|
@ -87,7 +87,7 @@ class ExternalVerifier(private val channel: SocketChannel) {
|
|||||||
// Use a preliminary serialization context to receive the initialisation message
|
// Use a preliminary serialization context to receive the initialisation message
|
||||||
_contextSerializationEnv.set(SerializationEnvironment.with(
|
_contextSerializationEnv.set(SerializationEnvironment.with(
|
||||||
verifierSerializationFactory(),
|
verifierSerializationFactory(),
|
||||||
p2pContext = AMQP_P2P_CONTEXT
|
p2pContext = AMQP_P2P_CONTEXT.withoutCarpenter()
|
||||||
))
|
))
|
||||||
|
|
||||||
log.info("Waiting for initialisation message from node...")
|
log.info("Waiting for initialisation message from node...")
|
||||||
|
Loading…
Reference in New Issue
Block a user