Skip to content

Commit cadde05

Browse files
author
Katelyn Baker
authored
CORDA-966 - RELEASE - Upgrade notes for V3.0 (corda#2550)
* DOC: AMQP upgrade notes in brief * moving test upgrade notes from release notes to upgrade note * add cordapp/cordformation notes * Added section for network map changes * Updated upgrade notes to reflect changes for SSL (corda#2569) * Updated upgrade notes to reflect changes for SSL * Removed some blank lines. * AMQP Constructor / property mismatch upgrade note * wip * Note about feasible (but not recommended) tables that can be migrated from Corda 2.0 to 3.0, basic recipe how to do it. * Database schema changes - optional partial vault migration described at the end of the paragraph, focus on the overall changes to tables. * Review Comments * Database schema changes - split Vault and finance module changes, reformatting, improve migration note. * Database schema changes - addressing PR comments. * Database schema changes - move changes to change log, migration to JIRA ticket. * Finalise versions * review comments * CORDA-1171: Add notes on the notary error change * set release version
1 parent 5e6d3c3 commit cadde05

File tree

2 files changed

+190
-4
lines changed

2 files changed

+190
-4
lines changed

docs/source/changelog.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ from the previous milestone release.
99
Version 3.0
1010
-----------
1111

12+
* Due to a security risk, the `conflict` property has been removed from `NotaryError.Conflict` error object. It has been replaced
13+
with `consumedStates` instead. The new property no longer specifies the original requesting party and transaction id for
14+
a consumed state. Instead, only the hash of the transaction id is revealed. For more details why this change had to be
15+
made please refer to the release notes.
16+
17+
* Added ``NetworkMapCache.getNodesByLegalName`` for querying nodes belonging to a distributed service such as a notary cluster
18+
where they all share a common identity. ``NetworkMapCache.getNodeByLegalName`` has been tightened to throw if more than
19+
one node with the legal name is found.
20+
1221
* Per CorDapp configuration is now exposed. ``CordappContext`` now exposes a ``CordappConfig`` object that is populated
1322
at CorDapp context creation time from a file source during runtime.
1423

@@ -36,6 +45,29 @@ Version 3.0
3645
`participants` collection need to be moved to the actual class. This allows to properly specify the unique table name per a collection.
3746
See: DummyDealStateSchemaV1.PersistentDummyDealState
3847

48+
* Database schema changes - an H2 database instance of Corda 1.0 and 2.0 cannot be reused for Corda 3.0, listed changes for Vault and Finance module:
49+
50+
* ``NODE_TRANSACTIONS``:
51+
column ``"TRANSACTION”`` renamed to ``TRANSACTION_VALUE``, serialization format of BLOB stored in the column has changed to AMQP
52+
* ``VAULT_STATES``:
53+
column ``CONTRACT_STATE`` removed
54+
* ``VAULT_FUNGIBLE_STATES``:
55+
column ``ISSUER_REFERENCE`` renamed to ``ISSUER_REF`` and the field size increased
56+
* ``"VAULTSCHEMAV1$VAULTFUNGIBLESTATES_PARTICIPANTS"``:
57+
table renamed to ``VAULT_FUNGIBLE_STATES_PARTS``,
58+
column ``"VAULTSCHEMAV1$VAULTFUNGIBLESTATES_OUTPUT_INDEX"`` renamed to ``OUTPUT_INDEX``,
59+
column ``"VAULTSCHEMAV1$VAULTFUNGIBLESTATES_TRANSACTION_ID"`` renamed to ``TRANSACTION_ID``
60+
* ``VAULT_LINEAR_STATES``:
61+
type of column ``"UUID"`` changed from ``VARBINARY`` to ``VARCHAR(255)`` - select varbinary column as ``CAST("UUID" AS UUID)`` to get UUID in varchar format
62+
* ``"VAULTSCHEMAV1$VAULTLINEARSTATES_PARTICIPANTS"``:
63+
table renamed to ``VAULT_LINEAR_STATES_PARTS``,
64+
column ``"VAULTSCHEMAV1$VAULTLINEARSTATES_OUTPUT_INDEX"`` renamed to ``OUTPUT_INDEX``,
65+
column ``"VAULTSCHEMAV1$VAULTLINEARSTATES_TRANSACTION_ID"`` renamed to ``TRANSACTION_ID``
66+
* ``contract_cash_states``:
67+
columns storing Base58 representation of the serialised public key (e.g. ``issuer_key``) were changed to store Base58 representation of SHA-256 of public key prefixed with `DL`
68+
* ``contract_cp_states``:
69+
table renamed to ``cp_states``, column changes as for ``contract_cash_states``
70+
3971
* X.509 certificates now have an extension that specifies the Corda role the certificate is used for, and the role
4072
hierarchy is now enforced in the validation code. See ``net.corda.core.internal.CertRole`` for the current implementation
4173
until final documentation is prepared. Certificates at ``NODE_CA``, ``WELL_KNOWN_SERVICE_IDENTITY`` and above must

docs/source/upgrade-notes.rst

Lines changed: 158 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,64 @@ versions you are currently using are still in force.
2828

2929
We also strongly recommend cross referencing with the :doc:`changelog` to confirm changes.
3030

31-
UNRELEASED
32-
----------
31+
V2.0 to V3.0
32+
------------
33+
34+
Gradle Plugin Version
35+
^^^^^^^^^^^^^^^^^^^^^
36+
37+
Corda 3.0 uses version 3.0.8 of the gradle plugins and your ``build.gradle`` file should be updated to reflect this.
38+
39+
.. sourcecode:: shell
40+
41+
ext.corda_gradle_plugins_version = '3.0.9'
42+
43+
You will also need to update the ``corda_release_version`` identifier in your project gradle file.
44+
45+
.. sourcecode:: shell
46+
47+
ext.corda_release_version = 'corda-3.0'
48+
49+
Network Map Service
50+
^^^^^^^^^^^^^^^^^^^
51+
52+
With the re-designed network map service the following changes need to be made:
53+
54+
* The network map is no longer provided by a node and thus the ``networkMapService`` config is ignored. Instead the
55+
network map is either provided by the compatibility zone (CZ) operator (who operates the doorman) and available
56+
using the ``compatibilityZoneURL`` config, or is provided using signed node info files which are copied locally.
57+
See :doc:`network-map` for more details, and :doc:`setting-up-a-corda-network.rst` on how to use the network
58+
bootstrapper for deploying a local network.
59+
60+
* Configuration for a notary has been simplified. ``extraAdvertisedServiceIds``, ``notaryNodeAddress``, ``notaryClusterAddresses``
61+
and ``bftSMaRt`` configs have been replaced by a single ``notary`` config object. See :doc:`corda-configuration-file`
62+
for more details.
63+
64+
* The advertisement of the notary to the rest of the network, and its validation type, is no longer determined by the
65+
``extraAdvertisedServiceIds`` config. Instead it has been moved to the control of the network operator via
66+
the introduction of network parameters. The network bootstrapper automatically includes the configured notaries
67+
when generating the network parameters file for a local deployment.
68+
69+
* Any nodes defined in a ``deployNodes`` gradle task performing the function of the network map can be removed, or the
70+
``NetworkMap`` parameter can be removed for any "controller" node which is both the network map and a notary.
71+
72+
* For registering a node with the doorman the ``certificateSigningService`` config has been replaced by ``compatibilityZoneURL``.
73+
74+
Corda Plugins
75+
^^^^^^^^^^^^^
76+
77+
* Corda plugins have been modularised further so the following additional gradle entries are necessary:
78+
For example:
79+
80+
.. sourcecode:: groovy
81+
dependencies {
82+
classpath "net.corda.plugins:cordapp:$corda_gradle_plugins_version"
83+
}
84+
85+
apply plugin: 'net.corda.plugins.cordapp'
86+
87+
The plugin needs to be applied in all gradle build files where there is a dependency on Corda using any of:
88+
cordaCompile, cordaRuntime, cordapp
3389

3490
* For existing contract ORM schemas that extend from ``CommonSchemaV1.LinearState`` or ``CommonSchemaV1.FungibleState``,
3591
you will need to explicitly map the ``participants`` collection to a database table. Previously this mapping was done
@@ -54,8 +110,65 @@ UNRELEASED
54110
JoinColumn(name = "transaction_id", referencedColumnName = "transaction_id")))
55111
override var participants: MutableSet<AbstractParty>? = null,
56112

