Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feature/zombienet-tes…
Browse files Browse the repository at this point in the history
…t-asset-hub
  • Loading branch information
magecnion committed Oct 17, 2024
2 parents 079d94d + ea558d2 commit 3191faa
Show file tree
Hide file tree
Showing 28 changed files with 45,655 additions and 982 deletions.
126 changes: 97 additions & 29 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
outputs:
is_release_version: ${{ steps.check_version.outputs.is_release_version }}

prepare-release:
srtool_build:
needs: check-version
runs-on: ubuntu-latest
strategy:
Expand All @@ -54,53 +54,121 @@ jobs:
package: ${{ matrix.runtime.package }}
runtime_dir: ${{ matrix.runtime.path }}
tag: 1.74.0
- name: Summary
id: summary
- name: Export output info
run: |
echo '${{ steps.srtool_build.outputs.json }}' | jq . > ${{ matrix.runtime.name }}-srtool-digest.json
cat ${{ matrix.runtime.name }}-srtool-digest.json
echo "Runtime location: ${{ steps.srtool_build.outputs.wasm }}"
RUSTC_VERSION=$(jq '.info.rustc' < ${{ matrix.runtime.name }}-srtool-digest.json)
SRTOOL_VERSION=$(jq '.info.generator.version' < ${{ matrix.runtime.name }}-srtool-digest.json)
echo "rustc_version='$RUSTC_VERSION'" >> $GITHUB_OUTPUT
echo "srtool_version=$SRTOOL_VERSION" >> $GITHUB_OUTPUT
echo '${{ steps.srtool_build.outputs.json }}' | jq . > srtool-digest.json
- name: Upload Laos Wasm Artifact
uses: actions/upload-artifact@v3
with:
name: laos-wasm
path: |
${{ steps.srtool_build.outputs.wasm }}
${{ steps.srtool_build.outputs.wasm_compressed }}
srtool-digest.json
srtool_build_paseo:
needs: check-version
runs-on: ubuntu-latest
strategy:
matrix:
runtime:
- { name: "laos", package: "laos-runtime", path: "runtime/laos" }
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- uses: ./.github/actions/cache
with:
cache-key: build_and_push
- name: Srtool build for paseo
id: srtool_build_paseo
uses: chevdor/[email protected]
env:
BUILD_OPTS: "--features paseo"
with:
chain: ${{ matrix.runtime.name }}
package: ${{ matrix.runtime.package }}
runtime_dir: ${{ matrix.runtime.path }}
tag: 1.74.0
- name: Export output info
run: |
echo '${{ steps.srtool_build_paseo.outputs.json }}' | jq . > srtool-digest.json
- name: Upload Paseo Wasm Artifact
uses: actions/upload-artifact@v3
with:
name: paseo-wasm
path: |
${{ steps.srtool_build_paseo.outputs.wasm }}
${{ steps.srtool_build_paseo.outputs.wasm_compressed }}
srtool-digest.json
prepare-release:
needs: [srtool_build, srtool_build_paseo]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download Laos Wasm Artifact
uses: actions/download-artifact@v3
with:
name: laos-wasm
path: laos-wasm
- name: Download Paseo Wasm Artifact
uses: actions/download-artifact@v3
with:
name: paseo-wasm
path: paseo-wasm
- name: Install subwasm ${{ env.SUBWASM_VERSION }}
run: |
wget https://github.com/chevdor/subwasm/releases/download/v${{ env.SUBWASM_VERSION }}/subwasm_linux_amd64_v${{ env.SUBWASM_VERSION }}.deb
sudo dpkg -i subwasm_linux_amd64_v${{ env.SUBWASM_VERSION }}.deb
subwasm --version
- name: Extract metadata
id: metadata
run: |
subwasm --json info ${{ steps.srtool_build.outputs.wasm }} > ${{ matrix.runtime.name }}-info.json
subwasm info ${{ steps.srtool_build.outputs.wasm }} > ${{ matrix.runtime.name }}-info.txt
cat ${{ matrix.runtime.name }}-info.txt
LAOS_COMPRESSED_WASM="laos-wasm/runtime/laos/target/srtool/release/wbuild/laos-runtime/laos_runtime.compact.compressed.wasm"
LAOS_PASEO_COMPRESSED_WASM="paseo-wasm/runtime/laos/target/srtool/release/wbuild/laos-runtime/laos_runtime.compact.compressed.wasm"
subwasm --json info $LAOS_COMPRESSED_WASM > laos-info.json
subwasm info $LAOS_COMPRESSED_WASM > laos-info.txt
subwasm --json info $LAOS_PASEO_COMPRESSED_WASM > paseo-info.json
subwasm info $LAOS_PASEO_COMPRESSED_WASM > paseo-info.txt
subwasm --json info ${{ steps.srtool_build.outputs.wasm_compressed }} > ${{ matrix.runtime.name }}-subwam-info.json
subwasm info ${{ steps.srtool_build.outputs.wasm_compressed }} > ${{ matrix.runtime.name }}-subwam-info.txt
cat ${{ matrix.runtime.name }}-subwam-info.txt
RUSTC_VERSION_POLKA=$(jq '.info.rustc' < laos-wasm/srtool-digest.json)
SRTOOL_VERSION_POLKA=$(jq '.info.generator.version' < laos-wasm/srtool-digest.json)
RUSTC_VERSION_PASEO=$(jq '.info.rustc' < paseo-wasm/srtool-digest.json)
SRTOOL_VERSION_PASEO=$(jq '.info.generator.version' < paseo-wasm/srtool-digest.json)
echo "rustc_version_polka='$RUSTC_VERSION_POLKA'" >> $GITHUB_OUTPUT
echo "srtool_version_polka=$SRTOOL_VERSION_POLKA" >> $GITHUB_OUTPUT
echo "rustc_version_paseo='$RUSTC_VERSION_PASEO'" >> $GITHUB_OUTPUT
echo "srtool_version_paseo=$SRTOOL_VERSION_PASEO" >> $GITHUB_OUTPUT
- name: Update Release Description with subwasm info
run: |
gh release view ${{ github.ref_name }} --json body -q .body > description.txt
RUSTC_VERSION=$(echo ${{ steps.summary.outputs.rustc_version }} | tr -d '"')
SRTOOL_VERSION=${{ steps.summary.outputs.srtool_version }}
printf "\n\n## ${{ matrix.runtime.name }} runtime\nThis runtime was built using %s with srtool %s\n" "$RUSTC_VERSION" "$SRTOOL_VERSION" >> description.txt
RUSTC_VERSION_POLKA=$(echo ${{ steps.metadata.outputs.rustc_version_polka }} | tr -d '"')
SRTOOL_VERSION_POLKA=${{ steps.metadata.outputs.srtool_version_polka }}
RUSTC_VERSION_PASEO=$(echo ${{ steps.metadata.outputs.rustc_version_paseo }} | tr -d '"')
SRTOOL_VERSION_PASEO=${{ steps.metadata.outputs.srtool_version_paseo }}
printf "\n\n## Laos Runtime for Polkadot\nThis runtime was built using $RUSTC_VERSION_POLKA with srtool $SRTOOL_VERSION_POLKA\n" >> description.txt
echo '```' >> description.txt
cat ${{ matrix.runtime.name }}-subwam-info.txt >> description.txt
cat laos-info.txt >> description.txt
echo '```' >> description.txt
printf "\n\n## Laos Runtime for Paseo\nThis runtime was built using $RUSTC_VERSION_PASEO with srtool $SRTOOL_VERSION_PASEO\n" >> description.txt
echo '```' >> description.txt
cat paseo-info.txt >> description.txt
echo '```' >> description.txt
gh release edit ${{ github.ref_name }} --notes-file description.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Ownership Wasm Binaries
- name: Upload Files to Release
run: |
echo "Uploading ownership wasm binary for tag ${{ github.ref_name }}"
gh release upload ${{ github.ref_name }} ${{ steps.srtool_build.outputs.wasm_compressed }}
gh release upload ${{ github.ref_name }} laos-wasm/runtime/laos/target/srtool/release/wbuild/laos-runtime/laos_runtime.compact.compressed.wasm
mv paseo-wasm/runtime/laos/target/srtool/release/wbuild/laos-runtime/laos_runtime.compact.compressed.wasm paseo-wasm/laos_paseo_runtime.compact.compressed.wasm
gh release upload ${{ github.ref_name }} paseo-wasm/laos_paseo_runtime.compact.compressed.wasm
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
17 changes: 15 additions & 2 deletions Cargo.lock

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

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repository = "https://github.com/freeverseio/laos.git"
homepage = "https://www.laosfoundation.io"
authors = ["Freeverse"]
edition = "2021"
version = "0.22.91"
version = "0.22.92"

