mirror of
https://github.com/corda/corda.git
synced 2025-01-28 23:24:29 +00:00
Pre-generate Corda classes for DJVM sandbox when node boots in production mode.
This commit is contained in:
parent
f208b054c3
commit
7b349ad049
@ -56,6 +56,7 @@ task patchCore(type: Zip, dependsOn: coreJarTask) {
|
|||||||
archiveExtension = 'jar'
|
archiveExtension = 'jar'
|
||||||
|
|
||||||
from(compileKotlin)
|
from(compileKotlin)
|
||||||
|
from(processResources)
|
||||||
from(zipTree(originalJar)) {
|
from(zipTree(originalJar)) {
|
||||||
exclude 'net/corda/core/internal/*ToggleField*.class'
|
exclude 'net/corda/core/internal/*ToggleField*.class'
|
||||||
exclude 'net/corda/core/serialization/*SerializationFactory*.class'
|
exclude 'net/corda/core/serialization/*SerializationFactory*.class'
|
||||||
|
0
node/djvm/src/main/resources/META-INF/DJVM-preload
Normal file
0
node/djvm/src/main/resources/META-INF/DJVM-preload
Normal file
@ -216,7 +216,13 @@ abstract class AbstractNode<S>(val configuration: NodeConfiguration,
|
|||||||
@Suppress("LeakingThis")
|
@Suppress("LeakingThis")
|
||||||
val transactionVerifierService = InMemoryTransactionVerifierService(transactionVerifierWorkerCount).tokenize()
|
val transactionVerifierService = InMemoryTransactionVerifierService(transactionVerifierWorkerCount).tokenize()
|
||||||
val verifierFactoryService: VerifierFactoryService = if (djvmCordaSource != null) {
|
val verifierFactoryService: VerifierFactoryService = if (djvmCordaSource != null) {
|
||||||
DeterministicVerifierFactoryService(djvmBootstrapSource, djvmCordaSource).tokenize()
|
DeterministicVerifierFactoryService(djvmBootstrapSource, djvmCordaSource).apply {
|
||||||
|
if (!configuration.devMode) {
|
||||||
|
log.info("Generating Corda classes for DJVM sandbox.")
|
||||||
|
generateSandbox()
|
||||||
|
}
|
||||||
|
tokenize()
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
BasicVerifierFactoryService()
|
BasicVerifierFactoryService()
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,14 @@ class DeterministicVerifierFactoryService(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate sandbox classes for every Corda jar with META-INF/DJVM-preload.
|
||||||
|
*/
|
||||||
|
fun generateSandbox(): DeterministicVerifierFactoryService {
|
||||||
|
baseSandboxConfiguration.preload()
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
override fun apply(ledgerTransaction: LedgerTransaction): LedgerTransaction {
|
override fun apply(ledgerTransaction: LedgerTransaction): LedgerTransaction {
|
||||||
// Specialise the LedgerTransaction here so that
|
// Specialise the LedgerTransaction here so that
|
||||||
// contracts are verified inside the DJVM!
|
// contracts are verified inside the DJVM!
|
||||||
|
@ -54,6 +54,7 @@ task patchSerialization(type: Zip, dependsOn: serializationJarTask) {
|
|||||||
archiveExtension = 'jar'
|
archiveExtension = 'jar'
|
||||||
|
|
||||||
from(compileKotlin)
|
from(compileKotlin)
|
||||||
|
from(processResources)
|
||||||
from(zipTree(originalJar)) {
|
from(zipTree(originalJar)) {
|
||||||
exclude 'net/corda/serialization/internal/AttachmentsClassLoaderBuilder*'
|
exclude 'net/corda/serialization/internal/AttachmentsClassLoaderBuilder*'
|
||||||
exclude 'net/corda/serialization/internal/ByteBufferStreams*'
|
exclude 'net/corda/serialization/internal/ByteBufferStreams*'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user