113+
AMQP
114+
^^^^
115+
116+
Whilst the enablement of AMQP is a transparent change, as noted in the :doc:`serialization` documentation
117+
the way classes, and states in particular, should be written to work with this new library may require some
118+
alteration to your current implementation.
119+
120+
* With AMQP enabled Java classes must be compiled with the -parameter flag.
121+
122+
* If they aren't, then the error message will complain about ``arg<N>`` being an unknown parameter.
123+
* If recompilation is not viable, a custom serializer can be written as per :doc:`cordapp-custom-serializers`
124+
* It is important to bear in mind that with AMQP there must be an implicit mapping between constructor
125+
parameters and properties you wish included in the serialized form of a class.
126+
127+
* See :doc:`serialization` for more information
128+
129+
* Error messages of the form
130+
131+
``Constructor parameter - "<some parameter of a constructor>" - doesn't refer to a property of "class <some.class.being.serialized>"``
132+
133+
indicate that a class, in the above example ``some.class.being.serialized``, has a parameter on its primary constructor that
134+
doesn't correlate to a property of the class. This is a problem because the Corda AMQP serialization library uses a class's
135+
constructor (default, primary, or annotated) as the means by which instances of the serialized form are reconstituted.
136+
137+
See the section "Mismatched Class Properties / Constructor Parameters" in the :doc:`serialization` documentation
138+
139+
Database schema changes
140+
^^^^^^^^^^^^^^^^^^^^^^^
141+
142+
An H2 database instance (represented on the filesystem as a file called `persistence.mv.db`) used in Corda 1.0 or 2.0
143+
cannot be directly reused with Corda 3.0 due to minor improvements and additions to stabilise the underlying schemas.
144+
145+
Configuration
146+
^^^^^^^^^^^^^
147+
148+
Nodes that do not require SSL to be enabled for RPC clients now need an additional port to be specified as part of their configuration.
149+
To do this, add a block as follows to the nodes configuraiton:
150+
151+
.. sourcecode:: script
152+
153+
rpcSettings {
154+
adminAddress "localhost:10007"
155+
}
156+
157+
to `node.conf` files.
158+
159+
Also, the property `rpcPort` is now deprecated, so it would be preferable to substitute properties specified that way e.g., `rpcPort=10006` with a block as follows:
160+
161+
.. sourcecode:: script
162+
163+
rpcSettings {
164+
address "localhost:10006"
165+
adminAddress "localhost:10007"
166+
}
167+
168+
Equivalent changes should be performed on classes extending `CordformDefinition`.
169+
57170
Testing
58-
~~~~~~~
171+
^^^^^^^
59172

