Commit Graph

54 Commits

Author SHA1 Message Date
Michele Sollecito
33af80ac55
[CORDA-1264]: Ensure correct serialisation and masking for throwables raised by a node and propagated through RPC. (#2902) 2018-03-29 14:40:40 +01:00
Michele Sollecito
5ac4c7eda7 CORDA-1267 - Make JPA entities non-final and Serializable. (#2899) 2018-03-29 12:43:42 +01:00
Anthony Keenan
3a14ae89c0 CORDA-1178 - Api scanner backport and update of api-current.txt (#2813)
* Api scanner backport and update of api-current.txt

* Updated api-current based on current state of release branch

* Update to most recent version of api scanner

* Fix a couple of issues with the merge and regenerate the api file with the most recent version of the scanner.

* Update changelog/release notes
2018-03-21 11:19:20 +00:00
Andrius Dagys
33b34a306f Update final API for V3 (#2796) 2018-03-14 17:08:25 +00:00
Andrius Dagys
c367df0e83 CORDA-1171 - When a double-spend occurs, do not send the consuming transaction id and requesting party back to the client - this might lead to privacy leak. Only the transaction id hash is now returned. (#2746) 2018-03-08 20:44:13 +00:00
Andrius Dagys
da74263f42 CORDA-696 - Ensure deterministic transaction id calculation for contra… (#2676)
* CORDA-696: Ensure deterministic transaction id calculation for contract upgrade and notary change transactions.

The problem with the previous implementation is that the transaction would be deserialized with the schema specified
in the serialized form, but the calculation of the id would involve re-serializing properties using a local serialization context
which might produce a different result.

* Support forwards compatibility for new hidden or visible properties

* Some refactoring and updating api docs

* Fix tests & add custom serializer in case the transaction is captured in a checkpoint

* Update id calculation for notary change transactions as well - no filtering is involved

* Use computeNonce

* More refactoring

* Use helper for computing component hashes

* Optimise id calculation
2018-03-08 17:59:25 +00:00
Mike Hearn
f714c3001c
Fix another non-serializable exception, add docs, fix a possible security issue. (#2707) (#2710)
* Fix another non-serializable exception, add docs, fix a possible security issue.

* Update API definition to reflect methods added to make more exceptions serializable
2018-03-02 16:15:09 +01:00
Anthony Keenan
b76556940a CORDA-991 - Finalise API stabilty (#2685) 2018-03-01 20:33:50 +00:00
Anthony Keenan
d77290831c CORDA-1035 - Testing api KDoc Updates (#2670)
* [CORDA-1035] Testing api KDoc Updates (#2584)

* Testing api KDoc Updates

* Update after code review

* Update api-current

* Revert changes to compiler.xml

* Made comment changes from review

* Fixing merge conflict

* Don't expose net.corda.node through test API (first pass)

* Fixing merge conflicts

* Update api-current

* Addressing review commits

* Fix exposure of internal implementation of MessageHandlerRegistration

* Make InProcess expose ServiceHub instead of internal StartedNodeServices

* Move InternalMockMessaginService interface to internal namespace

* Move MOCK_VERSION_INFO to internal namespace to avoid exposing VersionInfo

* Don't expose WritableTransactionStorage via testing api

* Create public VerifierType enum

* Update api-current and modify check-api-changes to check for net.corda.node exposures

* Fix merge conflicts

* Fixing another merge conflict

* Fix accidentally broken unit tests

* Make getInternalServices a property

* Fix failing unit tests

* Add todo to check-api-changes

* Fix rpc sender thread busy looping

* Fix tests

* Fixing tests

* Address mike's comments

* Fixing tests

* Make random port allocation internal

* Update api

* Update api
2018-02-28 15:59:56 +00:00
Andras Slemmer
de577904eb CORDA-1043 - recieveAll documentation (#2611)
* CORDA-1043

* Update API
2018-02-22 17:54:57 +00:00
Andrius Dagys
659d6c03ef CORDA-696 - Create separate transaction types for contract upgrade transactions (#2589)
* CORDA-986 and CORDA-985 CompositeKey and Signature verification performance fixes (#2467)

* CORDA-696: Create separate transaction types for contract upgrade transactions.

Add rationale around upgrade transactions

Move contract upgrade transaction resolution logic into internal until it's stabilised.

Throw a better exception when contract attachment not found

Default legacy contract constraint to always accepting - needs to be changed to whitelist constraint before merging

Introduce a new upgraded contract interface that allows specifying the legacy constraint.

Remove StateLoader, make all tx resolution functions take in ServicesForResolution

Contract upgrade transactions can handle whitelist by zone constraints

When creating a contract upgrade transaction, make sure the attachment of the old cordapp gets attached when using hash constraints.
Attachment lookup for a given contract class name only scans currently loaded cordapps, and we don't load old versions of cordapps.
2018-02-22 17:51:41 +00:00
Andrius Dagys
7358e902a5 CORDA-941 - Instead of storing the network map contract implementation whitelist along with (#2581)
the constraint, pass it in during verification on LedgerTransaction
2018-02-21 16:45:50 +00:00
Shams Asari
be0758e52f Removed DriverParameters.initialiseSerialization (#2572) (#2576)
(cherry picked from commit 979aef1)
2018-02-20 16:49:46 +00:00
Andrius Dagys
f6c82dc99e CORDA-1010 - Send a request signature in addition to a transaction to the notary (#2573)
* Make NotaryFlow.Client more modular and easier to customise

* CORDA-1010: Send a request signature in addition to a transaction to the notary (#2527)

CORDA-1010: Notary flow - clients now send a signature over a notarisation
request in addition to the transaction. This will be logged by the notary
to be able to prove that a particular party has requested the consumption
of a particular state.
2018-02-20 12:09:51 +00:00
Tudor Malene
60a4bcba5b CORDA-941 - Add Network Parameters contract implementation Whitelist (#2539)
* CORDA-941 Add Network Parameters contract implementation Whitelist

* CORDA-941 fix merge

* CORDA-941 added uploader support to Attachments and added check into the AttachmentClassloader to only allow loading attachments that were uploaded from the local cordapps folder

* CORDA-941 update api spec

* CORDA-941 address some code review changes and fix and add classloader test

* CORDA-941 fix test

* CORDA-941 address code review comments

* CORDA-941 address code review comments - use and update existing whitelist

* CORDA-941 address code review comments

* CORDA-941 fix compile error

* CORDA-941 address code review comments

* CORDA-941 removed: whitelistAllContractsForTest

* CORDA-941 removed: whitelistAllContractsForTest

* CORDA-941 add comment

* CORDA-941 remove toLedgerTransaction

* CORDA-941 add warning when node not using latest CorDapp

* CORDA-941 remove the stubbing approach for cleaning LedgerTransaction

* CORDA-941 Code review changes

* CORDA-941 Fix merge

* CORDA-941 workaround for api scanner bug

* Fixed JacksonSupportTest.
2018-02-20 11:09:23 +00:00
Shams Asari
34e82026f3 Changed the wither methods in DriverParameters and NodeParameters to begin with "with" and not "set" (#2570) (#2571)
(cherry picked from commit ad959c7)
2018-02-20 09:52:13 +00:00
sollecitom
22f6827131 CORDA-961 - Revert the introduction of GlobalProperties.
* Changes to LargeTransactionTests.
 * Code review changes.
 * Code review changes.
 * Code review changes.
 * Reverted to MAX_FILE_SIZE for Artemis.
 * reverted max message size for BridgeControlListener inside Node.kt
 * reverted max message size for BridgeControlListener inside Node.kt
 * Renamed setNetworkParameters to withNetworkParameters in MockNetwork.kt
 * Updated to reflect latest state.
2018-02-19 15:57:21 +00:00
Anthony Keenan
b24ec9f680 CORDA-939 - Modify Api Scanner to check api for internal exposures (#2534)
* CORDA-939 Modify Api Scanner to check api for internal exposures (#2510)

* Update check api changes to look for internals

* Update several more uses of internal

* Make check-api-changes script filter out internal class usages

* Make CordaClock part of API

* Update api-current.txt

* Remove exclusion of nodeapi.internal

* Remove access to CordaPersistence from public api

* Don't expose DB Connection from StartedMockNode and remove unnecessary transaction from CustomVaultQueryTest

* Make internal tests that use need db access use InternalMockNetwork

* Make test certificates internal

* Address further review comments

* Revert some accidental changes to api-current.txt

* Address Shams' review comments

* Update Api Scanner to filter out CordaInternal attribute

* Update api-current.txt

* Remove superfluous brackets

* Add transaction to StartedMockNode

* More leaky transaction fixes

# Conflicts:
#	.ci/api-current.txt
#	node-api/src/test/kotlin/net/corda/nodeapi/internal/AttachmentsClassLoaderStaticContractTests.kt
#	node-api/src/test/kotlin/net/corda/nodeapi/internal/AttachmentsClassLoaderTests.kt
#	node/src/integration-test/kotlin/net/corda/node/services/AttachmentLoadingTests.kt
#	node/src/test/kotlin/net/corda/node/internal/cordapp/CordappProviderImplTests.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/InternalMockNetwork.kt
#	testing/test-utils/src/main/kotlin/net/corda/testing/internal/MockCordappConfigProvider.kt
#	testing/test-utils/src/main/kotlin/net/corda/testing/internal/MockCordappProvider.kt

* Bump gradle plugins version

* One last internal exposure

* Update constants.properties

* Fix api-current

* Address mikes review comments
2018-02-16 15:22:13 +00:00
Katelyn Baker
f0e52e1eed
CORDA-1007 - Tweak the way invocation context is integrated to reduce the pain for devs using the old API (#2447) (#2524)
Minor tweaks to the invocation context code.

1) Un-deprecate FlowInitiator, move the deprecation to the field. This
   eliminates large numbers of warnings and means developers are warned
   only once in the place where they obtain one.

2) Add documentation for StateMachineInfo and create a type alias to give
   it a better name in an ABI compatible way.

3) Improve markup on InvocationContext

4) Rename field from just "context" to "invocationContext" (Context is vague)
2018-02-13 13:12:26 +00:00
Patrick Kuo
c18bc8758f CORDA-961 Wire up and enforce max transaction size (#2465) (#2493)
* wire up and enforce max transaction size

* fixup after rebase
moved network parameter from AbstractNode to NodeProperties

* removed TODO

* fix broken import

* address PR issues

* remove API breaking change
address PR issue

* added max transaction size to driver and mock network.
address PR issues

* fix failing test

* added TODO

* fix verifier test

* fix spring driver build error

(cherry picked from commit c8cf46c)
2018-02-09 17:24:15 +00:00
Anthony Keenan
e41408d21e CORDA-939 - Dont expose FlowStateMachine via public API (#2438) (#2476)
* CORDA-939 - Dont expose FlowStateMachine via public API (#2438)

* Create CordaInternal attribute for properties on public classes that are not part of the api and apply to FlowLogic.stateMachine

* Remove startFlow from public test api and replace with startFlowAndReturnFuture

* Update api-current with changed signature

* Change test used in documentation to use public test methods

* Remove the rest of the unneccessary usages of the startFlow test utility

* Remove extra whitespace

* Rename startFlowAndReturnFuture back to startFlow

* Update api

* The annotation doesn't appear unless its marked as on the actual getter and setter

* Updated docs and removed pointless attribute

* Deleted whitespace

# Conflicts:
#	.ci/api-current.txt
#	testing/node-driver/src/main/kotlin/net/corda/testing/node/NodeTestUtils.kt

* Revert api-current to v1 api

* Adding missing line and missing annotations

* Made changes post review

* Minor text change
2018-02-08 14:40:16 +00:00
Andrius Dagys
e357a88181
Deprecate TimeWindowChecker, make TimeWindowInvalid report exact current time and transaction time window (#2280)
* Make notary service return the current time and the transaction time window
along with the TimeWindowInvalid error.

Deprecate TimeWindowChecker.
Add a static method for validating transaction time window to reduce code duplication.
2018-01-26 09:32:11 +00:00
Tudor Malene
c2bd7403a8
hibernate mapping changes (#2337)
* add foreign key names and move the participants mapping to the subclass so that the table name can be configured

* update api-current file

* fix compilation errors

* PR changes

* PR changes
2018-01-10 11:42:08 +00:00
Andrzej Cichocki
8a3299fa2a
CORDA-716 Configure api scanner for test modules (#2259) 2018-01-04 10:09:04 +00:00
Shams Asari
e1e715ee81 Removed all remaining special treatment of the X500 common name.
With network parameters the CN is no longer needed to identify notaries. This frees it up to be used in the node's name alongside the other attributes.

Also, the identity generation logic has been simplified, removing the need to have magic string values for storing distributed identities in the keystore. Now there are just two alias prefixes: "identity" as it was previously, and "distributed-notary".
2017-12-18 21:39:11 +00:00
Katelyn Baker
c4d5d3817c CORDA-553 - Update api checker
With the addition of the CordaCustomSerializer class for third part
serializers we need to update the ci reference file
2017-12-07 21:15:33 +00:00
Andrzej Cichocki
b0ebf3d7e0
CORDA-654 Various MockServices refactorings (#2167)
* Remove MockServices.stateMachineRecordedTransactionMapping which does nothing
* Inline StateLoaderImpl
* Remove unused MockServices
* MockServices well-known identities not needed in a place
* A few things don't need a full-blown ServiceHub
2017-12-05 16:22:53 +00:00
bpaunescu
c467a056ae
Revert CORDA-296: added rpc that returns an observable for node state (#2091)
* Revert "CORDA-296: added rpc that returns an observable for node state (#2004)"

This reverts commit 7d1f7ab

* Revert "CORDA-296: added rpc that returns an observable for node state (#2004)"

This reverts commit 7d1f7ab
2017-11-21 09:52:17 +00:00
Shams Asari
953a4a3790 Revert "Introducing network parameters."
This reverts commit d04e487
2017-11-17 10:04:38 +00:00
Michele Sollecito
92c8861802
[CORDA-760]: Propagate invocation context across the codebase. (#2016) 2017-11-15 14:58:43 +00:00
Maksymilian Pawlak
1a02c9a74f
AttachmentCriteriaQuery class and infrastructure (#2022)
* Attachments metadata support
2017-11-14 10:22:02 +00:00
Andrzej Cichocki
052124bbe0
CORDA-716 Make serialization init less static (#1996) 2017-11-10 15:44:43 +00:00
Chris Rankin
41e0be1958
Exit code is between 0-255. So protect against VERY unlikey chance of overflow. (#2000) 2017-11-06 11:54:48 +00:00
Patrick Kuo
22453204ed
move node info schema to internal package (#1976) 2017-11-03 11:30:29 +00:00
Andrzej Cichocki
4b0b13dad4
CORDA-716 Retire TestDependencyInjectionBase (#1939) 2017-10-31 10:21:38 +00:00
Katelyn Baker
851918dd76 CORDA-553 - API standard doc update
The evolution annotations are being added to core which is being flagged
as a breaking API change. Given these are part of the upcoming
introduction of AMQP they're not actually breaking anything we've not
enabled yet
2017-10-30 11:34:54 +00:00
bpaunescu
04d8260e0f CORDA-351: force update dependencies and suppress vulnerabilities not… (#1944)
* CORDA-351: force update dependencies and suppress vulnerabilities not affecting corda

* CORDA-351: force update dependencies and suppress vulnerabilities not affecting corda
2017-10-26 12:16:57 +01:00
josecoll
5349d4f850 Standardisation of Public Keys in Schema entities. (#68) (#1936)
* Standardisation of Public Keys in Schema entities. (#68)

* Standardisation in usage of Public Keys in Schema entities.
Use PK Hash where optimal, otherwise use ByteArray/LOB representation of PK.

* Redundant after rebase.

* Use .encoded and Crypto.decode<Public|Private>Key(bytes) instead of Corda serialization.

* Optimize DBPartyAndCertificate entity to store and query on ownerKeyHash.

* Updated API stability check for schema attribute change.
2017-10-24 22:11:41 +01:00
Andrius Dagys
c5a6047b0e Minor fix for api checker script to support macOS 2017-10-24 10:19:39 +01:00
bpaunescu
1b7ebd4841 CORDA-351: added dependency check plugin to gradle build script (#1911)
* CORDA-351: added dependency check plugin to gradle build script

* CORDA-351: Added suppression stub file with example

* CORDA-351: added suppresionFile property
2017-10-20 17:58:16 +01:00
Andras Slemmer
c66a84bfc6 Interface changes for multi-threading 2017-10-20 11:29:30 +01:00
Chris Rankin
2c84d07e8e CORDA-704: Implement @DoNotImplement annotation (#1903)
* Enhance the API Scanner plugin to monitor class annotations.
* Implement @DoNotImplement annotation, and apply it.
* Update API definition.
* Update API change detection to handle @DoNotImplement.
* Document the `@DoNotImplement` annotation.
2017-10-19 17:18:35 +01:00
Andrzej Cichocki
dfd90701a0 CORDA-599 PersistentNetworkMapCache no longer circularly depends on SH (#1652) 2017-10-19 11:19:55 +01:00
Viktor Kolomeyko
cac3057877 CORDA-540: Make Verifier work in AMQP mode (#1870) 2017-10-17 10:44:27 +01:00
Chris Rankin
635ad9ac92 Ensure that the contents of OpaqueBytes cannot be modified. (#1871)
* Ensure that contents of OpaqueBytes cannot be modified.
* Update documentation and restore the signature verification check.
* Update the API definition.
* KDoc fixes.
* Update the changelog for v1.1.
2017-10-13 12:27:42 +01:00
Chris Rankin
d1c5111567 Remove the two header lines from the diff output to simplify the +/- … (#1875)
* Remove the two header lines from the diff output to simplify the +/- check.
* Revert Kt class changes as they alter the public API.
2017-10-12 11:39:22 +01:00
Chris Rankin
747830ff90 Scan API for addition of new abstract methods. (#1854)
* Scan API for addition of new abstract methods.
* Make sure we ignore blank lines when counting API changes.
* Add 6 new abstract APIs to our API definition.
2017-10-09 17:38:45 +01:00
Viktor Kolomeyko
f6e5d2385a Non-material public API change due to interfaces being re-arranged (#1852) 2017-10-09 15:24:39 +01:00
Chris Rankin
d9f086cf91 Modify the API Scanner plugin to filter method annotations. 2017-10-06 12:11:42 +01:00
Chris Rankin
97731bcaaf Add README for our automated API check. (#1793)
* Add README for our automated API check.
* Mention that the Corda Release Manager is expected to update the API file.
2017-10-03 15:33:20 +01:00