Skip to content

Commit

Permalink
Merge pull request #381 from Concordium/pipeline-fix-rust-version
Browse files Browse the repository at this point in the history
Fix the rust version used in pipeline
  • Loading branch information
limemloh authored Aug 7, 2024
2 parents 6180775 + 83e61e1 commit 98a2736
Show file tree
Hide file tree
Showing 16 changed files with 407 additions and 107 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/deploy-ccd-js-gen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,15 @@ jobs:
node-version: ${{ env.NODE_VERSION }}
cache: yarn

- name: Install rust
run: rustup default ${{ env.RUST_VERSION }}

- uses: Swatinem/rust-cache@v2
with:
workspaces: |
packages/rust-bindings
deps/concordium-base/rust-src
deps/concordium-base/concordium-contracts-common
deps/concordium-base/smart-contracts/contracts-common
- name: Cache dependencies
id: yarn-cache
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/deploy-react-components.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,15 @@ jobs:
node-version: ${{ env.NODE_VERSION }}
cache: yarn

- name: Install rust
run: rustup default ${{ env.RUST_VERSION }}

- uses: Swatinem/rust-cache@v2
with:
workspaces: |
packages/rust-bindings
deps/concordium-base/rust-src
deps/concordium-base/concordium-contracts-common
deps/concordium-base/smart-contracts/contracts-common
- name: Cache dependencies
id: yarn-cache
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/deploy-rust-bindings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ concurrency:

env:
NODE_VERSION: 18.16.0
RUST_VERSION: 1.73
RUST_VERSION: 1.73 ## Make sure to update wasm-pack to 0.13 or higher when this is rust version 1.74 or higher
RUST_FMT: nightly-2023-04-01-x86_64-unknown-linux-gnu

jobs:
Expand All @@ -38,12 +38,15 @@ jobs:
node-version: ${{ env.NODE_VERSION }}
cache: yarn

- name: Install rust
run: rustup default ${{ env.RUST_VERSION }}

- uses: Swatinem/rust-cache@v2
with:
workspaces: |
packages/rust-bindings
deps/concordium-base/rust-src
deps/concordium-base/concordium-contracts-common
deps/concordium-base/smart-contracts/contracts-common
- name: Cache dependencies
id: yarn-cache
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/deploy-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,15 @@ jobs:
node-version: ${{ env.NODE_VERSION }}
cache: yarn

- name: Install rust
run: rustup default ${{ env.RUST_VERSION }}

- uses: Swatinem/rust-cache@v2
with:
workspaces: |
packages/rust-bindings
deps/concordium-base/rust-src
deps/concordium-base/concordium-contracts-common
deps/concordium-base/smart-contracts/contracts-common
- name: Cache dependencies
id: yarn-cache
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/deploy-wallet-connectors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,15 @@ jobs:
node-version: ${{ env.NODE_VERSION }}
cache: yarn

- name: Install rust
run: rustup default ${{ env.RUST_VERSION }}

- uses: Swatinem/rust-cache@v2
with:
workspaces: |
packages/rust-bindings
deps/concordium-base/rust-src
deps/concordium-base/concordium-contracts-common
deps/concordium-base/smart-contracts/contracts-common
- name: Cache dependencies
id: yarn-cache
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
workspaces: |
packages/rust-bindings
deps/concordium-base/rust-src
deps/concordium-base/concordium-contracts-common
deps/concordium-base/smart-contracts/contracts-common
- name: Build
run: yarn build-ci
Expand Down Expand Up @@ -331,7 +331,7 @@ jobs:
workspaces: |
packages/rust-bindings
deps/concordium-base/rust-src
deps/concordium-base/concordium-contracts-common
deps/concordium-base/smart-contracts/contracts-common
- name: Run clippy
run: cargo clippy --color=always --tests --benches -- -Dclippy::all
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Yarn stuff
# Yarn stuff
.pnp.*
.yarn/*
!.yarn/patches
Expand Down Expand Up @@ -45,3 +45,5 @@ package-lock.json

# MacOS
.DS_Store

.vscode
8 changes: 8 additions & 0 deletions packages/rust-bindings/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 3.2.1

### Fixed

- The build pipeline was using rust version `1.79` instead of the version specified as part of the workflow.
This caused runtime error `unreachable` for the WebAssembly module for certain operations.
Fixing the pipeline to use `1.73` as intended, resolved the issue.

## 3.2.0

### Added
Expand Down
2 changes: 1 addition & 1 deletion packages/rust-bindings/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@concordium/rust-bindings",
"version": "3.2.0",
"version": "3.2.1",
"license": "Apache-2.0",
"engines": {
"node": ">=16"
Expand Down
23 changes: 0 additions & 23 deletions packages/rust-bindings/packages/wallet/src/aux_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ use rand::thread_rng;
use serde::{Deserialize as SerdeDeserialize, Serialize as SerdeSerialize};
use serde_json::{from_str, from_value, Value as SerdeValue};
use std::{collections::BTreeMap, convert::TryInto};
use thiserror::Error;

#[derive(SerdeSerialize, SerdeDeserialize)]
#[serde(bound(serialize = "P: Pairing", deserialize = "P: Pairing"))]
Expand Down Expand Up @@ -505,28 +504,6 @@ pub struct UnsignedCredentialInput {
cred_number: u8,
}

struct AttributeRandomness(BTreeMap<AttributeTag, PedersenRandomness<ArCurve>>);

#[derive(Debug, Error)]
pub enum AttributeError {
#[error("Missing randomness for given attribute tag.")]
NotFound,
}

impl HasAttributeRandomness<ArCurve> for AttributeRandomness {
type ErrorType = AttributeError;

fn get_attribute_commitment_randomness(
&self,
attribute_tag: &AttributeTag,
) -> Result<PedersenRandomness<ArCurve>, Self::ErrorType> {
match self.0.get(attribute_tag) {
Some(v) => Ok(v.clone()),
None => Err(AttributeError::NotFound),
}
}
}

#[derive(SerdeSerialize)]
#[serde(rename_all = "camelCase")]
pub struct BakerKeys {
Expand Down
7 changes: 7 additions & 0 deletions packages/sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 7.5.1

### Fixed

- Update `@concordium/rust-bindings` to `3.2.1` which fixes an issue causing runtime error `unreachable` for the internal WebAssembly module.
- Update JSON serialization of `AccountTransactionPayload` through `AccountTransactionPayloadHandler` to correctly serialize `CcdAmount` as `string`

## 7.5.0

### Added
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@concordium/web-sdk",
"version": "7.5.0",
"version": "7.5.1",
"license": "Apache-2.0",
"engines": {
"node": ">=16"
Expand Down
Loading

0 comments on commit 98a2736

Please sign in to comment.