60173
* The registration mechanism for CorDapps in ``MockNetwork`` unit tests has changed:
61174

@@ -65,6 +178,47 @@ Testing
65178

66179
* The ``unsetCordappPackages`` method is now redundant and has been removed
67180

181+
* Many classes have been moved between packages, so you will need to update your imports
182+
183+
.. tip:: We have provided a several scripts (depending upon your operating system of choice) to smooth the upgrade
184+
process for existing projects. This can be found at ``tools\scripts\update-test-packages.sh`` for the Bash shell and
185+
``tools/scripts/upgrade-test-packages.ps1`` for Windows Power Shell users in the source tree
186+
187+
* setCordappPackages and unsetCordappPackages have been removed from the ledger/transaction DSL and the flow test framework,
188+
and are now set via a constructor parameter or automatically when constructing the MockServices or MockNetwork object
189+
190+
* Key constants e.g. ``ALICE_KEY`` have been removed; you can now use TestIdentity to make your own
191+
192+
* The ledger/transaction DSL must now be provided with MockServices as it no longer makes its own
193+
* In transaction blocks, input and output take their arguments as ContractStates rather than lambdas
194+
* Also in transaction blocks, command takes its arguments as CommandDatas rather than lambdas
195+
196+
* The MockServices API has changed; please refer to its API documentation
197+
198+
* TestDependencyInjectionBase has been retired in favour of a JUnit Rule called SerializationEnvironmentRule
199+
* This replaces the initialiseSerialization parameter of ledger/transaction and verifierDriver
200+
* The withTestSerialization method is obsoleted by SerializationEnvironmentRule and has been retired
201+
202+
* MockNetwork now takes a MockNetworkParameters builder to make it more Java-friendly, like driver's DriverParameters
203+
* Similarly, the MockNetwork.createNode methods now take a MockNodeParameters builder
204+
205+
* MockNode constructor parameters are now aggregated in MockNodeArgs for easier subclassing
206+
207+
* MockNetwork.Factory has been retired as you can simply use a lambda
208+
209+
* testNodeConfiguration has been retired, please use a mock object framework of your choice instead
210+
211+
* MockNetwork.createSomeNodes and IntegrationTestCategory have been retired with no replacement
212+
213+
* Starting a flow can now be done directly from a node object. Change calls of the form ``node.getServices().startFlow(...)``
214+
to ``node.startFlow(...)``
215+
216+
* Similarly a tranaction can be executed directly from a node object. Change calls of the form ``node.getDatabase().transaction({ it -> ... })``
217+
to ``node.transaction({() -> ... })``
218+
219+
* ``startFlow`` now returns a ``CordaFuture``, there is no need to call ``startFlow(...).getResultantFuture()``
220+
221+
68222
V1.0 to V2.0
69223
------------
70224

@@ -403,4 +557,4 @@ Finance
403557

404558
* Adjust imports of Cash flow references
405559
* Adjust the ``StartFlow`` permission in ``gradle.build`` files
406-
* Adjust imports of the associated flows (``Cash*Flow``, ``TwoPartyTradeFlow``, ``TwoPartyDealFlow``)
560+
* Adjust imports of the associated flows (``Cash*Flow``, ``TwoPartyTradeFlow``, ``TwoPartyDealFlow``)

0 commit comments

Comments
 (0)