Skip to content

Commit

Permalink
Merge pull request #206 from Concordium/release/8.0
Browse files Browse the repository at this point in the history
Release/8.0
  • Loading branch information
soerenbf authored Jun 27, 2023
2 parents 93cd659 + 7e29cf5 commit aa05be9
Show file tree
Hide file tree
Showing 53 changed files with 2,033 additions and 678 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Build, lint and typecheck examples

on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
Expand All @@ -13,7 +13,7 @@ on:

env:
NODE_VERSION: 18.16.0
RUST_VERSION: 1.62
RUST_VERSION: 1.65
RUST_FMT: nightly-2023-04-01-x86_64-unknown-linux-gnu

jobs:
Expand All @@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
with:
submodules: "recursive"

- uses: actions/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "deps/concordium-base"]
path = deps/concordium-base
url = https://github.com/Concordium/concordium-base.git
url = ../concordium-base.git
4 changes: 2 additions & 2 deletions .markdown-linkcheck.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"ignorePatterns": [
{
"pattern": "classes/Common_GRPC_Client.ConcordiumNodeClient.html"
"pattern": "classes/Common_GRPC_Client.ConcordiumGRPCClient.html"
}
]
}
}
2 changes: 1 addition & 1 deletion deps/concordium-base
Submodule concordium-base updated 50 files
+1 −1 .github/workflows/build-test-sources.yaml
+1 −1 concordium-contracts-common
+1 −1 concordium-grpc-api
+13 −0 haskell-src/Concordium/Crypto/DummyData.hs
+24 −3 haskell-src/Concordium/GRPC2.hs
+13 −0 haskell-src/Concordium/Genesis/Data.hs
+21 −2 haskell-src/Concordium/Genesis/Data/BaseV1.hs
+1 −0 haskell-src/Concordium/Logger.hs
+3 −0 haskell-src/Concordium/Types.hs
+11 −0 haskell-src/Concordium/Types/Accounts.hs
+5 −0 haskell-src/Concordium/Types/Block.hs
+8 −1 haskell-src/Concordium/Types/Parameters.hs
+40 −10 haskell-src/Concordium/Types/Queries.hs
+1 −1 haskell-src/Concordium/Types/SeedState.hs
+1 −1 haskell-src/Concordium/Types/Transactions.hs
+127 −5 identity-provider-service/Cargo.lock
+1 −1 identity-provider-service/Cargo.toml
+2 −1 identity-provider-service/html/attribute_form.html
+181 −32 idiss/Cargo.lock
+1 −1 idiss/Cargo.toml
+180 −31 mobile_wallet/Cargo.lock
+2 −2 mobile_wallet/Cargo.toml
+127 −5 rust-bins/Cargo.lock
+1 −1 rust-bins/Cargo.toml
+143 −15 rust-src/Cargo.lock
+2 −0 rust-src/concordium_base/CHANGELOG.md
+8 −6 rust-src/concordium_base/Cargo.toml
+27 −4 rust-src/concordium_base/src/base.rs
+5 −17 rust-src/concordium_base/src/cis2_types.rs
+258 −0 rust-src/concordium_base/src/cis4_types.rs
+18 −1 rust-src/concordium_base/src/common/serialize.rs
+4 −0 rust-src/concordium_base/src/common/types.rs
+70 −34 rust-src/concordium_base/src/id/id_proof_types.rs
+103 −86 rust-src/concordium_base/src/id/id_prover.rs
+128 −106 rust-src/concordium_base/src/id/id_verifier.rs
+41 −38 rust-src/concordium_base/src/id/sigma_protocols/vcom_eq.rs
+74 −6 rust-src/concordium_base/src/id/types.rs
+3 −0 rust-src/concordium_base/src/lib.rs
+7 −2 rust-src/concordium_base/src/pedersen_commitment/key.rs
+9 −1 rust-src/concordium_base/src/pedersen_commitment/randomness.rs
+505 −0 rust-src/concordium_base/src/web3id/did.rs
+1,818 −0 rust-src/concordium_base/src/web3id/mod.rs
+4 −0 smart-contracts/wasm-chain-integration/CHANGELOG.md
+4 −4 smart-contracts/wasm-chain-integration/Cargo.lock
+3 −3 smart-contracts/wasm-chain-integration/Cargo.toml
+66 −14 smart-contracts/wasm-chain-integration/src/v1/trie/low_level.rs
+3 −3 smart-contracts/wasm-fuzz/Cargo.toml
+3 −3 smart-contracts/wasm-test/Cargo.lock
+4 −0 smart-contracts/wasm-transform/CHANGELOG.md
+2 −2 smart-contracts/wasm-transform/Cargo.toml
8 changes: 5 additions & 3 deletions examples/client/getBlockChainParameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
ChainParameters,
createConcordiumClient,
isChainParametersV1,
isChainParametersV2,
} from '@concordium/node-sdk';
import { credentials } from '@grpc/grpc-js';

