Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions .github/actions/rust/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ description: "Install dependencies"
inputs:
toolchain:
description: Rust toolchain to use, stable / nightly / beta, or exact version
# The same as in /README.md
default: "stable"
# Update using scripts/update-rust-toolchain.sh
default: "1.76"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it's using toolchain file if not set?

target:
description: Target Rust platform
required: false
Expand All @@ -17,7 +17,6 @@ inputs:
description: Enable Rust cache
required: false
default: "true"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove new lines? I see it more readable rather then on block of test

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what yq tool did that I use to replace version in yaml.

I can try to refactor to use multi-line sed if you wish.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, you dynamically update it...

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just read it from the toolchain file instead of hardcoding?

Suggestion from ChatGPT:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      # Checkout your repository

    - name: Extract Rust toolchain version
      id: rust_toolchain
      run: |
        TOOLCHAIN_VERSION=$(grep channel rust-toolchain.toml | awk '{print $3}' | tr -d '"')
        echo "TOOLCHAIN_VERSION=$TOOLCHAIN_VERSION" >> $GITHUB_ENV
        echo "::set-output name=version::$TOOLCHAIN_VERSION"
      # This command reads the rust-toolchain.toml, extracts the version, and sets it as an environment variable and step output

    # Use the extracted version in subsequent steps
    - name: Use Rust toolchain
      uses: actions-rs/toolchain@v1
      with:
        toolchain: ${{ steps.rust_toolchain.outputs.version }}
        override: true

I would use $GITHUB_OUTPUT though

runs:
using: composite
steps:
Expand All @@ -28,7 +27,6 @@ runs:
toolchain: ${{ inputs.toolchain }}
target: ${{ inputs.target }}
components: ${{ inputs.components }}

- name: Get protoc arch
shell: bash
id: protoc_arch
Expand All @@ -47,7 +45,6 @@ runs:
exit 1
;;
esac

# TODO: Move to AMI and build every day
- name: Install protoc
id: deps-protoc
Expand All @@ -58,18 +55,15 @@ runs:
unzip /tmp/protoc.zip -d ${HOME}/.local
echo "PROTOC=${HOME}/.local/bin/protoc" >> $GITHUB_ENV
export PATH="${PATH}:${HOME}/.local/bin"

- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3
with:
version: "v0.7.1" # Must be the same as in Dockerfile
if: inputs.cache == 'true'

- name: Hash ref_name
id: hashed-ref-name
shell: bash
run: echo "key=$(echo '${{ github.ref_name }}' | sha256sum | cut -d ' ' -f1)" >> $GITHUB_OUTPUT

- name: Cache cargo registry (S3 bucket cache)
uses: strophy/actions-cache@opendal-update
if: inputs.cache == 'true'
Expand All @@ -84,7 +78,6 @@ runs:
restore-keys: |
${{ runner.os }}/cargo/registry/${{ hashFiles('**/Cargo.lock') }}
${{ runner.os }}/cargo/registry/

# TODO: Move to AMI and build every day
- name: Install clang
id: deps-clang
Expand Down
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
ARG ALPINE_VERSION=3.18
ARG PROTOC_VERSION=25.2
ARG RUSTC_WRAPPER

# Update using scripts/update-rust-toolchain.sh
ARG RUST_VERSION=1.76
#
# DEPS: INSTALL AND CACHE DEPENDENCIES
#
Expand Down Expand Up @@ -67,13 +68,13 @@ RUN npm config set --global audit false
# Install latest Rust toolbox

ARG TARGETARCH

ARG RUST_VERSION
# TODO: It doesn't sharing PATH between stages, so we need "source $HOME/.cargo/env" everywhere
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \
--profile minimal \
-y \
# Rust version the same as in /README.md
--default-toolchain stable \
--default-toolchain ${RUST_VERSION} \
--target wasm32-unknown-unknown

