Commit Graph

3333 Commits

Author SHA1 Message Date
Adel El-Beik
6e3374c2c8
Merge pull request #7686 from corda/shams-legacy-contract-deps
ENT-11445: Support legacy contract CorDapp dependencies
2024-03-20 12:10:35 +00:00
Adel El-Beik
0849f91d45
Merge pull request #7695 from corda/shams-eddsa-service-keys
ENT-11662: Use EdDSA when generating notary service identities
2024-03-20 12:10:10 +00:00
Adel El-Beik
17bab482ad
Merge pull request #7696 from corda/shams-unused-test-jars
ENT-11095: Delete test resources which are no longer used
2024-03-20 12:09:40 +00:00
Adel El-Beik
4f4a6fbcf0
Merge pull request #7690 from corda/merge-release/os/4.11-release/os/4.12-2024-03-14-174
ENT-11620: Merging forward updates from release/os/4.11 to release/os/4.12 - 2024-03-14
2024-03-19 14:35:43 +00:00
Shams Asari
1c5b216ed8 ENT-11095: Delete test resource jars which are no longer used 2024-03-19 11:28:03 +00:00
Shams Asari
e860c67086 ENT-11662: Using EdDSA keys when generating notary servive identities
It was previously generating TLS keys, which seems to have been an oversight.

Using EdDSA also has a slight performance edge, as there's some mutex contention when ECDSA keys are used.
2024-03-19 10:12:10 +00:00
Shams Asari
9d57caebed ENT-11661: Replaced SunEC Ed25519 implementation with Bouncy Castle
It turns out the JDK implementation (`SunEC` provider) of Ed25519 signature verification is quite slow, slower than the abandoned library (i2p) it replaced. This has been replaced by Bouncy Castle, whereby the `EDDSA_ED25519_SHA512` signature scheme uses it. `SunEC` still remains the default implementation. `Crypto.toSupportedPublicKey` (and `toSupportedPrivateKey`) were tweaked to make sure any `SunEC` keys are converted to Bouncy Castle. The presence of two different `EdECPublicKey` implementations for the same key causes cache misses in `BasicHSMKeyManagementService`, resulting in another performance degradation.
2024-03-19 07:48:22 +00:00
Adel El-Beik
8c90524fdf ENT-11620: Removed unused import. 2024-03-15 11:29:18 +00:00
Adel El-Beik
2bcb2ba945 ENT-11620: Fixed to work with 4.12 class heirarchy. 2024-03-15 11:10:19 +00:00
r3-build
352931179a Merging forward updates from release/os/4.11 to release/os/4.12 - 2024-03-14 2024-03-14 11:45:48 +00:00
r3-build
121ec42d6c Merging forward updates from release/os/4.10 to release/os/4.11 - 2024-03-13 2024-03-13 17:23:47 +00:00
Adel El-Beik
7946958804
Merge pull request #7687 from corda/cc/dev/os/4.12/ent-11514/add_opens
ENT-11514 - More --add-opens JVM args
2024-03-13 11:06:51 +00:00
Adel El-Beik
99faeaf667 ENT-11620: Set the thread context class loader so all fibres involved in a flow has the thread context class loader set to the app class loader. 2024-03-13 11:01:41 +00:00
Shams Asari
b3265314ce ENT-11445: Support legacy contract CorDapp dependencies
The `TransactionBuilder` has been updated to look for any missing dependencies to legacy contract attachments, in the same way it does for missing dependencies for CorDapps in the "cordapps" directory,

Since `TransactionBuilder` does verification on the `WireTransaction` and not a `SignedTransaction`, much of the verification logic in `SignedTransaction` had to moved to `WireTransaction` to allow the external verifier to be involved. The external verifier receives a `CoreTransaction` to verify instead of a `SignedTransaction`. `SignedTransaction.verify` does the signature checks first in-process, before then delegating the reset of the verification to the `CoreTransaction`.

A legacy contract dependency is defined as an attachment containing the missing class which isn't also a non-legacy Cordapp (i.e. a CorDapp which isn't in the "cordapp" directory).
2024-03-13 10:58:11 +00:00
Chris Cochrane
ea93a5f560
Extra add-opens to support corda-shell 2024-03-12 15:45:19 +00:00
Adel El-Beik
54135a26c9
Merge pull request #7680 from corda/shams-cleanup-jdk-8-11
ENT-11090: Removed all JDK 8/11 conditional code
2024-03-07 20:03:20 +00:00
Adel El-Beik
5c9164c94a ENT-11501: Re initialise the logging, after system property set. 2024-03-05 19:40:14 +00:00
Shams Asari
900809b3d7 ENT-11090: Removed all JDK 8/11 conditional code 2024-03-05 17:10:26 +00:00
Shams Asari
0091807c2f ENT-11101: Fix all crypto issues introduced by Java 17 upgrade
The various crypto tests that were previously ignored have been re-enabled.

The abandoned i2p EdDSA library has been replaced with native support that was added in Java 15.