[workspace]
resolver = "2"
Expand Down Expand Up @@ -34,6 +34,8 @@ sha3 = { version = "0.10.1", default-features = false }
similar-asserts = { version = "1.1.0" }
serde_json = { version = "1.0.104", default-features = true }
rustc-hex = { version = "2.1", default-features = false }
frame-metadata = "16.0.0"
assert-json-diff = "2.0.2"

# Wasm builder
substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.11.0" }
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/tests/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import ParachainStaking from "../build/contracts/ParachainStaking.json";

// Node config
export const RUNTIME_SPEC_NAME = "laos";
export const RUNTIME_SPEC_VERSION = 2291;
export const RUNTIME_SPEC_VERSION = 2292;
export const RUNTIME_IMPL_VERSION = 0;
export const LAOS_NODE_URL = "http://127.0.0.1:9999";
export const ASSET_HUB_NODE_URL = "http://127.0.0.1:9950";
Expand Down
6 changes: 3 additions & 3 deletions node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use std::{path::Path, sync::Arc, time::Duration};

use cumulus_client_cli::CollatorOptions;
// Local Runtime Types
use laos_runtime::{apis::RuntimeApi, opaque::Block, types::TransactionConverter, Hash};
use laos_runtime::{opaque::Block, types::TransactionConverter, Hash};