Expand Down Expand Up @@ -54,12 +55,13 @@ const client = createConcordiumClient(

const euroPerEnergy =
cp.euroPerEnergy.numerator + '/' + cp.euroPerEnergy.denominator;
console.log('Election difficulty:', cp.electionDifficulty);
console.log('Account creation limit:', cp.accountCreationLimit);
console.log('Euro per Energy:', euroPerEnergy);

// Check if the ChainParameters is V1, which it will be for all newer blocks
if (isChainParametersV1(cp)) {
// Check version of chain parameters
if (isChainParametersV2(cp)) {
console.log('Minimum block time', cp.minBlockTime);
} else if (isChainParametersV1(cp)) {
console.log('Minimum equity capital:', cp.minimumEquityCapital);
} else {
console.log(
Expand Down
11 changes: 9 additions & 2 deletions examples/client/getElectionInfo.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { parseEndpoint } from '../shared/util';
import { createConcordiumClient, ElectionInfo } from '@concordium/node-sdk';
import {
createConcordiumClient,
ElectionInfo,
isElectionInfoV0,
} from '@concordium/node-sdk';
import { credentials } from '@grpc/grpc-js';

import meow from 'meow';
Expand Down Expand Up @@ -57,7 +61,10 @@ const client = createConcordiumClient(
const sortedBakers = bakers.sort((xs, ys) => ys[1] - xs[1]);

console.log('Bakers sorted by lottery power:', sortedBakers);
console.log('Election difficulty:', electionInfo.electionDifficulty);
console.log('Election nonce:', electionInfo.electionNonce);

if (isElectionInfoV0(electionInfo)) {
console.log('Election difficulty:', electionInfo.electionDifficulty);
}
// #endregion documentation-snippet
})();
30 changes: 29 additions & 1 deletion packages/common/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
# Changelog

## Unreleased
## 8.0.0

### Breaking changes

- Bumped @concordium/rust-bindings to 1.0.0. (Throws proper `Error`s when execution fails for any WASM entrypoint, with improved error messages)
- Updated `types.ts` to conform to updated GRPC API, which includes adding more variants to existing types (all new variants take effect from protocol version 6):
- `ChainParametersV2` added to `ChainParameters`
- `BlockInfo` changed to `BlockInfoV0 | BlockInfoV1`
- `ConsensusStatus` changed to `ConsensusStatusV0 | ConsensusStatusV1`
- `ElectionInfo` changed to `ElectionInfoV0 | ElectionInfoV1`

### Fixed

- Cost calculation for `deployModule` transaction.
- Fixed a bug where protocol version was different (i.e. 1 less than what it should be) when using the gRPCv2 API (compared to what is returned by the gRPCv1 API).

### Changes

Expand All @@ -9,9 +23,23 @@
### Added

- A `parseWallet` function to parse wallet export files
- Helper functions to determine version of versioned types mentioned in "Breaking Changes" have been added.
- Support for new chain update types.
- Function `uleb128DecodeWithIndex` that can also parse more than a single ULEB128 bigint
- Added `tokenAddressFromBase58` and `tokenAddressToBase58` to CIS2

### Changed

- The following functions now all have an additional parameter controlling whether errors are in a verbose format or not:
- `deserializeContractState`
- `deserializeReceiveReturnValue`
- `deserializeReceiveError`
- `deserializeInitError`
- `deserializeTypeValue`
- `serializeInitContractParameters`
- `serializeUpdateContractParameters`
- `serializeTypeValue`

## 7.0.1 2023-05-25

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@concordium/common-sdk",
"version": "7.0.1",
"version": "8.0.0",
"license": "Apache-2.0",
"engines": {
"node": ">=14.16.0"
Expand Down Expand Up @@ -51,7 +51,7 @@
"build-dev": "tsc"
},
"dependencies": {
"@concordium/rust-bindings": "0.12.0",
"@concordium/rust-bindings": "1.0.0",
"@grpc/grpc-js": "^1.3.4",
"@noble/ed25519": "^1.7.1",
"@protobuf-ts/runtime-rpc": "^2.8.2",
Expand Down
8 changes: 4 additions & 4 deletions packages/common/src/GRPCClient.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* This is the GRPC-Client used by both the Web-SDK and the NodeJS-SDK. Check
* out the {@link ConcordiumNodeClient}
* out the {@link ConcordiumGRPCClient}
*
* @module Common GRPC-Client
*/
Expand Down Expand Up @@ -45,10 +45,10 @@ export type FindInstanceCreationReponse = {
* A concordium-node specific gRPC client wrapper.
*
* @example
* import ConcordiumNodeClient from "..."
* const client = new ConcordiumNodeClient('127.0.0.1', 20000, credentials, metadata, 15000);
* import { ConcordiumGRPCClient } from "..."
* const client = new ConcordiumGRPCClient('127.0.0.1', 20000, credentials, metadata, 15000);
*/
export default class ConcordiumNodeClient {
export class ConcordiumGRPCClient {
client: QueriesClient;

/**
Expand Down
Loading

0 comments on commit aa05be9

Please sign in to comment.