Java 17 (via the `SunEC` provider) does not support the secp256k1 curve (one of the two ECDSA curves supported in Corda). This would not normally have been an issue as secp256k1 is already taken care of by Bouncy Castle. However, this only works if the `Crypto` API is used or if `”BC”` is explicitly specified as the provider (e.g. `Signature.getInstance(“SHA256withECDSA”, “BC”)`). If no provider is specified, which is what is more common, and actually what the Java docs recommend, then this doesn’t work as the `SunEC` provider is selected. To resolve this, a custom provider was created, installed just in front of `SunEC`, which “augments” `SunEC` by delegating to Bouncy Castle if keys or parameters for secp256k1 are encountered.

`X509Utilities.createCertificate` now calls `X509Certificate.verify()` to verify the created certificate, rather than using the Bouncy Castle API. This is more representative of how certificates will be verified (e.g. during SSL handshake) and weeds out other issues (such as unsupported curve error for secp256k1).

`BCCryptoService` has been renamed to `DefaultCryptoService` as it no longer explicitly uses Bouncy Castle but rather uses the installed security providers. This was done to fix a failing test. Further, `BCCryptoService` was already relying on the installed providers in some places.

The hack to get Corda `SecureRandom` working was also resolved. Also, as an added bonus, tests which ignored `SPHINCS256_SHA256` have been reinstated.