// Cumulus Imports
use cumulus_client_collator::service::CollatorService;
Expand All @@ -39,6 +39,7 @@ use cumulus_relay_chain_interface::{OverseerHandle, RelayChainInterface};
use fc_rpc::{StorageOverride, StorageOverrideHandler};
use frame_benchmarking_cli::SUBSTRATE_REFERENCE_HARDWARE;
use futures::FutureExt;
use laos_runtime::RuntimeApi;
use sc_client_api::Backend;
use sc_consensus::ImportQueue;
use sc_executor::{
Expand All @@ -52,7 +53,6 @@ use sc_transaction_pool_api::OffchainTransactionPoolFactory;
use sp_core::U256;
use sp_keystore::KeystorePtr;
use substrate_prometheus_endpoint::Registry;

// Frontier
use crate::eth::{
db_config_dir, new_frontier_partial, spawn_frontier_tasks, BackendType, EthConfiguration,
Expand All @@ -66,7 +66,7 @@ impl sc_executor::NativeExecutionDispatch for ParachainNativeExecutor {
type ExtendHostFunctions = ParachainHostFunctions;

fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {
laos_runtime::apis::api::dispatch(method, data)
laos_runtime::api::dispatch(method, data)
}

fn native_version() -> sc_executor::NativeVersion {
Expand Down
3 changes: 3 additions & 0 deletions runtime/laos/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ polkadot-runtime-parachains = { workspace = true }
pallet-assets = { workspace = true }
test-utils = { workspace = true }
ethereum = { workspace = true }
serde_json = { workspace = true }
frame-metadata = { workspace = true }
assert-json-diff = { workspace = true }

[features]
paseo=[]
Expand Down
Loading

0 comments on commit 3191faa

Please sign in to comment.