Skip to content

Commit

Permalink
Merge branch 'main' into feat/unified-configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
ffarall committed Mar 1, 2025
2 parents 0dc3eb6 + d02ed35 commit c27b65c
Show file tree
Hide file tree
Showing 39 changed files with 2,363 additions and 1,354 deletions.
6 changes: 3 additions & 3 deletions .github/workflow-templates/setup-pnpm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ description: Installs pnpm and caches the pnpm store

inputs:
node_version:
description: 'Node.js version'
default: '22'
description: "Node.js version"
default: "22"
required: false

runs:
Expand Down Expand Up @@ -33,4 +33,4 @@ runs:
path: ${{ steps.get_pnpm_store.outputs.store_path }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
${{ runner.os }}-pnpm-store-
4 changes: 2 additions & 2 deletions .github/workflows/api-augment-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: pnpm/action-setup@v4
with:
version: 9

- name: Use Node.js
uses: actions/setup-node@v4
with:
Expand All @@ -38,4 +38,4 @@ jobs:
cd api-augment
pnpm publish ${{ github.event.inputs.DryRun && '--dry-run' || '' }} --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
4 changes: 2 additions & 2 deletions .github/workflows/api-augment-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
uses: mozilla-actions/sccache-action@v0.0.4
- uses: actions-rust-lang/setup-rust-toolchain@v1.8
with:
cache: false
cache: false
- uses: rui314/setup-mold@v1
- uses: ./.github/workflow-templates/setup-pnpm
- name: Install libpq-dev
Expand All @@ -52,4 +52,4 @@ jobs:
draft: true
title: "Upgrade TypeScript API for runtime-${{ github.event.inputs.sha }}"
reviewers: "moonsong-coredev"
labels: "B0-silent,D2-notlive"
labels: "B0-silent,D2-notlive"
174 changes: 87 additions & 87 deletions .github/workflows/rust-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,95 +9,95 @@
name: Rust Tests

on:
pull_request:
push:
branches:
- main
workflow_dispatch:
pull_request:
push:
branches:
- main
workflow_dispatch:

jobs:
setup:
runs-on: ubuntu-latest
outputs:
node_changed: ${{ steps.node_check.outputs.changed }}
env:
SKIP_BUILD_LABEL_PRESENT: ${{ contains(github.event.pull_request.labels.*.name, 'skip-node-build') }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check if Parachain Node needs rebuild
id: node_check
run: |
BASE_SHA="${{ github.event.pull_request.base.sha || github.event.before }}"
HEAD_SHA="${{ github.sha }}"
setup:
runs-on: ubuntu-latest
outputs:
node_changed: ${{ steps.node_check.outputs.changed }}
env:
SKIP_BUILD_LABEL_PRESENT: ${{ contains(github.event.pull_request.labels.*.name, 'skip-node-build') }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check if Parachain Node needs rebuild
id: node_check
run: |
BASE_SHA="${{ github.event.pull_request.base.sha || github.event.before }}"
HEAD_SHA="${{ github.sha }}"
if [[ "${{ env.SKIP_BUILD_LABEL_PRESENT }}" != "true" ]] && git diff --name-only $BASE_SHA $HEAD_SHA | grep -E '^(client|node|pallets|runtime)/|^Cargo\.toml$'; then
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "Comparing changes from $BASE_SHA to $HEAD_SHA"
echo "changed=false" >> $GITHUB_OUTPUT
fi
if [[ "${{ env.SKIP_BUILD_LABEL_PRESENT }}" != "true" ]] && git diff --name-only $BASE_SHA $HEAD_SHA | grep -E '^(client|node|pallets|runtime)/|^Cargo\.toml$'; then
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "Comparing changes from $BASE_SHA to $HEAD_SHA"
echo "changed=false" >> $GITHUB_OUTPUT
fi
prepare:
needs: [setup]
if: needs.setup.outputs.node_changed == 'true'
name: Prepare artifacts
runs-on: ubuntu-latest
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
CARGO_INCREMENTAL: "0"
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v4
with:
# By default actions/checkout checks out a merge commit. Check out the PR head instead.
# https://github.com/actions/checkout#checkout-pull-request-head-commit-instead-of-merge-commit
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions-rust-lang/setup-rust-toolchain@v1.8
with:
cache: false
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.4
- uses: rui314/setup-mold@v1
- name: Install nextest
uses: taiki-e/install-action@nextest
# Install libpq-dev
- name: Install libpq-dev
run: sudo apt-get update && sudo apt-get install -y libpq-dev
- name: Install Protoc
uses: arduino/setup-protoc@v3
- name: Build and archive tests
run: cargo nextest archive --archive-file nextest-archive.tar.zst
- name: Upload archive to workflow
uses: actions/upload-artifact@v4
with:
name: nextest-archive
path: nextest-archive.tar.zst
prepare:
needs: [setup]
if: needs.setup.outputs.node_changed == 'true'
name: Prepare artifacts
runs-on: ubuntu-latest
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
CARGO_INCREMENTAL: "0"
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v4
with:
# By default actions/checkout checks out a merge commit. Check out the PR head instead.
# https://github.com/actions/checkout#checkout-pull-request-head-commit-instead-of-merge-commit
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions-rust-lang/setup-rust-toolchain@v1.8
with:
cache: false
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.4
- uses: rui314/setup-mold@v1
- name: Install nextest
uses: taiki-e/install-action@nextest
# Install libpq-dev
- name: Install libpq-dev
run: sudo apt-get update && sudo apt-get install -y libpq-dev
- name: Install Protoc
uses: arduino/setup-protoc@v3
- name: Build and archive tests
run: cargo nextest archive --archive-file nextest-archive.tar.zst
- name: Upload archive to workflow
uses: actions/upload-artifact@v4
with:
name: nextest-archive
path: nextest-archive.tar.zst

all-rust-tests:
needs: [setup, prepare]
if: needs.setup.outputs.node_changed == 'true'
name: Run all tests (/w partitioning)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
partition: [1, 2]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install nextest
uses: taiki-e/install-action@nextest
- name: Download archive
uses: actions/download-artifact@v4
with:
name: nextest-archive
- name: Run Tests for All Projects!
run: |
~/.cargo/bin/cargo-nextest nextest run \
--archive-file nextest-archive.tar.zst \
--partition count:${{ matrix.partition }}/2
all-rust-tests:
needs: [setup, prepare]
if: needs.setup.outputs.node_changed == 'true'
name: Run all tests (/w partitioning)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
partition: [1, 2]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install nextest
uses: taiki-e/install-action@nextest
- name: Download archive
uses: actions/download-artifact@v4
with:
name: nextest-archive
- name: Run Tests for All Projects!
run: |
~/.cargo/bin/cargo-nextest nextest run \
--archive-file nextest-archive.tar.zst \
--partition count:${{ matrix.partition }}/2
2 changes: 1 addition & 1 deletion .github/workflows/types-bundle-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ jobs:
package: types-bundle/package.json
registry: https://registry.npmjs.org/
access: public
dry-run: ${{ github.event.inputs.dry_run }}
dry-run: ${{ github.event.inputs.dry_run }}
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ trie-db = { version = "0.29.1", default-features = false }
sp-core = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "stable2409", default-features = false }
sp-io = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "stable2409", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "stable2409", default-features = false }
sp-runtime-interface = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "stable2409", default-features = false }
sp-std = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "stable2409", default-features = false }
# TODO: Change sp-trie to the next stable version when it's released with the applied fix of this [PR](https://github.com/paritytech/polkadot-sdk/pull/6486)
sp-trie = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "master", default-features = false }
Expand Down
45 changes: 45 additions & 0 deletions api-augment/dist/types/interfaces/augment-api-rpc.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,12 @@ import type {
} from "@polkadot/types/interfaces/system";
import type { IExtrinsic, Observable } from "@polkadot/types/types";
import type {
AddFilesToForestStorageResult,
CheckpointChallenge,
FileMetadata,
GetFileFromFileStorageResult,
LoadFileInStorageResult,
RemoveFilesFromForestStorageResult,
SaveFileToDisk
} from "@storagehub/api-augment/interfaces/storagehubclient";
export type __AugmentedRpc = AugmentedRpc<() => unknown>;
Expand Down Expand Up @@ -1070,6 +1072,28 @@ declare module "@polkadot/rpc-core/types/jsonrpc" {
>;
};
storagehubclient: {
/**
* Add files to the forest storage. Useful when doing manual maintenance.
**/
addFilesToForestStorage: AugmentedRpc<
(
forest_key: Option<H256> | null | Uint8Array | H256 | string,
metadata_of_files_to_add:
| Vec<FileMetadata>
| (
| FileMetadata
| {
owner?: any;
bucket_id?: any;
location?: any;
file_size?: any;
fingerprint?: any;
}
| string
| Uint8Array
)[]
) => Observable<AddFilesToForestStorageResult>
>;
/**
* Add key to exclude list. Exclude type can be `file`, `user`, `bucket` and `fingerprint`.
**/
Expand Down Expand Up @@ -1177,6 +1201,27 @@ declare module "@polkadot/rpc-core/types/jsonrpc" {
* Remove keys of BCSV type for the Blockchain Service.
**/
removeBcsvKeys: AugmentedRpc<(keystore_path: Text | string) => Observable<ITuple<[]>>>;
/**
* Remove a list of files from the file storage. Useful when doing manual maintenance.
**/
removeFilesFromFileStorage: AugmentedRpc<
(file_keys: Vec<H256> | (H256 | string | Uint8Array)[]) => Observable<ITuple<[]>>
>;
/**
* Remove files from the forest storage. Useful when doing manual maintenance.
**/
removeFilesFromForestStorage: AugmentedRpc<
(
forest_key: Option<H256> | null | Uint8Array | H256 | string,
file_keys: Vec<H256> | (H256 | string | Uint8Array)[]
) => Observable<RemoveFilesFromForestStorageResult>
>;
/**
* Remove all files under a prefix from the file storage. Useful when doing manual maintenance.
**/
removeFilesWithPrefixFromFileStorage: AugmentedRpc<
(prefix: H256 | string | Uint8Array) => Observable<ITuple<[]>>
>;
/**
* Remove key from exclude list
**/
Expand Down
4 changes: 4 additions & 0 deletions api-augment/dist/types/interfaces/augment-types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1318,6 +1318,7 @@ import type {
import type { XcmPaymentApiError } from "@polkadot/types/interfaces/xcmPaymentApi";
import type { Error } from "@polkadot/types/interfaces/xcmRuntimeApi";
import type {
AddFilesToForestStorageResult,
BackupStorageProvider,
BackupStorageProviderId,
BucketId,
Expand Down Expand Up @@ -1353,6 +1354,7 @@ import type {
QueryProviderMultiaddressesError,
QueryStorageProviderCapacityError,
RandomnessOutput,
RemoveFilesFromForestStorageResult,
ReputationWeightType,
SaveFileToDisk,
ShouldRemoveFile,
Expand Down Expand Up @@ -1391,6 +1393,7 @@ declare module "@polkadot/types/types/registry" {
ActiveGiltsTotal: ActiveGiltsTotal;
ActiveIndex: ActiveIndex;
ActiveRecovery: ActiveRecovery;
AddFilesToForestStorageResult: AddFilesToForestStorageResult;
Address: Address;
AliveContractInfo: AliveContractInfo;
AllowedSlots: AllowedSlots;
Expand Down Expand Up @@ -2276,6 +2279,7 @@ declare module "@polkadot/types/types/registry" {
RelayHash: RelayHash;
Releases: Releases;
Remark: Remark;
RemoveFilesFromForestStorageResult: RemoveFilesFromForestStorageResult;
Renouncing: Renouncing;
RentProjection: RentProjection;
ReplacementTimes: ReplacementTimes;
Expand Down
12 changes: 12 additions & 0 deletions api-augment/dist/types/interfaces/storagehubclient/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ import type {
u64
} from "@polkadot/types-codec";
import type { AccountId, BlockNumber, H256 } from "@polkadot/types/interfaces/runtime";
/** @name AddFilesToForestStorageResult */
export interface AddFilesToForestStorageResult extends Enum {
readonly isSuccess: boolean;
readonly isForestNotFound: boolean;
readonly type: "Success" | "ForestNotFound";
}
/** @name BackupStorageProvider */
export interface BackupStorageProvider extends Struct {
readonly capacity: StorageDataUnit;
Expand Down Expand Up @@ -238,6 +244,12 @@ export interface QueryStorageProviderCapacityError extends Enum {
}
/** @name RandomnessOutput */
export interface RandomnessOutput extends H256 {}
/** @name RemoveFilesFromForestStorageResult */
export interface RemoveFilesFromForestStorageResult extends Enum {
readonly isSuccess: boolean;
readonly isForestNotFound: boolean;
readonly type: "Success" | "ForestNotFound";
}
/** @name ReputationWeightType */
export interface ReputationWeightType extends u32 {}
/** @name SaveFileToDisk */
Expand Down
Loading

0 comments on commit c27b65c

Please sign in to comment.