Note, there is a slightly inconsistency between how EdDSA and ECDSA keys are handled (and also RSA). For the later, Bouncy Castle is preferred, and methods such as `toSupportedKey*` will convert any JDK class to Bouncy Castle. For EdDSA the preference is the JDK (`SunEC`). However, this is simply a continuation of the previous preference of the i2p library over Bouncy Castle.
2024-03-04 13:29:49 +00:00
Adel El-Beik
6dfbed572e
ENT-11522: Unignored flow tests and updated artemis mq filter to check for null property. (#7679) 2024-03-04 12:25:37 +00:00
Adel El-Beik
4031c28947
ENT-11502: Upgrade platform version to 140. (#7674) 2024-03-04 12:24:15 +00:00
Adel El-Beik
0000c75391 ENT-11504: Bind to the same address that the server socket created. 2024-02-22 12:52:11 +00:00
Shams Asari
200333b198 ENT-11355: Backwards compatibility with older nodes via new attachments component group 2024-02-19 17:19:49 +00:00
Shams Asari
8fd3139df1 ENT-11355: Cleanup of TransactionBuilder and CorDapp loading
This is code refactoring and cleanup that is required to add a new WireTransaction component group for 4.12+ attachments, and for supporting legacy (4.11 or older) contract CorDapps in the node.
2024-02-12 14:27:07 +00:00
Chris Cochrane
c7514e1c60
ENT-11443 Function sig changes to support removing enterprise compiler warnings (#7671) 2024-02-07 14:46:18 +00:00
Suhas Krishna Srivastava
a95b854b1e
ENT-11386: Using NodeAttachmentService instead of fat interface ServiceHub. (#7670) 2024-02-01 11:49:52 +00:00
Chris Cochrane
9b794795a0
ENT-11351 - Compiler warnings pass 4 (#7663)
* Compiler warnings

* Resolve detekt errors

* Reverted code change; added warning suppression

* Address PR review comments
2024-01-29 13:49:00 +00:00
Shams Asari
a7d0684fe7
ENT-11384: Cleanup JarScanningCordappLoader (#7664)
* It uses URLs when in fact CorDapps are jar files, and so should being Path. It also does URL equality, which is not recommended
* Address (very old) TODO of removing RestrictedURL, which is not needed

Also, back-ported some minor changes from https://github.com/corda/enterprise/pull/5057.
2024-01-29 13:44:14 +00:00
Adel El-Beik
d642ebfbd7
Merge pull request #7662 from corda/arshadm/ent-6914-disable-node-metadata
ENT-6914 Disabled module metadata generation for the node capsule
2024-01-25 14:10:38 +00:00
Shams Asari
63f8e220c8
ENT-11251: Upgrade to Kotlin language version 1.9 (#7660) 2024-01-25 13:51:19 +00:00
Arshad Mahmood
4ea42c4d75 ENT-6914 Disabled module metadata generation for the node capsule as it was generating invalid json 2024-01-25 12:11:47 +00:00
Chris Cochrane
975500d878
ENT-11351 - Compiler warnings pass 3 (#7659)
* More compiler warnings fixed

* Amended deprecation suppression annotations, as per review comments
2024-01-25 10:18:58 +00:00
Adel El-Beik
3abb218bca
Merge pull request #7654 from corda/shams-external-verifier-analyse-txs
ENT-11255: Scan attachments to determine if they are Kotlin 1.2 or later
2024-01-23 16:56:47 +00:00
Chris Cochrane
f15e6ec56a
ENT-11351 - Compiler warnings pass 2 (#7655)
* Addressed compiler warnings

* Removed unchecked cast fixes - not for this PR

* Sorted out detekt issues
2024-01-23 10:19:03 +00:00
Shams Asari
f30ba33929 ENT-11255: Scan attachments to determine if they are Kotlin 1.2 or later
The node now sends a transaction to the verifier if any of its attachments were compiled with Kotlin 1.2 (the net.corda.node.verification.external system property has been removed). It uses kotlinx-metadata to read the Kotlin metadata in the attachment to determine this. For now this scanning is done each time the attachment is loaded from the database.

The existing external verification integration tests were converted into smoke tests so that 4.11 nodes could be involved. This required various improvements to NodeProcess.Factory. A new JAVA_8_HOME environment variable, pointing to JDK 8, is required to run these tests.

There is still some follow-up work that needs to be done:

Sending transactions from a 4.11 node to a 4.12 node works, but not the other way round. A new WireTransaction component group needs to be introduced for storing 4.12 attachments so that they can be safely ignored by 4.11 nodes, and the 4.12 node needs to be able to load both 4.11 and 4.12 versions of the same contracts CorDapp so that they can be both attached to the transaction.
Even though attachments are cached when retrieved from the database, the Kotlin metadata version should be stored in the attachments db table, rather than being scanned each time.
Finally, VerificationService was refactored into NodeVerificationSupport and can be passed into SignedTransaction.verifyInternal, instead of needing the much heavier VerifyingServiceHub. This makes it easier for internal tools to verify transactions and spawn the verifier if necessary.
2024-01-22 11:31:51 +00:00
Arshad Mahmood
e5355d9e75 ENT-6914 Fix generated pom 2024-01-22 10:22:08 +00:00
Chris Cochrane
1ff853b421
ENT-11351 - Compiler warnings pass 1 (#7652)
* Removed warnings - pass 1

* Resolve detekt errors

* Properly compare X500 distinguished names
2024-01-19 10:26:50 +00:00
Balwant Kothari
795e61807d
ENT-11113 Fixed review comments 2024-01-18 00:34:59 +05:30
Balwant Kothari
13e13fd236
ENT-11113 Updating test case to user overrridden Sysout instead of mock 2024-01-18 00:15:46 +05:30
Balwant Kothari
49f35aa5ea
ENT-11113 Updating test case for accessing modifier as per JDK17 compatibility 2024-01-15 15:26:10 +05:30
Adel El-Beik
d9e0172bf7
Merge pull request #7643 from corda/bk/os_fixes_412
ENT-11113 Update instant time resolution in test cases
2024-01-12 18:26:25 +00:00
Balwant Kothari
22e96f1bda
ENT-11113 Instant default time resolution is nano but HashedDistributionList.PublicHeader default derialisation happens at millis resolution to passing time in millis resolution as input 2024-01-11 18:15:19 +05:30
Shams Asari
ccc605493d WIP 2024-01-10 10:47:32 +00:00
Shams Asari
2e63ca6264
ENT-11065: Remove the need for JVM flags in client code (#7635) 2024-01-03 11:22:03 +00:00
Shams Asari
406f7ff292
ENT-11056: Compile the external verifier using Kotlin 1.2 (#7622)
This requires Kotlin 1.2 versions of core and serialization (core-1.2 and serialization-1.2 respectively), which are just "shell" modules and which compile the existing source code with Kotlin 1.2. The 1.2 plugin does not work with the current version of Gradle and so the 1.2 compiler has to be called directly.

Now with two versions of Kotlin in the code base, each module needs to have its version manually specified to ensure a clean separation. Otherwise, the default Kotlin version can override 1.2 when needed.

Some of the code was tidied-up or improved to enable it to be cross-compiled. For post-1.2 APIs being used, they have been copied into core-1.2 with the same method signatures. OpenTelemetryComponent was moved to node-api, along with the dependency, to avoid also having a 1.2 version for the opentelemetry module.
2024-01-02 17:02:20 +00:00
Adel El-Beik
4791f0d84f
Merge pull request #7630 from corda/merge-release/os/4.11-release/os/4.12-2023-12-21-86
ENT-11118: Merging forward updates from release/os/4.11 to release/os/4.12 - 2023-12-21
2023-12-22 12:23:02 +00:00
Arshad Mahmood
26861ffd05 ENT-11295 ActiveMQ behaviour has changed so that CREATE_ADDRESS is perforned before CREATE_DURABLE_QUEUE in this situation 2023-12-21 15:03:09 +00:00
Balwant Kothari
d235e887fe
ENT-11113 Ignored JDK 17 related fixes for byteman related issues (#7626)
* Updated mockito version and removed ignored annotation to relevant test cases
2023-12-21 11:11:55 +00:00
r3-build
2eb1e9f426 Merging forward updates from release/os/4.11 to release/os/4.12 - 2023-12-21 2023-12-21 03:50:35 +00:00
Adel El-Beik
e815b381ef
Merge pull request #7617 from corda/merge-release/os/4.11-release/os/4.12-2023-12-15-79
ENT-11281: Merging forward updates from release/os/4.11 to release/os/4.12 - 2023-12-15
2023-12-19 13:15:51 +00:00