Skip to content

Commit

Permalink
Merge branch 'master' into jeremy-iforgor-config
Browse files Browse the repository at this point in the history
  • Loading branch information
nanocryk authored Dec 19, 2024
2 parents 9af3421 + e2da250 commit 2bbe899
Show file tree
Hide file tree
Showing 63 changed files with 6,711 additions and 2,004 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/e2e-test-bridge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:
types: [completed]
workflow_dispatch:
inputs:
run_id:
description: "Run id from which artifacts are taken"
run_sha:
description: "Sha commit from which artifacts are taken"
required: true

jobs:
Expand All @@ -19,9 +19,9 @@ jobs:
id: retrieve-run-id
run: |
if [[ -n "${{ github.event_name == 'workflow_dispatch' }}" ]]; then
echo "run_id=${{ github.event.inputs.run_id }}" >> $GITHUB_OUTPUT
echo "run_sha=${{ github.event.inputs.run_sha }}" >> $GITHUB_OUTPUT
else
echo "run_id=${{ github.event.workflow_run.id }}" >> $GITHUB_OUTPUT
echo "run_sha=${{ github.event.workflow_run.head_sha }}" >> $GITHUB_OUTPUT
fi
- name: Recognize sha ref
id: sharef
Expand Down Expand Up @@ -93,13 +93,18 @@ jobs:
id: check_date
run: |
date --version
- name: Check output
id: check_output
run: |
echo ${{ steps.retrieve-run-id.outputs.run_sha }}
- name: Download build artifact from triggered workflow
uses: dawidd6/action-download-artifact@v2
uses: dawidd6/action-download-artifact@v7
with:
run_id: ${{ steps.retrieve-run-id.outputs.run_id }}
commit: ${{ steps.retrieve-run-id.outputs.run_sha }}
workflow: release.yml
name: binaries
path: target/release
search_artifacts: true
allow_forks: false
- name: "Make binaries executable"
shell: bash
run: |
Expand Down
669 changes: 345 additions & 324 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ tp-author-noting-inherent = { path = "primitives/author-noting-inherent", defaul
tp-bridge = { path = "primitives/bridge", default-features = false }
tp-maths = { path = "primitives/maths", default-features = false }
tp-traits = { path = "primitives/traits", default-features = false }
tp-xcm-commons = { path = "primitives/xcm-commons", default-features = false }
tp-xcm-core-buyer = { path = "primitives/xcm-core-buyer", default-features = false }

# Dancekit (wasm)
Expand Down
29 changes: 24 additions & 5 deletions pallets/author-noting/src/benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use {
frame_system::RawOrigin,
parity_scale_codec::Encode,
sp_std::{boxed::Box, vec},
tp_traits::{GetContainerChainAuthor, GetCurrentContainerChains},
tp_traits::{AuthorNotingHook, GetContainerChainAuthor, GetCurrentContainerChains},
};

mod test_sproof {
Expand Down Expand Up @@ -60,11 +60,11 @@ benchmarks! {
let mut container_chains = vec![];

let data = if TypeId::of::<<<T as Config>::RelayOrPara as RelayOrPara>::InherentArg>() == TypeId::of::<tp_author_noting_inherent::OwnParachainInherentData>() {


// RELAY MODE
let mut sproof_builder = test_sproof::ParaHeaderSproofBuilder::default();

for para_id in 1..x {
// Must start at 0 in Relay mode (why?)
for para_id in 0..x {
let para_id = para_id.into();
container_chains.push(para_id);
// Mock assigned authors for this para id
Expand All @@ -73,8 +73,8 @@ benchmarks! {
let num_each_container_chain = 2;
T::ContainerChainAuthor::set_authors_for_para_id(para_id, vec![author; num_each_container_chain]);
sproof_builder.num_items += 1;
}

}
let (root, proof) = sproof_builder.into_state_root_and_proof();
T::RelayOrPara::set_current_relay_chain_state(cumulus_pallet_parachain_system::RelayChainState {
state_root: root,
Expand All @@ -85,9 +85,18 @@ benchmarks! {
relay_storage_proof: proof,
};

for para_id in 0..x {
let para_id = para_id.into();
let author: T::AccountId = account("account id", 0u32, 0u32);

T::AuthorNotingHook::prepare_worst_case_for_bench(&author, 1, para_id);
}

*(Box::new(arg) as Box<dyn Any>).downcast().unwrap()
} else if TypeId::of::<<<T as Config>::RelayOrPara as RelayOrPara>::InherentArg>() == TypeId::of::<()>() {
// PARA MODE

// Must start at 1 in Para mode (why?)
for para_id in 1..x {
let slot: crate::InherentType = 13u64.into();
let header = sp_runtime::generic::Header::<crate::BlockNumber, crate::BlakeTwo256> {
Expand All @@ -113,6 +122,8 @@ benchmarks! {

let head_data = HeadData(header.encode());
frame_support::storage::unhashed::put(&key, &head_data);

T::AuthorNotingHook::prepare_worst_case_for_bench(&author, 1, para_id);
}
let arg = ();
*(Box::new(arg) as Box<dyn Any>).downcast().unwrap()
Expand All @@ -137,6 +148,14 @@ benchmarks! {
assert_ok!(Pallet::<T>::set_author(RawOrigin::Root.into(), para_id, block_number, author, u64::from(block_number).into()));
}: _(RawOrigin::Root, para_id)

on_container_author_noted {
let para_id = 1000.into();
let block_number = 1;
let author: T::AccountId = account("account id", 0u32, 0u32);

T::AuthorNotingHook::prepare_worst_case_for_bench(&author, block_number, para_id);
}: { T::AuthorNotingHook::on_container_author_noted(&author, block_number, para_id )}

impl_benchmark_test_suite!(
Pallet,
crate::mock::new_test_ext(),
Expand Down
Loading

0 comments on commit 2bbe899

Please sign in to comment.