Skip to content

Commit

Permalink
Merge branch 'release/os/5.1' of https://github.com/corda/corda-api i…
Browse files Browse the repository at this point in the history
…nto nandor/CORE-17430/extra-column-backchain
  • Loading branch information
nkovacsx committed Oct 10, 2023
2 parents 25064dc + 4e04896 commit 340b4c5
Show file tree
Hide file tree
Showing 14 changed files with 110 additions and 82 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ tasks.named("dependencyUpdates").configure {
}

tasks.named("wrapper") {
gradleVersion = '8.2.1'
gradleVersion = '8.4'
distributionType = Wrapper.DistributionType.BIN
}

Expand Down
7 changes: 7 additions & 0 deletions data/avro-schema/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ dependencies {
compileOnly 'org.osgi:osgi.annotation'
}

configurations.all {
resolutionStrategy {
// CVE-2023-42503, current version of Avro uses an outdated version
force "org.apache.commons:commons-compress:$commonsCompressVersion"
}
}

description 'Data Model Definitions'

def generatedAvroDir = layout.buildDirectory.dir('generated-avro')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,15 @@ private BootConfig() {

public static final String BOOT_SECRETS = "secrets";

public static final String BOOT_STATE_MANAGER = "stateManager";
public static final String BOOT_STATE_MANAGER = StateManagerConfig.STATE_MANAGER;
public static final String BOOT_STATE_MANAGER_TYPE = BOOT_STATE_MANAGER + ".type";
public static final String BOOT_STATE_MANAGER_DB_USER = BOOT_STATE_MANAGER + ".database.user";
public static final String BOOT_STATE_MANAGER_DB_PASS = BOOT_STATE_MANAGER + ".database.pass";
public static final String BOOT_STATE_MANAGER_JDBC_URL = BOOT_STATE_MANAGER + ".database.jdbc.url";

public static final String BOOT_WORKER_SERVICE = "worker";
public static final String CRYPTO_WORKER_REST_ENDPOINT = BOOT_WORKER_SERVICE + ".endpoints.crypto";
public static final String VERIFICATION_WORKER_REST_ENDPOINT = BOOT_WORKER_SERVICE + ".endpoints.verification";
public static final String UNIQUENESS_WORKER_REST_ENDPOINT = BOOT_WORKER_SERVICE + ".endpoints.uniqueness";
public static final String PERSISTENCE_WORKER_REST_ENDPOINT = BOOT_WORKER_SERVICE + ".endpoints.persistence";
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ private ConfigKeys() {
public static final String FLOW_CONFIG = "corda.flow";
public static final String MESSAGING_CONFIG = "corda.messaging";
public static final String EXTERNAL_MESSAGING_CONFIG = "corda.externalMessaging";
public static final String STATE_MANAGER_CONFIG = "corda." + StateManagerConfig.STATE_MANAGER;
public static final String UTXO_LEDGER_CONFIG = "corda.ledger.utxo";
public static final String P2P_LINK_MANAGER_CONFIG = "corda.p2p.linkManager";
public static final String P2P_GATEWAY_CONFIG = "corda.p2p.gateway";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,31 +78,4 @@ private Publisher() {
* producers to stay under this limit when publishing messages.
*/
public static final String MAX_ALLOWED_MSG_SIZE = "maxAllowedMessageSize";

/**
* State Manager Configuration for connecting to the underlying persistent storage.
*/
public static final class StateManager {
private StateManager() {
}

public static final String STATE_MANAGER = "stateManager";
public static final String TYPE = STATE_MANAGER + ".type";

// Database Values
public static final String DB_PROPERTIES = STATE_MANAGER + ".database";
public static final String JDBC_USER = DB_PROPERTIES + ".user";
public static final String JDBC_PASS = DB_PROPERTIES + ".pass";

public static final String JDBC_URL = DB_PROPERTIES + ".jdbc.url";
public static final String JDBC_DRIVER = DB_PROPERTIES + ".jdbc.driver";
public static final String JDBC_DRIVER_DIRECTORY = DB_PROPERTIES + ".jdbc.directory";
public static final String JDBC_PERSISTENCE_UNIT_NAME = DB_PROPERTIES + ".jdbc.persistenceUnitName";
public static final String JDBC_POOL_MAX_SIZE = DB_PROPERTIES + ".pool.maxSize";
public static final String JDBC_POOL_MIN_SIZE = DB_PROPERTIES + ".pool.minSize";
public static final String JDBC_POOL_IDLE_TIMEOUT_SECONDS = DB_PROPERTIES + ".pool.idleTimeoutSeconds";
public static final String JDBC_POOL_MAX_LIFETIME_SECONDS = DB_PROPERTIES + ".pool.maxLifetimeSeconds";
public static final String JDBC_POOL_KEEP_ALIVE_TIME_SECONDS = DB_PROPERTIES + ".pool.keepAliveTimeSeconds";
public static final String JDBC_POOL_VALIDATION_TIMEOUT_SECONDS = DB_PROPERTIES + ".pool.validationTimeoutSeconds";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package net.corda.schema.configuration;

/**
* Configuration keys to access public parts of the configuration under the {@code corda.stateManager} key.
*/
public final class StateManagerConfig {
private StateManagerConfig() {
}

public static final String STATE_MANAGER = "stateManager";

public static final String TYPE = "type";

// Database Configuration Values
public static final class Database {
public static final String DB_PROPERTIES = "database";
public static final String JDBC_USER = DB_PROPERTIES + ".user";
public static final String JDBC_PASS = DB_PROPERTIES + ".pass";

public static final String JDBC_URL = DB_PROPERTIES + ".jdbc.url";
public static final String JDBC_DRIVER = DB_PROPERTIES + ".jdbc.driver";
public static final String JDBC_DRIVER_DIRECTORY = DB_PROPERTIES + ".jdbc.directory";
public static final String JDBC_POOL_MAX_SIZE = DB_PROPERTIES + ".pool.maxSize";
public static final String JDBC_POOL_MIN_SIZE = DB_PROPERTIES + ".pool.minSize";
public static final String JDBC_POOL_IDLE_TIMEOUT_SECONDS = DB_PROPERTIES + ".pool.idleTimeoutSeconds";
public static final String JDBC_POOL_MAX_LIFETIME_SECONDS = DB_PROPERTIES + ".pool.maxLifetimeSeconds";
public static final String JDBC_POOL_KEEP_ALIVE_TIME_SECONDS = DB_PROPERTIES + ".pool.keepAliveTimeSeconds";
public static final String JDBC_POOL_VALIDATION_TIMEOUT_SECONDS = DB_PROPERTIES + ".pool.validationTimeoutSeconds";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,37 +109,6 @@
"default": 972800,
"minimum": 512000,
"maximum": 8388608
},
"stateManager": {
"description": "Connection details for the underlying persistent storage used by the out of process State Manager.",
"type": "object",
"properties": {
"type": {
"description": "The type of state manager implementation.",
"enum": [
"DATABASE"
]
},
"additionalProperties": false
},
"$comment": "Polymorphic state manager storage connection configuration. The valid section depends on which state manager implementation is in use.",
"allOf": [
{
"if": {
"properties": { "type": { "const": "DATABASE" } },
"required": ["type"]
},
"then": {
"properties": {
"databaseProperties": {
"description": "Settings to connect to the state manager database.",
"$ref": "state-manager-db-properties.json"
}
},
"required": ["type","databaseProperties"]
}
}
]
}
},
"additionalProperties": false
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "https://corda.r3.com/net/corda/schema/configuration/stateManager/1.0/corda.stateManager.json",
"title": "Corda State Manager Configuration Schema",
"description": "Configuration schema for the State Manager section. This configures the interactions of the workers with the underlying persistent storage used by the out of process State Manager.",
"type": "object",
"properties": {
"type": {
"description": "The type of state manager implementation.",
"enum": [
"DATABASE"
]
},
"additionalProperties": false
},
"$comment": "Polymorphic state manager storage connection configuration. The valid section depends on which state manager implementation is in use.",
"allOf": [
{
"if": {
"properties": {
"type": {
"const": "DATABASE"
}
},
"required": [
"type"
]
},
"then": {
"properties": {
"databaseProperties": {
"description": "Settings to connect to the State Manager Database.",
"$ref": "stateManager-db-properties.json"
}
},
"required": [
"type",
"databaseProperties"
]
}
}
],
"additionalProperties": false
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "https://corda.r3.com/net/corda/schema/configuration/db/1.0/corda.db.json",
"$id": "https://corda.r3.com/net/corda/schema/configuration/stateManager/1.0/stateManager-db-properties.json",
"title": "State Manager Database Configuration Schema",
"description": "Configuration schema for the database section. Note that this configuration cannot be updated dynamically through the REST endpoint.",
"type": "object",
Expand All @@ -23,6 +23,11 @@
"type": "object",
"default": {},
"properties": {
"url": {
"description": "The JDBC URL.",
"type": "string",
"default": "jdbc:postgresql://state-manager-db:5432/state_manager"
},
"driver": {
"description": "The JDBC driver.",
"type": "string",
Expand All @@ -32,16 +37,6 @@
"description": "The directory that contains the JDBC drivers.",
"type": "string",
"default": "/opt/jdbc-driver"
},
"url": {
"description": "The JDBC URL.",
"type": "string",
"default": "jdbc:postgresql://state-manager-db:5432/state_manager"
},
"persistenceUnitName": {
"description": "The persistent unit name.",
"type": "string",
"default": "corda-state-manager"
}
},
"additionalProperties": false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import net.corda.schema.configuration.ConfigKeys.RECONCILIATION_CONFIG
import net.corda.schema.configuration.ConfigKeys.REST_CONFIG
import net.corda.schema.configuration.ConfigKeys.SANDBOX_CONFIG
import net.corda.schema.configuration.ConfigKeys.SECRETS_CONFIG
import net.corda.schema.configuration.ConfigKeys.STATE_MANAGER_CONFIG
import net.corda.schema.configuration.ConfigKeys.UTXO_LEDGER_CONFIG
import net.corda.schema.configuration.provider.ConfigSchemaException
import net.corda.v5.base.versioning.Version
Expand Down Expand Up @@ -42,6 +43,7 @@ class SchemaProviderConfigImplTest {
SANDBOX_CONFIG,
RECONCILIATION_CONFIG,
MEMBERSHIP_CONFIG,
STATE_MANAGER_CONFIG
)
private val VERSIONS = listOf("1.0")

Expand Down Expand Up @@ -99,4 +101,4 @@ class SchemaProviderConfigImplTest {
provider.getSchemaFile(BAD_SCHEMA_FILE)
}
}
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ cordaProductVersion = 5.1.0
# NOTE: update this each time this module contains a breaking change
## NOTE: currently this is a top level revision, so all API versions will line up, but this could be moved to
## a per module property in which case module versions can change independently.
cordaApiRevision = 30
cordaApiRevision = 31

# Main
kotlinVersion = 1.8.21
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
17 changes: 9 additions & 8 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -144,15 +145,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -201,11 +202,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down

0 comments on commit 340b4c5

Please sign in to comment.