# Install protoc - protobuf compiler
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ this repository may be used on the following networks:
- Install prerequisites:
- [node.js](https://nodejs.org/) v20
- [docker](https://docs.docker.com/get-docker/) v20.10+
- [rust](https://www.rust-lang.org/tools/install) v1.73+, with wasm32 target (`rustup target add wasm32-unknown-unknown`)
- [rust](https://www.rust-lang.org/tools/install) v1.76+, with wasm32 target (`rustup target add wasm32-unknown-unknown`)
- [protoc - protobuf compiler](https://github.com/protocolbuffers/protobuf/releases) v25.2+
- if needed, set PROTOC environment variable to location of `protoc` binary
- [wasm-bingen toolchain](https://rustwasm.github.io/wasm-bindgen/):
Expand All @@ -66,7 +66,8 @@ this repository may be used on the following networks:
- `cargo install wasm-bindgen-cli@0.2.85`
- *double-check that wasm-bindgen-cli version above matches wasm-bindgen version in Cargo.lock file*
- *Depending on system, additional packages may need to be installed as a prerequisite for wasm-bindgen-cli. If anything is missing, installation will error and prompt what packages are missing (i.e. clang, llvm, libssl-dev)*
- essential build tools - example for Debian/Ubuntu: `apt install -y build-essential libssl-dev pkg-config clang`

- essential build tools - example for Debian/Ubuntu: `apt install -y build-essential libssl-dev pkg-config clang`
- Run `corepack enable` to enable [corepack](https://nodejs.org/dist/latest/docs/api/corepack.html) and install yarn
- Run `yarn setup` to install dependencies and configure and build all packages
- Run `yarn start` to start the local dev environment built from the sources
Expand Down
3 changes: 2 additions & 1 deletion packages/dapi-grpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ authors = [
"Ivan Shumkov <shumkov@dash.org>",
]
edition = "2021"
rust-version = "1.73"
# Update using scripts/update-rust-toolchain.sh
rust-version = "1.76"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we set it here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand the question.

The rust-version field is an optional key that tells cargo what version of the Rust language and compiler your package can be compiled with.

As we only test on 1.76, we only support this version onwards.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I've never seen such an option, and since it's a minimal value then it's all good.

license = "MIT"

[features]
Expand Down
3 changes: 2 additions & 1 deletion packages/dashpay-contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ name = "dashpay-contract"
description = "DashPay data contract schema and tools"
version = "1.0.0-dev.4"
edition = "2021"
rust-version = "1.73"
# Update using scripts/update-rust-toolchain.sh
rust-version = "1.76"
license = "MIT"

[dependencies]
Expand Down
3 changes: 2 additions & 1 deletion packages/data-contracts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ name = "data-contracts"
description = "Dash Platform system data contracts"
version = "1.0.0-dev.4"
edition = "2021"
rust-version = "1.73"
# Update using scripts/update-rust-toolchain.sh
rust-version = "1.76"
license = "MIT"

[dependencies]
Expand Down
3 changes: 2 additions & 1 deletion packages/dpns-contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ name = "dpns-contract"
description = "DPNS data contract schema and tools"
version = "1.0.0-dev.4"
edition = "2021"
rust-version = "1.73"
# Update using scripts/update-rust-toolchain.sh
rust-version = "1.76"
license = "MIT"

[dependencies]
Expand Down
3 changes: 2 additions & 1 deletion packages/feature-flags-contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ name = "feature-flags-contract"
description = "Feature flags data contract schema and tools"
version = "1.0.0-dev.4"
edition = "2021"
rust-version = "1.73"
# Update using scripts/update-rust-toolchain.sh
rust-version = "1.76"
license = "MIT"

[dependencies]
Expand Down
3 changes: 2 additions & 1 deletion packages/masternode-reward-shares-contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ name = "masternode-reward-shares-contract"
description = "Masternode reward shares data contract schema and tools"
version = "1.0.0-dev.4"
edition = "2021"
rust-version = "1.73"
# Update using scripts/update-rust-toolchain.sh
rust-version = "1.76"
license = "MIT"

[dependencies]
Expand Down
2 changes: 2 additions & 0 deletions packages/rs-dapi-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
name = "rs-dapi-client"
version = "1.0.0-dev.4"
edition = "2021"
# Update using scripts/update-rust-toolchain.sh
rust-version = "1.76"

[features]
default = ["mocks", "offline-testing"]
Expand Down
2 changes: 2 additions & 0 deletions packages/rs-dapi-grpc-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ name = "dapi-grpc-macros"
version = "1.0.0-dev.4"
edition = "2021"
description = "Macros used by dapi-grpc. Internal use only."
# Update using scripts/update-rust-toolchain.sh
rust-version = "1.76"

[lib]
proc-macro = true
Expand Down
3 changes: 2 additions & 1 deletion packages/rs-dpp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
name = "dpp"
version = "1.0.0-dev.4"
edition = "2021"
rust-version = "1.73"
# Update using scripts/update-rust-toolchain.sh
rust-version = "1.76"
authors = [
"Anton Suprunchuk <anton.suprunchuk@gmail.com>",
"Samuel Westrich <sam@dash.org>",
Expand Down
3 changes: 2 additions & 1 deletion packages/rs-drive-abci/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ authors = [
"Igor Markin <igor.markin@dash.org>",
]
edition = "2021"
rust-version = "1.73"
# Update using scripts/update-rust-toolchain.sh
rust-version = "1.76"
license = "MIT"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
3 changes: 2 additions & 1 deletion packages/rs-drive-proof-verifier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
name = "drive-proof-verifier"
version = "1.0.0-dev.4"
edition = "2021"
rust-version = "1.73"
# Update using scripts/update-rust-toolchain.sh
rust-version = "1.76"

crate-type = ["cdylib"]

Expand Down
3 changes: 2 additions & 1 deletion packages/rs-drive-verify-c-binding/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
name = "rs-drive-verify-c-binding"
version = "0.25.16-rc.3"
edition = "2021"
rust-version = "1.73"
# Update using scripts/update-rust-toolchain.sh
rust-version = "1.76"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
Expand Down
3 changes: 2 additions & 1 deletion packages/rs-drive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ authors = [
"Wisdom Ogwu <wisdom@dash.org",
]
edition = "2021"
rust-version = "1.73"
# Update using scripts/update-rust-toolchain.sh
rust-version = "1.76"
license = "MIT"
private = true

Expand Down
3 changes: 2 additions & 1 deletion packages/rs-platform-serialization-derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ authors = ["Samuel Westrich <sam@dash.org>"]
description = "Bincode serialization and deserialization derivations"
version = "1.0.0-dev.4"
edition = "2021"
rust-version = "1.73"
# Update using scripts/update-rust-toolchain.sh
rust-version = "1.76"
license = "MIT"
private = true

Expand Down
3 changes: 2 additions & 1 deletion packages/rs-platform-serialization/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ authors = ["Samuel Westrich <sam@dash.org>"]
description = "Bincode based serialization and deserialization"
version = "1.0.0-dev.4"
edition = "2021"
rust-version = "1.73"
# Update using scripts/update-rust-toolchain.sh
rust-version = "1.76"
license = "MIT"
private = true

Expand Down
3 changes: 2 additions & 1 deletion packages/rs-platform-value-convertible/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ authors = ["Samuel Westrich <sam@dash.org>"]
description = "Convertion to and from platform values"
version = "1.0.0-dev.4"
edition = "2021"
rust-version = "1.73"
# Update using scripts/update-rust-toolchain.sh
rust-version = "1.76"
license = "MIT"
private = true

Expand Down
3 changes: 2 additions & 1 deletion packages/rs-platform-value/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ authors = ["Samuel Westrich <sam@dash.org>"]
description = "A simple value module"
version = "1.0.0-dev.4"
edition = "2021"
rust-version = "1.73"
# Update using scripts/update-rust-toolchain.sh
rust-version = "1.76"
license = "MIT"
private = true

Expand Down
3 changes: 2 additions & 1 deletion packages/rs-platform-version/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ authors = ["Samuel Westrich <sam@dash.org>"]
description = "Bincode based serialization and deserialization"
version = "1.0.0-dev.4"
edition = "2021"
rust-version = "1.73"
# Update using scripts/update-rust-toolchain.sh
rust-version = "1.76"
license = "MIT"
private = true

Expand Down
3 changes: 2 additions & 1 deletion packages/rs-platform-versioning/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ authors = ["Samuel Westrich <sam@dash.org>"]
description = "Version derivation"
version = "1.0.0-dev.4"
edition = "2021"
rust-version = "1.73"
# Update using scripts/update-rust-toolchain.sh
rust-version = "1.76"
license = "MIT"
private = true

Expand Down
2 changes: 2 additions & 0 deletions packages/rs-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
name = "rs-sdk"
version = "1.0.0-dev.4"
edition = "2021"
# Update using scripts/update-rust-toolchain.sh
rust-version = "1.76"

[dependencies]
dpp = { path = "../rs-dpp", features = [
Expand Down
3 changes: 2 additions & 1 deletion packages/simple-signer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
name = "simple-signer"
version = "1.0.0-dev.4"
edition = "2021"
rust-version = "1.73"
# Update using scripts/update-rust-toolchain.sh
rust-version = "1.76"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
3 changes: 2 additions & 1 deletion packages/strategy-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ authors = [
"Paul DeLucia <paul.delucia@dash.org>",
]
edition = "2021"
rust-version = "1.73"
# Update using scripts/update-rust-toolchain.sh
rust-version = "1.76"
license = "MIT"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
3 changes: 2 additions & 1 deletion packages/wasm-dpp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
name = "wasm-dpp"
version = "1.0.0-dev.4"
edition = "2021"
rust-version = "1.73"
# Update using scripts/update-rust-toolchain.sh
rust-version = "1.76"
authors = ["Anton Suprunchuk <anton.suprunchuk@gmail.com>"]

[lib]
Expand Down
2 changes: 1 addition & 1 deletion packages/wasm-dpp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Library consumers must ignore class names minification for `@dashevo/wasm-dpp` l

## Prerequisites

- Install [Rust](https://www.rust-lang.org/tools/install) v1.73+
- Install [Rust](https://www.rust-lang.org/tools/install) v1.76+
- Add wasm32 target: `$ rustup target add wasm32-unknown-unknown`
- Install wasm-bingen-cli: `cargo install wasm-bindgen-cli@0.2.85`
- *double-check that wasm-bindgen-cli version above matches wasm-bindgen version in Cargo.lock file*
Expand Down
3 changes: 2 additions & 1 deletion packages/withdrawals-contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ name = "withdrawals-contract"
description = "Witdrawals data contract schema and tools"
version = "1.0.0-dev.4"
edition = "2021"
rust-version = "1.73"
# Update using scripts/update-rust-toolchain.sh
rust-version = "1.76"
license = "MIT"

[dependencies]
Expand Down
5 changes: 3 additions & 2 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[toolchain]
# Rust version the same as in /README.md
channel = "stable"

# Update using scripts/update-rust-toolchain.sh
channel = "1.76"

targets = ["wasm32-unknown-unknown"]
Loading