-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Summary This PR moves Address Book and Safety Store to RocksDB (i.e. at Rust side of the Node code). The migration is of the existing stores is performed automatically at startup.
- Loading branch information
Showing
133 changed files
with
6,414 additions
and
884 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,13 +50,13 @@ ENV VERSION_LAST_TAG=$VERSION_LAST_TAG | |
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
docker.io=20.10.24+dfsg1-1+b3 \ | ||
libssl-dev=3.0.13-1~deb12u1 \ | ||
libssl-dev=3.0.14-1~deb12u2 \ | ||
pkg-config=1.8.1-1 \ | ||
unzip=6.0-28 \ | ||
wget=${WGET_VERSION} \ | ||
software-properties-common=0.99.30-4.1~deb12u1 \ | ||
&& apt-get install -y --no-install-recommends \ | ||
openjdk-17-jdk=17.0.11+9-1~deb12u1 \ | ||
openjdk-17-jdk=17.0.12+7-2~deb12u1 \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
|
@@ -126,12 +126,12 @@ RUN apt-get update \ | |
ca-certificates \ | ||
build-essential=12.9 \ | ||
# https://security-tracker.debian.org/tracker/CVE-2023-38545 | ||
curl=7.88.1-10+deb12u6 \ | ||
curl=7.88.1-10+deb12u7 \ | ||
g++-aarch64-linux-gnu \ | ||
g++-x86-64-linux-gnu \ | ||
libc6-dev-arm64-cross=2.36-8cross1 \ | ||
libclang-dev=1:14.0-55.7~deb12u1 \ | ||
libssl-dev=3.0.13-1~deb12u1 \ | ||
libssl-dev=3.0.14-1~deb12u2 \ | ||
pkg-config=1.8.1-1 \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
|
@@ -177,18 +177,21 @@ RUN USER=root "$HOME/.cargo/bin/cargo" init --lib --name dummy --vcs none . \ | |
&& mkdir -p ./jni-export/src \ | ||
&& mkdir -p ./node-common/src \ | ||
&& mkdir -p ./state-manager/src \ | ||
&& mkdir -p ./p2p/src \ | ||
&& touch ./core-api-server/src/lib.rs \ | ||
&& touch ./engine-state-api-server/src/lib.rs \ | ||
&& touch ./jni-export/src/lib.rs \ | ||
&& touch ./node-common/src/lib.rs \ | ||
&& touch ./state-manager/src/lib.rs | ||
&& touch ./state-manager/src/lib.rs \ | ||
&& touch ./p2p/src/lib.rs | ||
COPY core-rust/Cargo.toml ./ | ||
COPY core-rust/Cargo.lock ./ | ||
COPY core-rust/core-api-server/Cargo.toml ./core-api-server | ||
COPY core-rust/engine-state-api-server/Cargo.toml ./engine-state-api-server | ||
COPY core-rust/jni-export/Cargo.toml ./jni-export | ||
COPY core-rust/node-common/Cargo.toml ./node-common | ||
COPY core-rust/state-manager/Cargo.toml ./state-manager | ||
COPY core-rust/p2p/Cargo.toml ./p2p | ||
|
||
COPY docker/build_scripts/cargo_build_by_platform.sh /opt/radixdlt/cargo_build_by_platform.sh | ||
|
||
|
@@ -256,9 +259,9 @@ LABEL org.opencontainers.image.authors="[email protected]" | |
# - https://packages.debian.org/bookworm/libc6 | ||
RUN apt-get update -y \ | ||
&& apt-get -y --no-install-recommends install \ | ||
openjdk-17-jre-headless=17.0.11+9-1~deb12u1 \ | ||
openjdk-17-jre-headless=17.0.12+7-2~deb12u1 \ | ||
# https://security-tracker.debian.org/tracker/CVE-2023-38545 | ||
curl=7.88.1-10+deb12u6 \ | ||
curl=7.88.1-10+deb12u7 \ | ||
gettext-base=0.21-12 \ | ||
daemontools=1:0.76-8.1 \ | ||
# https://security-tracker.debian.org/tracker/CVE-2023-4911 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
core-rust-bridge/src/main/java/com/radixdlt/p2p/AddressBookEntryDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/* Copyright 2021 Radix Publishing Ltd incorporated in Jersey (Channel Islands). | ||
* | ||
* Licensed under the Radix License, Version 1.0 (the "License"); you may not use this | ||
* file except in compliance with the License. You may obtain a copy of the License at: | ||
* | ||
* radixfoundation.org/licenses/LICENSE-v1 | ||
* | ||
* The Licensor hereby grants permission for the Canonical version of the Work to be | ||
* published, distributed and used under or by reference to the Licensor’s trademark | ||
* Radix ® and use of any unregistered trade names, logos or get-up. | ||
* | ||
* The Licensor provides the Work (and each Contributor provides its Contributions) on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, | ||
* including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, | ||
* MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. | ||
* | ||
* Whilst the Work is capable of being deployed, used and adopted (instantiated) to create | ||
* a distributed ledger it is your responsibility to test and validate the code, together | ||
* with all logic and performance of that code under all foreseeable scenarios. | ||
* | ||
* The Licensor does not make or purport to make and hereby excludes liability for all | ||
* and any representation, warranty or undertaking in any form whatsoever, whether express | ||
* or implied, to any entity or person, including any representation, warranty or | ||
* undertaking, as to the functionality security use, value or other characteristics of | ||
* any distributed ledger nor in respect the functioning or value of any tokens which may | ||
* be created stored or transferred using the Work. The Licensor does not warrant that the | ||
* Work or any use of the Work complies with any law or regulation in any territory where | ||
* it may be implemented or used or that it will be appropriate for any specific purpose. | ||
* | ||
* Neither the licensor nor any current or former employees, officers, directors, partners, | ||
* trustees, representatives, agents, advisors, contractors, or volunteers of the Licensor | ||
* shall be liable for any direct or indirect, special, incidental, consequential or other | ||
* losses of any kind, in tort, contract or otherwise (including but not limited to loss | ||
* of revenue, income or profits, or loss of use or data, or loss of reputation, or loss | ||
* of any economic or other opportunity of whatsoever nature or howsoever arising), arising | ||
* out of or in connection with (without limitation of any use, misuse, of any ledger system | ||
* or use made or its functionality or any performance or operation of any code or protocol | ||
* caused by bugs or programming or logic errors or otherwise); | ||
* | ||
* A. any offer, purchase, holding, use, sale, exchange or transmission of any | ||
* cryptographic keys, tokens or assets created, exchanged, stored or arising from any | ||
* interaction with the Work; | ||
* | ||
* B. any failure in a transmission or loss of any token or assets keys or other digital | ||
* artefacts due to errors in transmission; | ||
* | ||
* C. bugs, hacks, logic errors or faults in the Work or any communication; | ||
* | ||
* D. system software or apparatus including but not limited to losses caused by errors | ||
* in holding or transmitting tokens by any third-party; | ||
* | ||
* E. breaches or failure of security including hacker attacks, loss or disclosure of | ||
* password, loss of private key, unauthorised use or misuse of such passwords or keys; | ||
* | ||
* F. any losses including loss of anticipated savings or other benefits resulting from | ||
* use of the Work or any changes to the Work (however implemented). | ||
* | ||
* You are solely responsible for; testing, validating and evaluation of all operation | ||
* logic, functionality, security and appropriateness of using the Work for any commercial | ||
* or non-commercial purpose and for any reproduction or redistribution by You of the | ||
* Work. You assume all risks associated with Your use of the Work and the exercise of | ||
* permissions under this License. | ||
*/ | ||
|
||
package com.radixdlt.p2p; | ||
|
||
import com.radixdlt.lang.Option; | ||
import com.radixdlt.sbor.codec.CodecMap; | ||
import com.radixdlt.sbor.codec.StructCodec; | ||
import java.util.Set; | ||
|
||
public record AddressBookEntryDTO( | ||
NodeIdDTO nodeId, Option<Long> bannedUntil, Set<PeerAddressEntryDTO> knownAddresses) { | ||
public static void registerCodec(CodecMap codecMap) { | ||
codecMap.register( | ||
AddressBookEntryDTO.class, | ||
codecs -> StructCodec.fromRecordComponents(AddressBookEntryDTO.class, codecs)); | ||
} | ||
} |
76 changes: 76 additions & 0 deletions
76
core-rust-bridge/src/main/java/com/radixdlt/p2p/NodeIdDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* Copyright 2021 Radix Publishing Ltd incorporated in Jersey (Channel Islands). | ||
* | ||
* Licensed under the Radix License, Version 1.0 (the "License"); you may not use this | ||
* file except in compliance with the License. You may obtain a copy of the License at: | ||
* | ||
* radixfoundation.org/licenses/LICENSE-v1 | ||
* | ||
* The Licensor hereby grants permission for the Canonical version of the Work to be | ||
* published, distributed and used under or by reference to the Licensor’s trademark | ||
* Radix ® and use of any unregistered trade names, logos or get-up. | ||
* | ||
* The Licensor provides the Work (and each Contributor provides its Contributions) on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, | ||
* including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, | ||
* MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. | ||
* | ||
* Whilst the Work is capable of being deployed, used and adopted (instantiated) to create | ||
* a distributed ledger it is your responsibility to test and validate the code, together | ||
* with all logic and performance of that code under all foreseeable scenarios. | ||
* | ||
* The Licensor does not make or purport to make and hereby excludes liability for all | ||
* and any representation, warranty or undertaking in any form whatsoever, whether express | ||
* or implied, to any entity or person, including any representation, warranty or | ||
* undertaking, as to the functionality security use, value or other characteristics of | ||
* any distributed ledger nor in respect the functioning or value of any tokens which may | ||
* be created stored or transferred using the Work. The Licensor does not warrant that the | ||
* Work or any use of the Work complies with any law or regulation in any territory where | ||
* it may be implemented or used or that it will be appropriate for any specific purpose. | ||
* | ||
* Neither the licensor nor any current or former employees, officers, directors, partners, | ||
* trustees, representatives, agents, advisors, contractors, or volunteers of the Licensor | ||
* shall be liable for any direct or indirect, special, incidental, consequential or other | ||
* losses of any kind, in tort, contract or otherwise (including but not limited to loss | ||
* of revenue, income or profits, or loss of use or data, or loss of reputation, or loss | ||
* of any economic or other opportunity of whatsoever nature or howsoever arising), arising | ||
* out of or in connection with (without limitation of any use, misuse, of any ledger system | ||
* or use made or its functionality or any performance or operation of any code or protocol | ||
* caused by bugs or programming or logic errors or otherwise); | ||
* | ||
* A. any offer, purchase, holding, use, sale, exchange or transmission of any | ||
* cryptographic keys, tokens or assets created, exchanged, stored or arising from any | ||
* interaction with the Work; | ||
* | ||
* B. any failure in a transmission or loss of any token or assets keys or other digital | ||
* artefacts due to errors in transmission; | ||
* | ||
* C. bugs, hacks, logic errors or faults in the Work or any communication; | ||
* | ||
* D. system software or apparatus including but not limited to losses caused by errors | ||
* in holding or transmitting tokens by any third-party; | ||
* | ||
* E. breaches or failure of security including hacker attacks, loss or disclosure of | ||
* password, loss of private key, unauthorised use or misuse of such passwords or keys; | ||
* | ||
* F. any losses including loss of anticipated savings or other benefits resulting from | ||
* use of the Work or any changes to the Work (however implemented). | ||
* | ||
* You are solely responsible for; testing, validating and evaluation of all operation | ||
* logic, functionality, security and appropriateness of using the Work for any commercial | ||
* or non-commercial purpose and for any reproduction or redistribution by You of the | ||
* Work. You assume all risks associated with Your use of the Work and the exercise of | ||
* permissions under this License. | ||
*/ | ||
|
||
package com.radixdlt.p2p; | ||
|
||
import com.radixdlt.crypto.ECDSASecp256k1PublicKey; | ||
import com.radixdlt.sbor.codec.CodecMap; | ||
import com.radixdlt.sbor.codec.StructCodec; | ||
|
||
public record NodeIdDTO(ECDSASecp256k1PublicKey publicKey) { | ||
public static void registerCodec(CodecMap codecMap) { | ||
codecMap.register( | ||
NodeIdDTO.class, codecs -> StructCodec.fromRecordComponents(NodeIdDTO.class, codecs)); | ||
} | ||
} |
Oops, something went wrong.