* CORDA-2870 Add `reason` and `remedy` to `LocalTypeInformation.NonComposable`
When creating `LocalTypeInformation.NonComposable` pass in the `reason`
a type was not composable and the `remedy` to fix it. This required
changes in `LocalTypeInformationBuilder` to pass in this extra
information so that it can be used later.
The message that the `ObjectSerializer` includes in its
`NotSerializableException` now includes the extra information about the
non composable type.
* CORDA-2870 Include custom serializers in serialization error message
In `ObjectSerializer`, when a serialization exception is thrown,
include the registered custom serializers + their classloaders as part
of the error message.
This required making properties on `CustomSerializerRegistry` and
`LocalSerializerFactory` public.
Tidy up `LocalTypeInformationBuilder` error message text for
transitive non-composable types.
* CORDA-2870 Tidy up error thrown for unserializable objects
Fix `DeserializeSimpleTypesTests` and tidy up the code in
`ObjectSerializer` a bit.
* CORDA-2870 Remove non-composable warning logs in `LocalTypeInformationBuilder`
The flag `warnIfNonComposable` and its corresponding log lines are not
needed now that the non-composable error messages contain a lot of
information in them.
The `warnIfNonComposable` flag is now incorrect and has been renamed to
`validateProperties` and the function `suppressWarningsAnd` has been
changed to `suppressValidation`.
`propertyDescriptors` has also had its input boolean changed to
`validateProperties` to better represent what it is doing.
* CORDA-2870 Remove need for casting by moving variable to interface
Expose `customSerializerNames` in `LocalSerializerFactory` and
`CustomSerializerFactory`.
This allows a different signed version of the same CorDapp to be automatically trusted.
This reverts "[CORDA-2575] Allow users to whitelist attachments by public key config (#5035)"
* CORDA-2860 relax property type checking
* Remove redundant check
* Unit test
* Comment linking ticket to test
* More descriptive comment
* Fix test that was broken by jacocoData field being silently added to class
* Revert to previous behaviour around opaques, suppress validation
* CORDA-2860 relax property type checking
* Remove redundant check
* Unit test
* Comment linking ticket to test
* More descriptive comment
* Fix test that was broken by jacocoData field being silently added to class
* Revert to previous behaviour around opaques, suppress validation
* Tests for custom registry restrictions
* ENT-3121 restrict custom serialisation
* Remove redundant code
* Only count declared annotations
* Check annotation on superclasses, remove annotation from ByteArray
* Forbid custom serialization of primitive types
* Remove @CordaSerializable from another class that is always handled by custom serialisation
* Add log warnings to aid diagnosis of custom serialization issues
* Remove another annotation
* Remove another annotation
* Remove another annotation
* Remove another annotation
* Fixup api-current
* Fixup api-current
* KDocs on exceptions
* CORDA-2782 Add Comparable to default whitelist for vault query criteria using comparables
* Commit the java.lang.Comparable type.
* Fix broken unit test in serialization-deterministic
* CORDA-2688 - Add Serialization Context option for no carpenting
Can be used by the attachment class loader - Serialization Framework
will still consume all Exceptions and throw a NotSerializableException
* Fix tests
CORDA-2595 - Fix test and api.
CORDA-2595 add test
CORDA-2595 fix tests
CORDA-2595 fix test and address code review comments
CORDA-2595 address code review comments
Previous implementation was in LedgerTransaction and focused only on contract classes,
but every package matters.
Also fixes some exception types and does misc refactorings.
* Start pooling classpath scanning
Quickly patch synchronisation of attachment class loader cache. Needs a revisit but more complicated due to DJVM.
Annotate away for DJVM
Take ClassGraph utils into their own file so we can exclude for DJVM
Clean up a little
* Daemonize the threads
* Seems to be some concurrency problems with use of ClassGraph. Using a mutex for now to work around.
There were two issues:
* The original "sealing violation: can't seal package net.corda.nodeapi" issue was due to the isolated CorDapp containing some code in the net.corda.nodeapi namespace. This has been moved to the isolated namespace.
* The test was not correctly creating the second transaction with the dummy command
* Add whitelists and custom serializers from cordapps to serialization context
* Remove changes in TransactionBuilder, add caching
* Add whitelists and custom serializers from cordapps to serialization context
* Remove changes in TransactionBuilder, add caching
* Address comments
* Increase node memory for SIMM integration test
* Cache only serialization context
* Increase integ test timeout
* Fix API breakage
* Increase max heap size for web server integ test
* Move classloading utils from separate module to core.internal
* Adjust heap size for more integ tests
* Increase time window for IRS demo transactions
* Fix determinator
* Add parameter in core-deterministic
* Stub out class-loading method for DJVM
* Fixed incorrect attachment loading integration test
`AttachmentLoadingTests.test that attachments retrieved over the network are not used for code` was a false-positive - it was incorrect on multiple levels. Fixing it required updating the finance:isolated CorDapp, at which point it was given the new MANIFEST metadata for V4, and moved out of the net.corda.finance namespace to avoid package sealing issues.
The new test exposed a bug in the LedgerTransaction verification logic. This was cleaned up as it was too easy to verify on the wrong instance.
TestCordapp has now two implementations to clearly separate the two use cases it has in the Corda repo:
* TestCordappImpl which implements the revised public API of TestCordapp; namely that a TestCordapp instance references a real CorDapp jar on the classpath. This is either an external dependency jar in which case it’s taken as is and given to the node, or it’s a local gradle project in which case it’s compiled using the gradle “jar” task to generate the CorDapp jar. This approach means the jar has all the original CorDapp versioning information, which is important that it’s correct when testing. To this end, TestCordapp only needs to expose the ability to specify the app’s config. All the remaining properties have moved to CustomCordapp.
* CustomCordapp for creating arbitrary custom CorDapps, including specifying the jar’s MANIFEST values. This is internal API and only used for testing the platform. Technically this shouldn’t implement TestCordapp but does so to reduce the complexity of the driver and mock network.
* Test nested generics case
* Recursively resolve type parameters
* Comment and ensure type variables are resolved
* Only upper-bounding needs to be done recursively
TransactionBuilder loads attachment using attachment storage instead of CordappLoader,
contract class version is now Integer (format and stored in db as Integer).
* Hash to signature constraints migration #1
* After rebase from Attachments Classloader commit.
* Simplified implementation without CZ whitelisting and relaxing the no-overlap rule slightly.
* Further simplification.
* Detailed implementation.
* Use fully loaded Cash contract jar for hash to signature constraints migration test.
Additional debug logging.
* Minor cleanup.
* Address PR review feedback.
* Minor fix.
* Fixes following rebase from master.
* Implemented `calculateEntriesHashes` to improve classloader validation performance.
* Address minor PR review comments.
* Added integration tests and some minor fixes.
* Minor fixes following rebase from master.
* Updates and fixes following integration testing.
* Added changelog entry.
* Fix broken unit tests.
* Fix compilation errors in DriverDSL tests after rebase from master.
* Minor fix to test cordapp jar signing using explicit keystore.
* Run hash-to-signature constraints integration test out of process using a non-validating notary.
* Address PR review feedback: contract version from database + other minor changes.
* Address final PR review feedback: remove signed attachment field from attachmentWithContext
* Resolve conflicts following rebase from master.
* Fix failing junit test.
* Fix Kryo serialization error (forgot to write new `version` identifier field)
* Removed redundant query carried over from previous commit.
* Added documentation.
* Fix test case where explicit Hash Constraint input and Signature Constraint output explicitly configured.
* Addressing PR review comments from SA.
* AttachmentQueryCriteria API: added wither methods and Java Unit tests.
* Fixed compilation error caused by Unit tests being in wrong module.
* Added @CordaInternal to canBeTransitionedFrom function.
* Minimized AttachmentClassloader overlap duplicates checking.
* Moved JarSignatureTestUtils and ContractJarTestUtils to internal pending clean-up and documentation before public release.
* Minor fix following rebase from master.
* Removed redundant checkNotNull(networkParameters) checks now that these are always passed into the main (non-deprecated) constructor.
* Remove capitalization.
* Get enum transforms during type info building
* Eliminate transforms cache
* Allow combined renaming and defaulting for enums
* Comments and moving build method to EnumTransforms
* Force validation on EnumTransforms creation
* Remove commented code
* Cope with multiple renames
* CORDA-2263 evolve types with calculated properties
* Push handling of computed properties into builders
* Set isAccessible to true prior to calling
* Type information captures Java constructor, not Kotlin wrapper
Suppress warnings when constructing NonConstructible types that are wrapped by Opaque, and reduce warning level to info. Construct wrapped LocalTypeInformation for Opaque types immediately, rather than deferring with a thunk.
* Type model first draft
* Introduce TypeIdentifier
* Attempting to retrofit fingerprinter with type model
* Complete retrofitting typemodel to fingerprinter
* Ensure component types are resolved correctly
* Fixes and tests
* Move resolveAgainst to TypeIdentifier
* Remote type modelling and reflection
* Convert TypeIdentifiers back into types
* Translate AMQP type strings to type identifiers
* Start replacing DeserializedParameterizedType
* Start roundtripping types through AMQP serialization
* Comments on type modelling fingerprinter
* kdocs and interface reorganisation
* Lots and lots of kdocs, bugfix for cyclic references
* Separate SerializerFactory construction from concrete implementation
* Fewer build methods
* Method naming that doesn't fatally confuse determinisation
* Extract SerializerFactory interface
* Reset to master's version of compiler.xml
* Un-ignore flickering test
* Enums don't have superclasses
* Break out custom serializer registry
* Refactor to separate remote and local serializer factories
* Shrink interfaces
* Further interface narrowing
* Fingerprinting local type model
* LocalSerializerFactory uses LocalTypeInformation
* Resolve wildcards to their upper bounds
* Actually cache custom serializers
* Fix various bugs
* Remove print statements
* There are no cycles in type identifiers
* Drive class carpentry from RemoteTypeInformation
* Refactor and comment
* Comments
* Comments and pretty-printer extraction
* Format long methods with braces
* Serialise composable types using LocalTypeInformation
* Warnings if a type is non-composable
* Rename lookup -> findOrBuild
* Evolution serialisation (no enums yet)
* Eliminate old ObjectSerializer and evolver
* Enum evolution
* Opacity claims types less greedily
* Fix type notation and type erasure bug
* Clean up unused code paths
* Delete unused codepaths
* Move whitelist based type model configuration to own file
* Move opaque type list
* Make all evolution serialisers in one go when schema received
* Minor tweaks
* Commenting and tidying
* Comments
* Rebase against master
* Make flag for controlling evolution behaviour visible
* propertiesOrEmptyMap
* Restore error messages
* Test for CORDA-4107
* PR fixes
* Patch cycles in remote type information after creation
* Fix line breaks in unit test on Windows
* This time for sure
* EvolutionSerializerFactoryTests
* Fix some pretty-printing issues, and a carpenter bug
* PR fixes
* Clarify evolution constructor ordering
* Remote TODO comment, which has been moved to a JIRA story
* CORDA-2099 define LocalTypeInformation and related data types and functions
* Enums don't have superclasses
* Separate ACollection from AMap
* Remove spurious import
* Small fixes, slightly improved testing
* Log warnings if types that we expect to be able to serialise are non-composable
* Rename lookup -> findOrBuild
* Pull changes from working branch
* Missing files needed for unit test
* Pull in whitelist-based type model configuration
* Move opaque type list across
* Remote duplicate declaration
* Restore fixes from other PR
* CORDA-2099 create remote type model
* Comments
* Test the class-carpenting type loader
* Comment on cache usage
* Pull changes from main serialisation branch
* Add missing file
* Minor tweaks
* Remove most contentious bit of mutex in the codebase
Fix up SerializerFactory
Make getSerializerFactory() non-blocking
Workaround for DJVM issues
* Some clean up and also de-contend the RPC client.
* Fix up attachment class loader code.
* Bug fix