From f7cfc01cbd566c02b350f183649c33310b6b2e2c Mon Sep 17 00:00:00 2001 From: Ezequiel Raynaudo Date: Thu, 14 Nov 2024 10:08:55 -0300 Subject: [PATCH 01/18] Improve patching scripts --- scripts/create_runtime_patch.sh | 159 ++++++++++++++--------------- scripts/replacements_config.json | 2 + scripts/revert_unwanted_changes.py | 29 +++++- 3 files changed, 103 insertions(+), 87 deletions(-) diff --git a/scripts/create_runtime_patch.sh b/scripts/create_runtime_patch.sh index 4e1f666..5c3b235 100755 --- a/scripts/create_runtime_patch.sh +++ b/scripts/create_runtime_patch.sh @@ -3,13 +3,15 @@ set -e # Define colors RED=$(tput setaf 1) -WHITE=$(tput setaf 7) +GREEN=$(tput setaf 2) BLUE=$(tput setaf 4) +WHITE=$(tput setaf 7) RESET=$(tput sgr0) -# Define patch directory and file names -PATCH_DIR="../../patches" -RELAY_PATCH_FILE="${PATCH_DIR}/relay_polkadot.patch" +# Define patch directory relative to the root of the repo +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +ROOT_DIR="$( cd "$SCRIPT_DIR/.." && pwd )" +PATCH_DIR="${ROOT_DIR}/patches" # Function to print messages with colors print_message() { @@ -18,18 +20,6 @@ print_message() { echo "${color}${message}${RESET}" } -# Define list of parachains to copy -# Format: "parachain_name source_dir dest_dir" -# parachain_name: name of the parachain -# source_dir: relative path in polkadot_runtime_next/system-parachains/ -# dest_dir: relative path in paseo_runtime/system-parachains/ -PARACHAINS=( - "asset_hub asset-hubs/asset-hub-polkadot asset-hub-paseo" - "bridge_hub bridge-hubs/bridge-hub-polkadot bridge-hub-paseo" - "people people/people-polkadot people-paseo" - "coretime coretime/coretime-polkadot coretime-paseo" -) - # Initialize default values PASEO_BRANCH="main" PROCESS_PARACHAINS="false" @@ -46,9 +36,7 @@ while [[ $# -gt 0 ]]; do shift ;; *) - if [ -z "$CURRENT_TAG" ]; then - CURRENT_TAG="$1" - elif [ -z "$NEXT_TAG" ]; then + if [ -z "$NEXT_TAG" ]; then NEXT_TAG="$1" else echo "Error: Unexpected argument '$1'" @@ -59,19 +47,18 @@ while [[ $# -gt 0 ]]; do esac done -# Check if required arguments are provided -if [ -z "$CURRENT_TAG" ] || [ -z "$NEXT_TAG" ]; then - echo "Usage: $0 [--paseo-ref-branch ] [--parachains]" +# Check if required argument is provided +if [ -z "$NEXT_TAG" ]; then + echo "Usage: $0 [--paseo-ref-branch ] [--parachains]" echo "--paseo-ref-branch: Optional. Specify the branch to clone for Paseo runtime. Defaults to 'main'." echo "--parachains: Optional. Process parachains if specified." exit 1 fi -POLKADOT_CURRENT_TAG=v${CURRENT_TAG} POLKADOT_NEXT_TAG=v${NEXT_TAG} print_message "========================================" "${GREEN}" -print_message "Creating patches from tag ${POLKADOT_CURRENT_TAG} to ${POLKADOT_NEXT_TAG}" "${GREEN}" +print_message "Creating patches for Polkadot ${POLKADOT_NEXT_TAG}" "${GREEN}" print_message "Paseo reference branch: ${PASEO_BRANCH}" "${GREEN}" print_message "Parachains processing: ${PROCESS_PARACHAINS}" "${GREEN}" print_message "========================================" "${GREEN}" @@ -81,49 +68,61 @@ mkdir .tmp_runtime cd .tmp_runtime print_message "----- Cloning repositories -----" "${BLUE}" -print_message "Cloning paseo-network/runtimes branch: ${PASEO_BRANCH}" "${BLUE}" -git clone -q --depth 1 --branch ${PASEO_BRANCH} https://github.com/paseo-network/runtimes.git paseo_runtime - -print_message "Cloning polkadot-fellows/runtimes branch: ${POLKADOT_CURRENT_TAG}" "${BLUE}" -git clone -q --depth 1 --branch ${POLKADOT_CURRENT_TAG} https://github.com/polkadot-fellows/runtimes.git polkadot_runtime_current - print_message "Cloning polkadot-fellows/runtimes branch: ${POLKADOT_NEXT_TAG}" "${BLUE}" git clone -q --depth 1 --branch ${POLKADOT_NEXT_TAG} https://github.com/polkadot-fellows/runtimes.git polkadot_runtime_next -print_message "----- Copying current Polkadot runtime to Paseo -----" "${BLUE}" -cp -fr polkadot_runtime_current/relay/polkadot/* paseo_runtime/relay/paseo/. +print_message "Cloning paseo-network/runtimes branch: ${PASEO_BRANCH}" "${BLUE}" +git clone -q --depth 1 --branch ${PASEO_BRANCH} https://github.com/paseo-network/runtimes.git paseo_runtime -print_message "----- Creating temporary branch in Paseo repo -----" "${BLUE}" cd paseo_runtime -git switch -q -c tmp/${CURRENT_TAG}-runtime -git add . -git commit -m "Revert to Polkadot ${CURRENT_TAG} runtime" - -print_message "----- Reverting changes to keep Paseo-specific modifications -----" "${RED}" -git revert --no-edit HEAD -LATEST_COMMIT=$(git rev-parse HEAD) - -print_message "----- Creating new branch for updated runtime -----" "${BLUE}" -git switch -q -c release/${NEXT_TAG}-runtime print_message "----- Copying new Polkadot runtime to Paseo -----" "${BLUE}" rm -rf relay/paseo/* cp -rf ../polkadot_runtime_next/relay/polkadot/* relay/paseo/. cp -f ../polkadot_runtime_next/Cargo.toml ./ +print_message "----- Copying new Polkadot chain-spec-generator to Paseo -----" "${BLUE}" +rm -rf chain-spec-generator/* +cp -rf ../polkadot_runtime_next/chain-spec-generator/* chain-spec-generator/. + +print_message "----- Copying new Polkadot integration tests to Paseo -----" "${BLUE}" +rm -rf integration-tests/* +mkdir -p integration-tests/emulated/chains/relays/paseo +mkdir -p integration-tests/emulated/chains/parachains/assets/asset-hub-paseo +mkdir -p integration-tests/emulated/chains/parachains/bridges/bridge-hub-paseo +mkdir -p integration-tests/emulated/chains/parachains/people/people-paseo +mkdir -p integration-tests/emulated/chains/parachains/coretime/coretime-paseo +mkdir -p integration-tests/emulated/chains/parachains/testing/penpal +mkdir -p integration-tests/emulated/helpers +mkdir -p integration-tests/emulated/tests/coretime/coretime-paseo +mkdir -p integration-tests/emulated/tests/bridges/bridge-hub-paseo +mkdir -p integration-tests/emulated/networks/paseo-system + +cp -rf ../polkadot_runtime_next/integration-tests/emulated/chains/relays/polkadot/* integration-tests/emulated/chains/relays/paseo +cp -rf ../polkadot_runtime_next/integration-tests/emulated/chains/parachains/assets/asset-hub-polkadot/* integration-tests/emulated/chains/parachains/assets/asset-hub-paseo +cp -rf ../polkadot_runtime_next/integration-tests/emulated/chains/parachains/bridges/bridge-hub-polkadot/* integration-tests/emulated/chains/parachains/bridges/bridge-hub-paseo +cp -rf ../polkadot_runtime_next/integration-tests/emulated/chains/parachains/people/people-polkadot/* integration-tests/emulated/chains/parachains/people/people-paseo +cp -rf ../polkadot_runtime_next/integration-tests/emulated/chains/parachains/coretime/coretime-polkadot/* integration-tests/emulated/chains/parachains/coretime/coretime-paseo +cp -rf ../polkadot_runtime_next/integration-tests/emulated/chains/parachains/testing/penpal/* integration-tests/emulated/chains/parachains/testing/penpal +cp -rf ../polkadot_runtime_next/integration-tests/emulated/helpers/* integration-tests/emulated/helpers +cp -rf ../polkadot_runtime_next/integration-tests/emulated/tests/coretime/coretime-polkadot/* integration-tests/emulated/tests/coretime/coretime-paseo +cp -rf ../polkadot_runtime_next/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/* integration-tests/emulated/tests/bridges/bridge-hub-paseo +cp -rf ../polkadot_runtime_next/integration-tests/emulated/networks/polkadot-system/* integration-tests/emulated/networks/paseo-system + if [ "$PROCESS_PARACHAINS" = "true" ]; then print_message "----- Copying system-parachains files -----" "${BLUE}" cp ../polkadot_runtime_next/system-parachains/constants/Cargo.toml system-parachains/constants cp ../polkadot_runtime_next/system-parachains/constants/src/polkadot.rs system-parachains/constants/src/paseo.rs cp ../polkadot_runtime_next/system-parachains/constants/src/lib.rs system-parachains/constants/src/ - print_message "Copied system-parachains files:" "${WHITE}" - print_message "- Cargo.toml" "${WHITE}" - print_message "- constants/src/paseo.rs (renamed from polkadot.rs)" "${WHITE}" - print_message "- constants/src/lib.rs" "${WHITE}" - - print_message "----- Copying specified parachains -----" "${BLUE}" + PARACHAINS=( + # Parachain name | source directory | destination directory + "asset_hub asset-hubs/asset-hub-polkadot asset-hub-paseo" + "bridge_hub bridge-hubs/bridge-hub-polkadot bridge-hub-paseo" + "people people/people-polkadot people-paseo" + "coretime coretime/coretime-polkadot coretime-paseo" + ) for parachain in "${PARACHAINS[@]}"; do read -r parachain_name source_dir dest_dir <<< "$parachain" source_dir="../polkadot_runtime_next/system-parachains/${source_dir}" @@ -135,55 +134,49 @@ if [ "$PROCESS_PARACHAINS" = "true" ]; then else print_message "Warning: ${source_dir} not found for ${parachain_name}" "${RED}" fi + + # Create separate patch for each system-parachains + outDir="${PATCH_DIR}/system-parachains/0001-update-${parachain_name}-${NEXT_TAG}.patch" + mkdir -p "$(dirname "${outDir}")" + git format-patch -1 HEAD --stdout -- system-parachains > "${outDir}" + print_message "Created patch for system-parachains: ${outDir}" "${WHITE}" done fi +print_message "----- Committing changes -----" "${BLUE}" git add . git commit -m "Update to Polkadot ${NEXT_TAG} runtime" -if [ "$PROCESS_PARACHAINS" = "true" ]; then - git commit --amend -m "Update to Polkadot ${NEXT_TAG} runtime and copy specified parachains" -fi print_message "----- Creating patch files for Polkadot ${NEXT_TAG} runtime -----" "${WHITE}" mkdir -p ${PATCH_DIR} -if git format-patch -1 --stdout ${LATEST_COMMIT}..HEAD -- relay/paseo Cargo.toml > "${PATCH_DIR}/0001-Update-to-polkadot-relay-${NEXT_TAG}.patch"; then - print_message "Successfully created relay patch file: ${PATCH_DIR}/0001-Update-to-polkadot-relay-${NEXT_TAG}.patch" "${WHITE}" -else - print_message "Failed to create relay patch file" "${RED}" -fi +# Create targeted patch files +print_message "Creating targeted patch files..." "${WHITE}" + +# Patch for relay/paseo +git format-patch -1 HEAD --stdout --root relay/paseo > "${PATCH_DIR}/0001-update-relay-paseo-${NEXT_TAG}.patch" +print_message "Created patch for relay/paseo: ${PATCH_DIR}/0001-update-relay-paseo-${NEXT_TAG}.patch" "${WHITE}" + +# Patch for chain-spec-generator +git format-patch -1 HEAD --stdout --root chain-spec-generator > "${PATCH_DIR}/0001-update-chain-spec-generator-${NEXT_TAG}.patch" +print_message "Created patch for chain-spec-generator: ${PATCH_DIR}/0001-update-chain-spec-generator-${NEXT_TAG}.patch" "${WHITE}" + +# Patch for integration-tests +git format-patch -1 HEAD --stdout --root integration-tests > "${PATCH_DIR}/0001-update-integration-tests-${NEXT_TAG}.patch" +print_message "Created patch for integration-tests: ${PATCH_DIR}/0001-update-integration-tests-${NEXT_TAG}.patch" "${WHITE}" if [ "$PROCESS_PARACHAINS" = "true" ]; then - # Create patches for each parachain + # Create separate patches for each system-parachain for parachain in "${PARACHAINS[@]}"; do - read -r parachain_name _ dest_dir <<< "$parachain" - parachain_dir="system-parachains/${dest_dir}" - patch_output_dir="${PATCH_DIR}/system-parachains/${parachain_name}" - patch_file="${patch_output_dir}/0001-update-to-${parachain_name}-${NEXT_TAG}.patch" - - if [ -d "$parachain_dir" ]; then - mkdir -p "$patch_output_dir" - if git format-patch -1 --stdout ${LATEST_COMMIT}..HEAD -- "$parachain_dir" > "$patch_file"; then - print_message "Created patch for ${parachain_name}: ${patch_file}" "${WHITE}" - else - print_message "Failed to create patch for ${parachain_name}" "${RED}" - fi - else - print_message "Warning: ${dest_dir} not found for ${parachain_name}, skipping patch creation" "${RED}" - fi + read -r parachain_name source_dir dest_dir <<< "$parachain" + dest_dir="system-parachains/${dest_dir}" + outDir="${PATCH_DIR}/system-parachains/0001-update-${parachain_name}-${NEXT_TAG}.patch" + mkdir -p "$(dirname "${outDir}")" + git format-patch -1 HEAD --stdout --root "${dest_dir}" > "${outDir}" + print_message "Created patch for ${parachain_name}: ${outDir}" "${WHITE}" done - - # Create patch for system-parachains/constants and system-parachains/Cargo.toml - parachains_patch_file="${PATCH_DIR}/system-parachains/0001-update-to-parachains-${NEXT_TAG}.patch" - mkdir -p "${PATCH_DIR}/system-parachains" - if git format-patch -1 --stdout ${LATEST_COMMIT}..HEAD -- system-parachains/constants system-parachains/Cargo.toml > "$parachains_patch_file"; then - print_message "Created patch for system-parachains: ${parachains_patch_file}" "${WHITE}" - else - print_message "Failed to create patch for system-parachains" "${RED}" - fi fi print_message "--------------------" "${BLUE}" print_message "----- Patch files created in patches/ directory -----" "${WHITE}" -print_message "----- Apply these patch files to integrate Paseo-specific changes -----" "${WHITE}" print_message "--------------------" "${BLUE}" \ No newline at end of file diff --git a/scripts/replacements_config.json b/scripts/replacements_config.json index 995487e..83b8533 100644 --- a/scripts/replacements_config.json +++ b/scripts/replacements_config.json @@ -21,5 +21,7 @@ "remove_block_pattern": "\\s*// Polkadot Genesis was on May 26, 2020\\..*?DOT_LEASE_OFFSET\\\"\\);", "revert_if_deleted": [ "relay/paseo/src/weights/pallet_sudo.rs" + ], + "ignored_files": [ ] } \ No newline at end of file diff --git a/scripts/revert_unwanted_changes.py b/scripts/revert_unwanted_changes.py index 7984c44..bc390c2 100644 --- a/scripts/revert_unwanted_changes.py +++ b/scripts/revert_unwanted_changes.py @@ -39,7 +39,6 @@ def load_replacements(replacements_file): literal_replacements = [] for key, value in config.get("replacements", {}).items(): if key.startswith("re:"): - # Compile as regex pattern try: pattern = re.compile(key[3:]) except re.error as e: @@ -47,11 +46,16 @@ def load_replacements(replacements_file): sys.exit(1) regex_replacements.append((pattern, value)) else: - # Escape and compile as literal string pattern pattern = re.compile(re.escape(key)) literal_replacements.append((pattern, value)) - return regex_replacements, literal_replacements, config.get("remove_block_pattern", ""), config.get("revert_if_deleted", []) + return ( + regex_replacements, + literal_replacements, + config.get("remove_block_pattern", ""), + config.get("revert_if_deleted", []), + config.get("ignored_files", []) + ) def apply_filters(line, regex_replacements, literal_replacements): """Apply filters to determine if a line should be reverted.""" @@ -125,6 +129,18 @@ def process_deleted_file(file_path, revert_if_deleted): else: log(f"File {file_path} has been deleted, skipping.") +def should_process_file(file_path, ignored_files): + """Check if the file should be processed or ignored.""" + if file_path in ignored_files: + try: + # Revert the entire file to its original state + subprocess.run(['git', 'checkout', 'HEAD', file_path], check=True) + log(f"Reverted ignored file to original state: {file_path}") + except subprocess.CalledProcessError as e: + log(f"Error reverting ignored file {file_path}: {str(e)}") + return False + return True + def main(): if len(sys.argv) != 2: print("Usage: python revert_unwanted_changes.py ") @@ -138,11 +154,16 @@ def main(): log("Starting revert_unwanted_changes.py") try: - regex_replacements, literal_replacements, remove_block_pattern, revert_if_deleted = load_replacements(replacements_file) + regex_replacements, literal_replacements, remove_block_pattern, revert_if_deleted, ignored_files = load_replacements(replacements_file) changed_files = get_changed_files() for status, file_path in changed_files: log(f"Processing {file_path} (Status: {status})") + + # For ignored files, revert them completely and skip further processing + if not should_process_file(file_path, ignored_files): + continue + if status == 'D': process_deleted_file(file_path, revert_if_deleted) else: From 607cdad942e0b962f6db669862f4ae82feddfbc7 Mon Sep 17 00:00:00 2001 From: Ezequiel Raynaudo Date: Thu, 14 Nov 2024 10:33:13 -0300 Subject: [PATCH 02/18] Add missing dir --- scripts/create_runtime_patch.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/create_runtime_patch.sh b/scripts/create_runtime_patch.sh index 5c3b235..54377e1 100755 --- a/scripts/create_runtime_patch.sh +++ b/scripts/create_runtime_patch.sh @@ -78,7 +78,9 @@ cd paseo_runtime print_message "----- Copying new Polkadot runtime to Paseo -----" "${BLUE}" rm -rf relay/paseo/* +rm -rf relay/common/* cp -rf ../polkadot_runtime_next/relay/polkadot/* relay/paseo/. +cp -rf ../polkadot_runtime_next/relay/common/* relay/common/. cp -f ../polkadot_runtime_next/Cargo.toml ./ print_message "----- Copying new Polkadot chain-spec-generator to Paseo -----" "${BLUE}" From ea7e38bc1c6d053e1fadeccff4b9fc6602107f3d Mon Sep 17 00:00:00 2001 From: Ezequiel Raynaudo Date: Thu, 14 Nov 2024 10:54:35 -0300 Subject: [PATCH 03/18] Add missing dirs --- scripts/create_runtime_patch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/create_runtime_patch.sh b/scripts/create_runtime_patch.sh index 54377e1..4db9156 100755 --- a/scripts/create_runtime_patch.sh +++ b/scripts/create_runtime_patch.sh @@ -156,7 +156,7 @@ mkdir -p ${PATCH_DIR} print_message "Creating targeted patch files..." "${WHITE}" # Patch for relay/paseo -git format-patch -1 HEAD --stdout --root relay/paseo > "${PATCH_DIR}/0001-update-relay-paseo-${NEXT_TAG}.patch" +git format-patch -1 HEAD --stdout --root relay/paseo relay/common Cargo.toml > "${PATCH_DIR}/0001-update-relay-paseo-${NEXT_TAG}.patch" print_message "Created patch for relay/paseo: ${PATCH_DIR}/0001-update-relay-paseo-${NEXT_TAG}.patch" "${WHITE}" # Patch for chain-spec-generator From 2305da19c483a63d3f16a93861ff295daeac7a22 Mon Sep 17 00:00:00 2001 From: Ezequiel Raynaudo Date: Thu, 14 Nov 2024 11:04:30 -0300 Subject: [PATCH 04/18] Update relay to v1.3.4 --- Cargo.lock | 24 +-- Cargo.toml | 14 +- relay/paseo/Cargo.toml | 7 +- relay/paseo/src/lib.rs | 176 ++++++++++++++---- .../paseo/src/weights/pallet_message_queue.rs | 61 +++--- 5 files changed, 187 insertions(+), 95 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3db688b..d892847 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1043,7 +1043,7 @@ dependencies = [ [[package]] name = "bp-asset-hub-kusama" version = "1.0.0" -source = "git+https://github.com/polkadot-fellows/runtimes?tag=v1.3.3#55bd514d60311b67cb11400a545cb64ce7a87c0e" +source = "git+https://github.com/polkadot-fellows/runtimes?tag=v1.3.4#3b18d942c766c7f358da50608b44edbe218284a4" dependencies = [ "bp-xcm-bridge-hub-router", "frame-support", @@ -1051,7 +1051,7 @@ dependencies = [ "scale-info", "sp-std", "staging-xcm 14.1.0", - "system-parachains-constants 1.0.0 (git+https://github.com/polkadot-fellows/runtimes?tag=v1.3.3)", + "system-parachains-constants 1.0.0 (git+https://github.com/polkadot-fellows/runtimes?tag=v1.3.4)", ] [[package]] @@ -1086,7 +1086,7 @@ dependencies = [ [[package]] name = "bp-bridge-hub-kusama" version = "1.0.0" -source = "git+https://github.com/polkadot-fellows/runtimes?tag=v1.3.3#55bd514d60311b67cb11400a545cb64ce7a87c0e" +source = "git+https://github.com/polkadot-fellows/runtimes?tag=v1.3.4#3b18d942c766c7f358da50608b44edbe218284a4" dependencies = [ "bp-bridge-hub-cumulus", "bp-messages", @@ -1097,7 +1097,7 @@ dependencies = [ "sp-api", "sp-runtime", "sp-std", - "system-parachains-constants 1.0.0 (git+https://github.com/polkadot-fellows/runtimes?tag=v1.3.3)", + "system-parachains-constants 1.0.0 (git+https://github.com/polkadot-fellows/runtimes?tag=v1.3.4)", ] [[package]] @@ -1122,7 +1122,7 @@ dependencies = [ [[package]] name = "bp-bridge-hub-polkadot" version = "1.0.0" -source = "git+https://github.com/polkadot-fellows/runtimes?tag=v1.3.3#55bd514d60311b67cb11400a545cb64ce7a87c0e" +source = "git+https://github.com/polkadot-fellows/runtimes?tag=v1.3.4#3b18d942c766c7f358da50608b44edbe218284a4" dependencies = [ "bp-bridge-hub-cumulus", "bp-messages", @@ -1136,7 +1136,7 @@ dependencies = [ "sp-runtime", "sp-std", "staging-xcm 14.1.0", - "system-parachains-constants 1.0.0 (git+https://github.com/polkadot-fellows/runtimes?tag=v1.3.3)", + "system-parachains-constants 1.0.0 (git+https://github.com/polkadot-fellows/runtimes?tag=v1.3.4)", ] [[package]] @@ -1901,7 +1901,7 @@ dependencies = [ [[package]] name = "collectives-polkadot-runtime-constants" version = "1.0.0" -source = "git+https://github.com/polkadot-fellows/runtimes?tag=v1.3.3#55bd514d60311b67cb11400a545cb64ce7a87c0e" +source = "git+https://github.com/polkadot-fellows/runtimes?tag=v1.3.4#3b18d942c766c7f358da50608b44edbe218284a4" [[package]] name = "colorchoice" @@ -4724,7 +4724,7 @@ checksum = "c33070833c9ee02266356de0c43f723152bd38bd96ddf52c82b3af10c9138b28" [[package]] name = "kusama-runtime-constants" version = "1.0.0" -source = "git+https://github.com/polkadot-fellows/runtimes?tag=v1.3.3#55bd514d60311b67cb11400a545cb64ce7a87c0e" +source = "git+https://github.com/polkadot-fellows/runtimes?tag=v1.3.4#3b18d942c766c7f358da50608b44edbe218284a4" dependencies = [ "frame-support", "polkadot-primitives", @@ -7578,8 +7578,9 @@ dependencies = [ [[package]] name = "paseo-runtime" -version = "1.3.3" +version = "1.3.4" dependencies = [ + "approx", "binary-merkle-tree", "frame-benchmarking", "frame-election-provider-support", @@ -7609,7 +7610,6 @@ dependencies = [ "pallet-election-provider-support-benchmarking", "pallet-fast-unstake", "pallet-grandpa", - "pallet-im-online", "pallet-indices", "pallet-message-queue", "pallet-mmr", @@ -8117,7 +8117,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-constants" version = "1.0.0" -source = "git+https://github.com/polkadot-fellows/runtimes?tag=v1.3.3#55bd514d60311b67cb11400a545cb64ce7a87c0e" +source = "git+https://github.com/polkadot-fellows/runtimes?tag=v1.3.4#3b18d942c766c7f358da50608b44edbe218284a4" dependencies = [ "frame-support", "polkadot-primitives", @@ -11969,7 +11969,7 @@ dependencies = [ [[package]] name = "system-parachains-constants" version = "1.0.0" -source = "git+https://github.com/polkadot-fellows/runtimes?tag=v1.3.3#55bd514d60311b67cb11400a545cb64ce7a87c0e" +source = "git+https://github.com/polkadot-fellows/runtimes?tag=v1.3.4#3b18d942c766c7f358da50608b44edbe218284a4" dependencies = [ "frame-support", "kusama-runtime-constants", diff --git a/Cargo.toml b/Cargo.toml index 16c15bc..fbb73a4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,11 +6,11 @@ repository = "https://github.com/paseo-network/runtimes.git" license = "GPL-3.0-only" [workspace.dependencies] -kusama-runtime-constants = { git = "https://github.com/polkadot-fellows/runtimes", tag = "v1.3.3", package = "kusama-runtime-constants", default-features = false } -bp-bridge-hub-kusama = { git = "https://github.com/polkadot-fellows/runtimes", tag = "v1.3.3", package = "bp-bridge-hub-kusama", default-features = false } -bp-bridge-hub-polkadot = { git = "https://github.com/polkadot-fellows/runtimes", tag = "v1.3.3", package = "bp-bridge-hub-polkadot", default-features = false } -bp-asset-hub-kusama = { git = "https://github.com/polkadot-fellows/runtimes", tag = "v1.3.3", package = "bp-asset-hub-kusama", default-features = false } -collectives-polkadot-runtime-constants = { git = "https://github.com/polkadot-fellows/runtimes", tag = "v1.3.3", package = "collectives-polkadot-runtime-constants", default-features = false } +kusama-runtime-constants = { git = "https://github.com/polkadot-fellows/runtimes", tag = "v1.3.4", package = "kusama-runtime-constants", default-features = false } +bp-bridge-hub-kusama = { git = "https://github.com/polkadot-fellows/runtimes", tag = "v1.3.4", package = "bp-bridge-hub-kusama", default-features = false } +bp-bridge-hub-polkadot = { git = "https://github.com/polkadot-fellows/runtimes", tag = "v1.3.4", package = "bp-bridge-hub-polkadot", default-features = false } +bp-asset-hub-kusama = { git = "https://github.com/polkadot-fellows/runtimes", tag = "v1.3.4", package = "bp-asset-hub-kusama", default-features = false } +collectives-polkadot-runtime-constants = { git = "https://github.com/polkadot-fellows/runtimes", tag = "v1.3.4", package = "collectives-polkadot-runtime-constants", default-features = false } # Local dependencies @@ -33,6 +33,7 @@ penpal-emulated-chain = { path = "integration-tests/emulated/chains/parachains/t people-paseo-emulated-chain = { path = "integration-tests/emulated/chains/parachains/people/people-paseo"} paseo-emulated-chain = { path = "integration-tests/emulated/chains/relays/paseo"} assert_matches = { version = "1.5.0" } +approx = { version = "0.5.1" } asset-test-utils = { version = "15.0.0" } assets-common = { version = "0.15.0", default-features = false } authority-discovery-primitives = { version = "33.0.0", default-features = false, package = "sp-authority-discovery" } @@ -108,7 +109,6 @@ pallet-fast-unstake = { version = "35.0.0", default-features = false } pallet-glutton = { version = "22.0.0", default-features = false } pallet-grandpa = { version = "36.0.0", default-features = false } pallet-identity = { version = "36.0.0", default-features = false } -pallet-im-online = { version = "35.0.0", default-features = false } pallet-indices = { version = "36.0.0", default-features = false } pallet-insecure-randomness-collective-flip = { version = "24.0.0", default-features = false } pallet-membership = { version = "36.0.0", default-features = false } @@ -258,4 +258,4 @@ opt-level = 3 [profile.production] inherits = "release" lto = true -codegen-units = 1 \ No newline at end of file +codegen-units = 1 diff --git a/relay/paseo/Cargo.toml b/relay/paseo/Cargo.toml index 2341a44..5468259 100644 --- a/relay/paseo/Cargo.toml +++ b/relay/paseo/Cargo.toml @@ -2,7 +2,7 @@ name = "paseo-runtime" build = "build.rs" repository.workspace = true -version = "1.3.3" +version = "1.3.4" authors.workspace = true edition.workspace = true license.workspace = true @@ -54,7 +54,6 @@ pallet-fast-unstake = { workspace = true } frame-executive = { workspace = true } frame-metadata-hash-extension = { workspace = true } pallet-grandpa = { workspace = true } -pallet-im-online = { workspace = true } pallet-indices = { workspace = true } pallet-message-queue = { workspace = true } pallet-mmr = { workspace = true } @@ -112,6 +111,7 @@ sp-debug-derive = { workspace = true } polkadot-parachain-primitives = { workspace = true } [dev-dependencies] +approx = { workspace = true } sp-keyring = { workspace = true } sp-trie = { workspace = true } separator = { workspace = true } @@ -160,7 +160,6 @@ std = [ "pallet-election-provider-support-benchmarking?/std", "pallet-fast-unstake/std", "pallet-grandpa/std", - "pallet-im-online/std", "pallet-indices/std", "pallet-message-queue/std", "pallet-mmr/std", @@ -242,7 +241,6 @@ runtime-benchmarks = [ "pallet-election-provider-support-benchmarking/runtime-benchmarks", "pallet-fast-unstake/runtime-benchmarks", "pallet-grandpa/runtime-benchmarks", - "pallet-im-online/runtime-benchmarks", "pallet-indices/runtime-benchmarks", "pallet-message-queue/runtime-benchmarks", "pallet-mmr/runtime-benchmarks", @@ -299,7 +297,6 @@ try-runtime = [ "pallet-election-provider-multi-phase/try-runtime", "pallet-fast-unstake/try-runtime", "pallet-grandpa/try-runtime", - "pallet-im-online/try-runtime", "pallet-indices/try-runtime", "pallet-message-queue/try-runtime", "pallet-mmr/try-runtime", diff --git a/relay/paseo/src/lib.rs b/relay/paseo/src/lib.rs index 7e2ceb0..8355a04 100644 --- a/relay/paseo/src/lib.rs +++ b/relay/paseo/src/lib.rs @@ -123,7 +123,9 @@ pub use pallet_timestamp::Call as TimestampCall; pub use sp_runtime::BuildStorage; /// Constant values used within the runtime. -use paseo_runtime_constants::{currency::*, fee::*, system_parachain, time::*, TREASURY_PALLET_ID}; +use paseo_runtime_constants::{ + currency::*, fee::*, system_parachain, time::*, TREASURY_PALLET_ID, +}; // Weights used in the runtime. mod weights; @@ -158,7 +160,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("paseo"), impl_name: create_runtime_str!("paseo-testnet"), authoring_version: 0, - spec_version: 1_003_003, + spec_version: 1_003_004, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 26, @@ -228,7 +230,7 @@ pub struct OriginPrivilegeCmp; impl PrivilegeCmp for OriginPrivilegeCmp { fn cmp_privilege(left: &OriginCaller, right: &OriginCaller) -> Option { if left == right { - return Some(Ordering::Equal); + return Some(Ordering::Equal) } match (left, right) { @@ -694,39 +696,31 @@ impl pallet_parameters::Config for Runtime { type AdminOrigin = DynamicParameterOrigin; type WeightInfo = weights::pallet_parameters::WeightInfo; } + /// Defines how much should the inflation be for an era given its duration. pub struct EraPayout; impl pallet_staking::EraPayout for EraPayout { fn era_payout( - total_staked: Balance, + _total_staked: Balance, _total_issuance: Balance, era_duration_millis: u64, ) -> (Balance, Balance) { - const MILLISECONDS_PER_YEAR: u64 = 1000 * 3600 * 24 * 36525 / 100; - - let params = relay_common::EraPayoutParams { - total_staked, - total_stakable: Balances::total_issuance(), - ideal_stake: dynamic_params::inflation::IdealStake::get(), - max_annual_inflation: dynamic_params::inflation::MaxInflation::get(), - min_annual_inflation: dynamic_params::inflation::MinInflation::get(), - falloff: dynamic_params::inflation::Falloff::get(), - period_fraction: Perquintill::from_rational(era_duration_millis, MILLISECONDS_PER_YEAR), - legacy_auction_proportion: if dynamic_params::inflation::UseAuctionSlots::get() { - let auctioned_slots = parachains_paras::Parachains::::get() - .into_iter() - // all active para-ids that do not belong to a system chain is the number of - // parachains that we should take into account for inflation. - .filter(|i| *i >= LOWEST_PUBLIC_ID) - .count() as u64; - Some(Perquintill::from_rational(auctioned_slots.min(60), 300u64)) - } else { - None - }, - }; + const MILLISECONDS_PER_YEAR: u64 = (1000 * 3600 * 24 * 36525) / 100; + // A normal-sized era will have 1 / 365.25 here: + let relative_era_len = + FixedU128::from_rational(era_duration_millis.into(), MILLISECONDS_PER_YEAR.into()); + + // TI at the time of execution of [Referendum 1139](https://paseo.subsquare.io/referenda/1139), block hash: `0x39422610299a75ef69860417f4d0e1d94e77699f45005645ffc5e8e619950f9f`. + let fixed_total_issuance: i128 = 15_011_657_390_566_252_333; + let fixed_inflation_rate = FixedU128::from_rational(8, 100); + let yearly_emission = fixed_inflation_rate.saturating_mul_int(fixed_total_issuance); - log::debug!(target: LOG_TARGET, "params: {:?}", params); - relay_common::relay_era_payout(params) + let era_emission = relative_era_len.saturating_mul_int(yearly_emission); + // 15% to treasury, as per ref 1139. + let to_treasury = FixedU128::from_rational(15, 100).saturating_mul_int(era_emission); + let to_stakers = era_emission.saturating_sub(to_treasury); + + (to_stakers.saturated_into(), to_treasury.saturated_into()) } } @@ -1570,8 +1564,10 @@ impl pallet_state_trie_migration::Config for Runtime { } /// The [frame_support::traits::tokens::ConversionFromAssetBalance] implementation provided by the -/// `AssetRate` pallet instance, with additional decoration to identify different IDs/locations of -/// native asset and provide a one-to-one balance conversion for them. +/// `AssetRate` pallet instance. +/// +/// With additional decoration to identify different IDs/locations of native asset and provide a +/// one-to-one balance conversion for them. pub type AssetRateWithNative = UnityOrOuterConversion< ContainsLocationParts< FromContains< @@ -1627,7 +1623,7 @@ construct_runtime! { // Consensus support. // Authorship must be before session in order to note author in the correct session and era - // for im-online and staking. + // for staking. Authorship: pallet_authorship = 6, Staking: pallet_staking = 7, Offences: pallet_offences = 8, @@ -2248,12 +2244,6 @@ sp_api::impl_runtime_apis! { impl sp_offchain::OffchainWorkerApi for Runtime { fn offchain_worker(header: &::Header) { - use sp_runtime::{traits::Header, DigestItem}; - - if header.digest().logs().iter().any(|di| di == &DigestItem::RuntimeEnvironmentUpdated) { - pallet_im_online::migration::clear_offchain_storage(Session::validators().len() as u32); - } - Executive::offchain_worker(header) } } @@ -3202,6 +3192,7 @@ mod multiplier_tests { dispatch::DispatchInfo, traits::{OnFinalize, PalletInfoAccess}, }; + use pallet_staking::EraPayout; use polkadot_runtime_common::{MinimumMultiplier, TargetBlockFullness}; use separator::Separatable; use sp_runtime::traits::Convert; @@ -3233,6 +3224,113 @@ mod multiplier_tests { }) } + use approx::assert_relative_eq; + const MILLISECONDS_PER_DAY: u64 = 24 * 60 * 60 * 1000; + + #[test] + fn staking_inflation_correct_single_era() { + let (to_stakers, to_treasury) = super::EraPayout::era_payout( + 123, // ignored + 456, // ignored + MILLISECONDS_PER_DAY, + ); + + // Values are within 0.1% + assert_relative_eq!(to_stakers as f64, (279_477 * UNITS) as f64, max_relative = 0.001); + assert_relative_eq!(to_treasury as f64, (49_320 * UNITS) as f64, max_relative = 0.001); + // Total per day is ~328,797 PAS + assert_relative_eq!( + (to_stakers as f64 + to_treasury as f64), + (328_797 * UNITS) as f64, + max_relative = 0.001 + ); + } + + #[test] + fn staking_inflation_correct_longer_era() { + // Twice the era duration means twice the emission: + let (to_stakers, to_treasury) = super::EraPayout::era_payout( + 123, // ignored + 456, // ignored + 2 * MILLISECONDS_PER_DAY, + ); + + assert_relative_eq!( + to_stakers as f64, + (279_477 * UNITS) as f64 * 2.0, + max_relative = 0.001 + ); + assert_relative_eq!( + to_treasury as f64, + (49_320 * UNITS) as f64 * 2.0, + max_relative = 0.001 + ); + } + + #[test] + fn staking_inflation_correct_whole_year() { + let (to_stakers, to_treasury) = super::EraPayout::era_payout( + 123, // ignored + 456, // ignored + (36525 * MILLISECONDS_PER_DAY) / 100, // 1 year + ); + + // Our yearly emissions is about 120M PAS: + let yearly_emission = 120_093_259 * UNITS; + assert_relative_eq!( + to_stakers as f64 + to_treasury as f64, + yearly_emission as f64, + max_relative = 0.001 + ); + + assert_relative_eq!(to_stakers as f64, yearly_emission as f64 * 0.85, max_relative = 0.001); + assert_relative_eq!( + to_treasury as f64, + yearly_emission as f64 * 0.15, + max_relative = 0.001 + ); + } + + // 10 years into the future, our values do not overflow. + #[test] + fn staking_inflation_correct_not_overflow() { + let (to_stakers, to_treasury) = super::EraPayout::era_payout( + 123, // ignored + 456, // ignored + (36525 * MILLISECONDS_PER_DAY) / 10, // 10 years + ); + let initial_ti: i128 = 15_011_657_390_566_252_333; + let projected_total_issuance = (to_stakers as i128 + to_treasury as i128) + initial_ti; + + // In 2034, there will be about 2.7 billion PAS in existence. + assert_relative_eq!( + projected_total_issuance as f64, + (2_700_000_000 * UNITS) as f64, + max_relative = 0.001 + ); + } + + // Print percent per year, just as convenience. + #[test] + fn staking_inflation_correct_print_percent() { + let (to_stakers, to_treasury) = super::EraPayout::era_payout( + 123, // ignored + 456, // ignored + (36525 * MILLISECONDS_PER_DAY) / 100, // 1 year + ); + let yearly_emission = to_stakers + to_treasury; + let mut ti: i128 = 15_011_657_390_566_252_333; + + for y in 0..10 { + let new_ti = ti + yearly_emission as i128; + let inflation = 100.0 * (new_ti - ti) as f64 / ti as f64; + println!("Year {y} inflation: {inflation}%"); + ti = new_ti; + + assert!(inflation <= 8.0 && inflation > 2.0, "sanity check"); + } + } + #[test] fn fast_unstake_estimate() { use pallet_fast_unstake::WeightInfo; @@ -3365,7 +3463,7 @@ mod remote_tests { #[tokio::test] async fn dispatch_all_proposals() { if var("RUN_OPENGOV_TEST").is_err() { - return; + return } sp_tracing::try_init_simple(); @@ -3411,7 +3509,7 @@ mod remote_tests { #[tokio::test] async fn run_migrations() { if var("RUN_MIGRATION_TESTS").is_err() { - return; + return } sp_tracing::try_init_simple(); diff --git a/relay/paseo/src/weights/pallet_message_queue.rs b/relay/paseo/src/weights/pallet_message_queue.rs index 30d0e96..45c5fdc 100644 --- a/relay/paseo/src/weights/pallet_message_queue.rs +++ b/relay/paseo/src/weights/pallet_message_queue.rs @@ -17,24 +17,21 @@ //! Autogenerated weights for `pallet_message_queue` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-08-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `ggwpez-ref-hw`, CPU: `AMD EPYC 7232P 8-Core Processor` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./paseo-chain-spec.json")`, DB CACHE: 1024 +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/production/paseo +// frame-omni-bencher +// v1 // benchmark // pallet -// --chain=./paseo-chain-spec.json -// --steps=50 -// --repeat=20 -// --pallet=pallet_message_queue -// --extrinsic=* -// --wasm-execution=compiled -// --heap-pages=4096 -// --output=./paseo-weights/ -// --header=./file_header.txt +// --runtime=target/production/wbuild/paseo-runtime/paseo_runtime.compact.compressed.wasm +// --pallet=pallet-message-queue +// --extrinsic= +// --output=relay/paseo/src/weights/pallet_message_queue.rs +// --header=.github/scripts/cmd/file_header.txt #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -55,8 +52,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `281` // Estimated: `6050` - // Minimum execution time: 15_420_000 picoseconds. - Weight::from_parts(15_900_000, 0) + // Minimum execution time: 21_260_000 picoseconds. + Weight::from_parts(21_820_000, 0) .saturating_add(Weight::from_parts(0, 6050)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -69,8 +66,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `281` // Estimated: `6050` - // Minimum execution time: 13_910_000 picoseconds. - Weight::from_parts(14_340_000, 0) + // Minimum execution time: 19_380_000 picoseconds. + Weight::from_parts(19_750_000, 0) .saturating_add(Weight::from_parts(0, 6050)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -81,8 +78,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `42` // Estimated: `3520` - // Minimum execution time: 4_780_000 picoseconds. - Weight::from_parts(4_961_000, 0) + // Minimum execution time: 6_360_000 picoseconds. + Weight::from_parts(6_590_000, 0) .saturating_add(Weight::from_parts(0, 3520)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -93,8 +90,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `115` // Estimated: `69051` - // Minimum execution time: 7_030_000 picoseconds. - Weight::from_parts(7_180_000, 0) + // Minimum execution time: 9_390_000 picoseconds. + Weight::from_parts(9_580_000, 0) .saturating_add(Weight::from_parts(0, 69051)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -105,8 +102,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `115` // Estimated: `69051` - // Minimum execution time: 7_170_000 picoseconds. - Weight::from_parts(7_410_000, 0) + // Minimum execution time: 9_660_000 picoseconds. + Weight::from_parts(9_900_000, 0) .saturating_add(Weight::from_parts(0, 69051)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -119,8 +116,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 155_692_000 picoseconds. - Weight::from_parts(156_952_000, 0) + // Minimum execution time: 158_210_000 picoseconds. + Weight::from_parts(159_351_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -132,8 +129,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `220` // Estimated: `3520` - // Minimum execution time: 7_620_000 picoseconds. - Weight::from_parts(7_960_000, 0) + // Minimum execution time: 11_020_000 picoseconds. + Weight::from_parts(11_390_000, 0) .saturating_add(Weight::from_parts(0, 3520)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -150,8 +147,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `65714` // Estimated: `69051` - // Minimum execution time: 54_301_000 picoseconds. - Weight::from_parts(54_911_000, 0) + // Minimum execution time: 63_110_000 picoseconds. + Weight::from_parts(63_761_000, 0) .saturating_add(Weight::from_parts(0, 69051)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(4)) @@ -168,8 +165,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `65714` // Estimated: `69051` - // Minimum execution time: 71_631_000 picoseconds. - Weight::from_parts(72_511_000, 0) + // Minimum execution time: 82_140_000 picoseconds. + Weight::from_parts(82_801_000, 0) .saturating_add(Weight::from_parts(0, 69051)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(4)) @@ -186,8 +183,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `65714` // Estimated: `69051` - // Minimum execution time: 106_751_000 picoseconds. - Weight::from_parts(107_831_000, 0) + // Minimum execution time: 118_451_000 picoseconds. + Weight::from_parts(119_610_000, 0) .saturating_add(Weight::from_parts(0, 69051)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(4)) From d824e47690db202d0983c3252d79fed69080e0f0 Mon Sep 17 00:00:00 2001 From: Ezequiel Raynaudo Date: Thu, 14 Nov 2024 11:10:43 -0300 Subject: [PATCH 05/18] Simplify --- scripts/create_runtime_patch.sh | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/scripts/create_runtime_patch.sh b/scripts/create_runtime_patch.sh index 4db9156..57787be 100755 --- a/scripts/create_runtime_patch.sh +++ b/scripts/create_runtime_patch.sh @@ -123,26 +123,8 @@ if [ "$PROCESS_PARACHAINS" = "true" ]; then "asset_hub asset-hubs/asset-hub-polkadot asset-hub-paseo" "bridge_hub bridge-hubs/bridge-hub-polkadot bridge-hub-paseo" "people people/people-polkadot people-paseo" - "coretime coretime/coretime-polkadot coretime-paseo" + "coretime coretime/coretime-polkadot coretime-paseo" ) - for parachain in "${PARACHAINS[@]}"; do - read -r parachain_name source_dir dest_dir <<< "$parachain" - source_dir="../polkadot_runtime_next/system-parachains/${source_dir}" - dest_dir="system-parachains/${dest_dir}" - if [ -d "$source_dir" ]; then - mkdir -p "$dest_dir" - cp -rf "$source_dir"/* "$dest_dir/" - print_message "Copied ${parachain_name} from ${source_dir} to ${dest_dir}" "${WHITE}" - else - print_message "Warning: ${source_dir} not found for ${parachain_name}" "${RED}" - fi - - # Create separate patch for each system-parachains - outDir="${PATCH_DIR}/system-parachains/0001-update-${parachain_name}-${NEXT_TAG}.patch" - mkdir -p "$(dirname "${outDir}")" - git format-patch -1 HEAD --stdout -- system-parachains > "${outDir}" - print_message "Created patch for system-parachains: ${outDir}" "${WHITE}" - done fi print_message "----- Committing changes -----" "${BLUE}" @@ -177,6 +159,11 @@ if [ "$PROCESS_PARACHAINS" = "true" ]; then git format-patch -1 HEAD --stdout --root "${dest_dir}" > "${outDir}" print_message "Created patch for ${parachain_name}: ${outDir}" "${WHITE}" done + + # Process system-parachains/constants + git format-patch -1 HEAD --stdout --root system-parachains/constants > "${PATCH_DIR}/system-parachains/0001-update-system-parachains-constants-${NEXT_TAG}.patch" + print_message "Created patch for system-parachains/constants: ${PATCH_DIR}/system-parachains/0001-update-system-parachains-constants-${NEXT_TAG}.patch" "${WHITE}" + fi print_message "--------------------" "${BLUE}" From 1658e80681d3a1bb8929ba6fd757f0d112827cca Mon Sep 17 00:00:00 2001 From: Ezequiel Raynaudo Date: Thu, 14 Nov 2024 11:15:12 -0300 Subject: [PATCH 06/18] Minor patch --- system-parachains/constants/src/lib.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/system-parachains/constants/src/lib.rs b/system-parachains/constants/src/lib.rs index a97dc4a..23ad060 100644 --- a/system-parachains/constants/src/lib.rs +++ b/system-parachains/constants/src/lib.rs @@ -26,9 +26,10 @@ use frame_support::{ pub use parachains_common::BlockNumber; use sp_runtime::Perbill; -/// This determines the average expected block time that we are targeting. Blocks will be -/// produced at a minimum duration defined by `SLOT_DURATION`. `SLOT_DURATION` is picked up by -/// `pallet_timestamp` which is in turn picked up by `pallet_aura` to implement `fn +/// This determines the average expected block time that we are targeting. +/// +/// Blocks will be produced at a minimum duration defined by `SLOT_DURATION`. `SLOT_DURATION` is +/// picked up by `pallet_timestamp` which is in turn picked up by `pallet_aura` to implement `fn /// slot_duration()`. /// /// Change this to adjust the block time. From 1f6cdc946f593e469007c2ffa2eb70a69f06b69e Mon Sep 17 00:00:00 2001 From: Ezequiel Raynaudo Date: Thu, 14 Nov 2024 11:41:24 -0300 Subject: [PATCH 07/18] Improve parachains patches --- scripts/create_runtime_patch.sh | 59 +++++++++++++++++++++------------ 1 file changed, 38 insertions(+), 21 deletions(-) diff --git a/scripts/create_runtime_patch.sh b/scripts/create_runtime_patch.sh index 57787be..bcfd4e4 100755 --- a/scripts/create_runtime_patch.sh +++ b/scripts/create_runtime_patch.sh @@ -111,22 +111,6 @@ cp -rf ../polkadot_runtime_next/integration-tests/emulated/tests/coretime/coreti cp -rf ../polkadot_runtime_next/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/* integration-tests/emulated/tests/bridges/bridge-hub-paseo cp -rf ../polkadot_runtime_next/integration-tests/emulated/networks/polkadot-system/* integration-tests/emulated/networks/paseo-system -if [ "$PROCESS_PARACHAINS" = "true" ]; then - print_message "----- Copying system-parachains files -----" "${BLUE}" - cp ../polkadot_runtime_next/system-parachains/constants/Cargo.toml system-parachains/constants - cp ../polkadot_runtime_next/system-parachains/constants/src/polkadot.rs system-parachains/constants/src/paseo.rs - cp ../polkadot_runtime_next/system-parachains/constants/src/lib.rs system-parachains/constants/src/ - - print_message "----- Copying specified parachains -----" "${BLUE}" - PARACHAINS=( - # Parachain name | source directory | destination directory - "asset_hub asset-hubs/asset-hub-polkadot asset-hub-paseo" - "bridge_hub bridge-hubs/bridge-hub-polkadot bridge-hub-paseo" - "people people/people-polkadot people-paseo" - "coretime coretime/coretime-polkadot coretime-paseo" - ) -fi - print_message "----- Committing changes -----" "${BLUE}" git add . git commit -m "Update to Polkadot ${NEXT_TAG} runtime" @@ -150,7 +134,40 @@ git format-patch -1 HEAD --stdout --root integration-tests > "${PATCH_DIR}/0001- print_message "Created patch for integration-tests: ${PATCH_DIR}/0001-update-integration-tests-${NEXT_TAG}.patch" "${WHITE}" if [ "$PROCESS_PARACHAINS" = "true" ]; then - # Create separate patches for each system-parachain + print_message "----- Copying and committing parachains -----" "${BLUE}" + + PARACHAINS=( + # Parachain name | source directory | destination directory + "asset_hub asset-hubs/asset-hub-polkadot asset-hub-paseo" + "bridge_hub bridge-hubs/bridge-hub-polkadot bridge-hub-paseo" + "people people/people-polkadot people-paseo" + "coretime coretime/coretime-polkadot coretime-paseo" + ) + + # First copy all parachains + for parachain in "${PARACHAINS[@]}"; do + read -r parachain_name source_dir dest_dir <<< "$parachain" + source_dir="../polkadot_runtime_next/system-parachains/${source_dir}" + dest_dir="system-parachains/${dest_dir}" + + print_message "Copying ${parachain_name} from ${source_dir} to ${dest_dir}" "${BLUE}" + rm -rf "${dest_dir}" + mkdir -p "${dest_dir}" + cp -rf "${source_dir}"/* "${dest_dir}/" + done + + # Copy constants separately + print_message "Copying constants" "${BLUE}" + rm -rf system-parachains/constants + mkdir -p system-parachains/constants + cp -rf ../polkadot_runtime_next/system-parachains/constants/* system-parachains/constants/ + + # Commit all parachain changes + git add system-parachains/ + git commit -m "Update system-parachains to Polkadot ${NEXT_TAG}" + + # Now create patches for each parachain + print_message "----- Creating parachain patches -----" "${BLUE}" for parachain in "${PARACHAINS[@]}"; do read -r parachain_name source_dir dest_dir <<< "$parachain" dest_dir="system-parachains/${dest_dir}" @@ -160,10 +177,10 @@ if [ "$PROCESS_PARACHAINS" = "true" ]; then print_message "Created patch for ${parachain_name}: ${outDir}" "${WHITE}" done - # Process system-parachains/constants - git format-patch -1 HEAD --stdout --root system-parachains/constants > "${PATCH_DIR}/system-parachains/0001-update-system-parachains-constants-${NEXT_TAG}.patch" - print_message "Created patch for system-parachains/constants: ${PATCH_DIR}/system-parachains/0001-update-system-parachains-constants-${NEXT_TAG}.patch" "${WHITE}" - + # Create constants patch + outDir="${PATCH_DIR}/system-parachains/0001-update-constants-${NEXT_TAG}.patch" + git format-patch -1 HEAD --stdout --root system-parachains/constants > "${outDir}" + print_message "Created patch for constants: ${outDir}" "${WHITE}" fi print_message "--------------------" "${BLUE}" From a86754d67f125163759f1ff2b86933c9a0eaec12 Mon Sep 17 00:00:00 2001 From: Ezequiel Raynaudo Date: Thu, 14 Nov 2024 11:48:21 -0300 Subject: [PATCH 08/18] Update coretime to v1.3.4 --- system-parachains/coretime-paseo/src/lib.rs | 7 +- .../coretime-paseo/src/migrations.rs | 10 +- .../src/weights/block_weights.rs | 5 +- .../cumulus_pallet_parachain_system.rs | 20 +-- .../src/weights/cumulus_pallet_xcmp_queue.rs | 40 ++--- .../src/weights/extrinsic_weights.rs | 5 +- .../src/weights/frame_system.rs | 68 ++++---- .../src/weights/pallet_balances.rs | 60 +++---- .../src/weights/pallet_broker.rs | 148 +++++++++--------- .../src/weights/pallet_collator_selection.rs | 100 ++++++------ .../src/weights/pallet_message_queue.rs | 52 +++--- .../src/weights/pallet_multisig.rs | 80 +++++----- .../src/weights/pallet_proxy.rs | 108 +++++++------ .../src/weights/pallet_session.rs | 20 +-- .../src/weights/pallet_timestamp.rs | 20 +-- .../src/weights/pallet_utility.rs | 44 +++--- .../coretime-paseo/src/weights/pallet_xcm.rs | 84 +++++----- .../src/weights/paritydb_weights.rs | 5 +- .../src/weights/rocksdb_weights.rs | 5 +- .../coretime-paseo/src/xcm_config.rs | 12 +- 20 files changed, 449 insertions(+), 444 deletions(-) diff --git a/system-parachains/coretime-paseo/src/lib.rs b/system-parachains/coretime-paseo/src/lib.rs index 3bb2737..2bbaba9 100644 --- a/system-parachains/coretime-paseo/src/lib.rs +++ b/system-parachains/coretime-paseo/src/lib.rs @@ -180,9 +180,10 @@ parameter_types! { pub const SS58Prefix: u8 = 0; } -/// Filter out credit purchase calls until the credit system is implemented. Otherwise, users -/// may have chance of locking their funds forever on purchased credits they cannot use. -/// Also filter the interlace call until the relay can support this fully. +/// Filter out credit purchase calls until the credit system is implemented. +/// +/// Otherwise, users may have chance of locking their funds forever on purchased credits they cannot +/// use. Also filter the interlace call until the relay can support this fully. pub struct IsFilteredBrokerCall; impl Contains for IsFilteredBrokerCall { fn contains(c: &RuntimeCall) -> bool { diff --git a/system-parachains/coretime-paseo/src/migrations.rs b/system-parachains/coretime-paseo/src/migrations.rs index 5837796..996346b 100644 --- a/system-parachains/coretime-paseo/src/migrations.rs +++ b/system-parachains/coretime-paseo/src/migrations.rs @@ -90,7 +90,7 @@ impl FixMigration { fn add_pool_core(first_core: &mut CoreIndex) { let Some(sale_info) = SaleInfo::::get() else { log::error!(target: TARGET, "Retrieving `SaleInfo` failed!"); - return; + return }; // Workplan add (speed up by one cycle): @@ -203,7 +203,7 @@ impl FixMigration { fn give_dropped_leases_renewal_rights_and_workplan_entry(first_core: &mut CoreIndex) { let Some(sale_info) = SaleInfo::::get() else { log::error!(target: TARGET, "Retrieving `SaleInfo` failed!"); - return; + return }; let dropped_leases = @@ -254,7 +254,7 @@ impl OnRuntimeUpgrade for FixMigration { log::error!(target: TARGET, "Retrieving `SaleInfo` (first_core) failed!"); // Return dummy weight. This should really not happen and if it does we have bigger // problems than wrong weights. - return ::DbWeight::get().writes(50); + return ::DbWeight::get().writes(50) }; Self::extend_short_leases(); @@ -283,7 +283,7 @@ impl OnRuntimeUpgrade for FixMigration { // Idempotency check - this core will never be renewable at this timeslice ever again. if PotentialRenewals::::get(PotentialRenewalId { core: 6, when: 292605 }).is_none() { - return Ok(Vec::new()); + return Ok(Vec::new()) } let sale_info = SaleInfo::::get().unwrap(); let leases = Leases::::get(); @@ -297,7 +297,7 @@ impl OnRuntimeUpgrade for FixMigration { #[cfg(feature = "try-runtime")] fn post_upgrade(state: Vec) -> Result<(), TryRuntimeError> { if state.is_empty() { - return Ok(()); + return Ok(()) } let (prev_sale_info, prev_leases): (SaleInfoRecordOf, LeasesRecordOf) = Decode::decode(&mut &state[..]).unwrap(); diff --git a/system-parachains/coretime-paseo/src/weights/block_weights.rs b/system-parachains/coretime-paseo/src/weights/block_weights.rs index e7fdb2a..d78645c 100644 --- a/system-parachains/coretime-paseo/src/weights/block_weights.rs +++ b/system-parachains/coretime-paseo/src/weights/block_weights.rs @@ -1,6 +1,5 @@ -// This file is part of Substrate. - -// Copyright (C) Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies and the various Paseo contributors, see Contributions.md +// for a list of specific contributors. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/system-parachains/coretime-paseo/src/weights/cumulus_pallet_parachain_system.rs b/system-parachains/coretime-paseo/src/weights/cumulus_pallet_parachain_system.rs index b5b336f..3922dac 100644 --- a/system-parachains/coretime-paseo/src/weights/cumulus_pallet_parachain_system.rs +++ b/system-parachains/coretime-paseo/src/weights/cumulus_pallet_parachain_system.rs @@ -17,23 +17,23 @@ //! Autogenerated weights for `cumulus_pallet_parachain_system` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-09-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `zur1-vm-benchpas-001`, CPU: `AMD EPYC 9354 32-Core Processor` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./coretime.local.raw.json")`, DB CACHE: 1024 +//! HOSTNAME: `ggwpez-ref-hw`, CPU: `AMD EPYC 7232P 8-Core Processor` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./coretime-paseo-chain-spec.json")`, DB CACHE: 1024 // Executed Command: -// ./polkadot-parachain +// ./target/production/paseo-parachain // benchmark // pallet -// --chain=./coretime.local.raw.json +// --chain=./coretime-paseo-chain-spec.json // --steps=50 // --repeat=20 // --pallet=cumulus_pallet_parachain_system // --extrinsic=* // --wasm-execution=compiled // --heap-pages=4096 -// --output=./coretime-weights/ +// --output=./coretime-paseo-weights/ // --header=./file_header.txt #![cfg_attr(rustfmt, rustfmt_skip)] @@ -62,11 +62,11 @@ impl cumulus_pallet_parachain_system::WeightInfo for We // Proof Size summary in bytes: // Measured: `48` // Estimated: `3517` - // Minimum execution time: 1_743_000 picoseconds. - Weight::from_parts(491_440_450, 0) + // Minimum execution time: 2_800_000 picoseconds. + Weight::from_parts(2_870_000, 0) .saturating_add(Weight::from_parts(0, 3517)) - // Standard Error: 587_128 - .saturating_add(Weight::from_parts(204_640_397, 0).saturating_mul(n.into())) + // Standard Error: 52_791 + .saturating_add(Weight::from_parts(190_765_792, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(4)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) diff --git a/system-parachains/coretime-paseo/src/weights/cumulus_pallet_xcmp_queue.rs b/system-parachains/coretime-paseo/src/weights/cumulus_pallet_xcmp_queue.rs index aafbd19..e81e6cf 100644 --- a/system-parachains/coretime-paseo/src/weights/cumulus_pallet_xcmp_queue.rs +++ b/system-parachains/coretime-paseo/src/weights/cumulus_pallet_xcmp_queue.rs @@ -17,23 +17,23 @@ //! Autogenerated weights for `cumulus_pallet_xcmp_queue` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-09-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `zur1-vm-benchpas-001`, CPU: `AMD EPYC 9354 32-Core Processor` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./coretime.local.raw.json")`, DB CACHE: 1024 +//! HOSTNAME: `ggwpez-ref-hw`, CPU: `AMD EPYC 7232P 8-Core Processor` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./coretime-paseo-chain-spec.json")`, DB CACHE: 1024 // Executed Command: -// ./polkadot-parachain +// ./target/production/paseo-parachain // benchmark // pallet -// --chain=./coretime.local.raw.json +// --chain=./coretime-paseo-chain-spec.json // --steps=50 // --repeat=20 // --pallet=cumulus_pallet_xcmp_queue // --extrinsic=* // --wasm-execution=compiled // --heap-pages=4096 -// --output=./coretime-weights/ +// --output=./coretime-paseo-weights/ // --header=./file_header.txt #![cfg_attr(rustfmt, rustfmt_skip)] @@ -53,8 +53,8 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `76` // Estimated: `1497` - // Minimum execution time: 2_974_000 picoseconds. - Weight::from_parts(3_185_000, 0) + // Minimum execution time: 4_920_000 picoseconds. + Weight::from_parts(5_130_000, 0) .saturating_add(Weight::from_parts(0, 1497)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -73,8 +73,8 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `82` // Estimated: `5487` - // Minimum execution time: 8_944_000 picoseconds. - Weight::from_parts(9_174_000, 0) + // Minimum execution time: 12_830_000 picoseconds. + Weight::from_parts(13_170_000, 0) .saturating_add(Weight::from_parts(0, 5487)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -85,8 +85,8 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `76` // Estimated: `2767` - // Minimum execution time: 1_953_000 picoseconds. - Weight::from_parts(2_133_000, 0) + // Minimum execution time: 3_050_000 picoseconds. + Weight::from_parts(3_140_000, 0) .saturating_add(Weight::from_parts(0, 2767)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -97,8 +97,8 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `111` // Estimated: `2767` - // Minimum execution time: 2_845_000 picoseconds. - Weight::from_parts(3_015_000, 0) + // Minimum execution time: 4_080_000 picoseconds. + Weight::from_parts(4_190_000, 0) .saturating_add(Weight::from_parts(0, 2767)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -107,8 +107,8 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_022_000 picoseconds. - Weight::from_parts(8_182_000, 0) + // Minimum execution time: 7_450_000 picoseconds. + Weight::from_parts(7_620_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6b345d8e88afa015075c945637c07e8f20` (r:1 w:1) @@ -129,8 +129,8 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `65711` // Estimated: `69176` - // Minimum execution time: 104_127_000 picoseconds. - Weight::from_parts(111_538_000, 0) + // Minimum execution time: 107_290_000 picoseconds. + Weight::from_parts(108_550_000, 0) .saturating_add(Weight::from_parts(0, 69176)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) @@ -143,8 +143,8 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `65710` // Estimated: `69175` - // Minimum execution time: 59_189_000 picoseconds. - Weight::from_parts(65_629_000, 0) + // Minimum execution time: 50_181_000 picoseconds. + Weight::from_parts(50_760_000, 0) .saturating_add(Weight::from_parts(0, 69175)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/system-parachains/coretime-paseo/src/weights/extrinsic_weights.rs b/system-parachains/coretime-paseo/src/weights/extrinsic_weights.rs index 1a4adb9..cffeacc 100644 --- a/system-parachains/coretime-paseo/src/weights/extrinsic_weights.rs +++ b/system-parachains/coretime-paseo/src/weights/extrinsic_weights.rs @@ -1,6 +1,5 @@ -// This file is part of Substrate. - -// Copyright (C) Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies and the various Paseo contributors, see Contributions.md +// for a list of specific contributors. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/system-parachains/coretime-paseo/src/weights/frame_system.rs b/system-parachains/coretime-paseo/src/weights/frame_system.rs index 9a87c49..66fd757 100644 --- a/system-parachains/coretime-paseo/src/weights/frame_system.rs +++ b/system-parachains/coretime-paseo/src/weights/frame_system.rs @@ -17,23 +17,23 @@ //! Autogenerated weights for `frame_system` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-09-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `zur1-vm-benchpas-001`, CPU: `AMD EPYC 9354 32-Core Processor` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./coretime.local.raw.json")`, DB CACHE: 1024 +//! HOSTNAME: `ggwpez-ref-hw`, CPU: `AMD EPYC 7232P 8-Core Processor` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./coretime-paseo-chain-spec.json")`, DB CACHE: 1024 // Executed Command: -// ./polkadot-parachain +// ./target/production/paseo-parachain // benchmark // pallet -// --chain=./coretime.local.raw.json +// --chain=./coretime-paseo-chain-spec.json // --steps=50 // --repeat=20 // --pallet=frame_system // --extrinsic=* // --wasm-execution=compiled // --heap-pages=4096 -// --output=./coretime-weights/ +// --output=./coretime-paseo-weights/ // --header=./file_header.txt #![cfg_attr(rustfmt, rustfmt_skip)] @@ -52,22 +52,22 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_222_000 picoseconds. - Weight::from_parts(1_282_000, 0) + // Minimum execution time: 2_020_000 picoseconds. + Weight::from_parts(2_110_000, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 1 - .saturating_add(Weight::from_parts(300, 0).saturating_mul(b.into())) + // Standard Error: 0 + .saturating_add(Weight::from_parts(382, 0).saturating_mul(b.into())) } /// The range of component `b` is `[0, 3932160]`. fn remark_with_event(b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_245_000 picoseconds. - Weight::from_parts(118_161_550, 0) + // Minimum execution time: 5_650_000 picoseconds. + Weight::from_parts(5_770_000, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 9 - .saturating_add(Weight::from_parts(1_510, 0).saturating_mul(b.into())) + // Standard Error: 3 + .saturating_add(Weight::from_parts(1_778, 0).saturating_mul(b.into())) } /// Storage: `System::Digest` (r:1 w:1) /// Proof: `System::Digest` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -77,8 +77,8 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1485` - // Minimum execution time: 2_354_000 picoseconds. - Weight::from_parts(4_015_000, 0) + // Minimum execution time: 3_640_000 picoseconds. + Weight::from_parts(3_760_000, 0) .saturating_add(Weight::from_parts(0, 1485)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -99,8 +99,8 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `164` // Estimated: `1649` - // Minimum execution time: 75_657_030_000 picoseconds. - Weight::from_parts(79_130_737_000, 0) + // Minimum execution time: 118_780_773_000 picoseconds. + Weight::from_parts(122_722_799_000, 0) .saturating_add(Weight::from_parts(0, 1649)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) @@ -112,11 +112,11 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_202_000 picoseconds. - Weight::from_parts(1_261_000, 0) + // Minimum execution time: 2_060_000 picoseconds. + Weight::from_parts(2_120_000, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 2_867 - .saturating_add(Weight::from_parts(674_812, 0).saturating_mul(i.into())) + // Standard Error: 2_258 + .saturating_add(Weight::from_parts(857_022, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -126,11 +126,11 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_242_000 picoseconds. - Weight::from_parts(1_301_000, 0) + // Minimum execution time: 2_110_000 picoseconds. + Weight::from_parts(2_170_000, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 1_988 - .saturating_add(Weight::from_parts(513_032, 0).saturating_mul(i.into())) + // Standard Error: 1_093 + .saturating_add(Weight::from_parts(661_080, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -140,11 +140,11 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `76 + p * (69 ±0)` // Estimated: `77 + p * (70 ±0)` - // Minimum execution time: 2_654_000 picoseconds. - Weight::from_parts(2_764_000, 0) + // Minimum execution time: 4_080_000 picoseconds. + Weight::from_parts(4_180_000, 0) .saturating_add(Weight::from_parts(0, 77)) - // Standard Error: 3_300 - .saturating_add(Weight::from_parts(1_016_109, 0).saturating_mul(p.into())) + // Standard Error: 1_497 + .saturating_add(Weight::from_parts(1_336_878, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) .saturating_add(Weight::from_parts(0, 70).saturating_mul(p.into())) @@ -155,8 +155,8 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_800_000 picoseconds. - Weight::from_parts(8_713_000, 0) + // Minimum execution time: 20_690_000 picoseconds. + Weight::from_parts(22_920_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -178,8 +178,8 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `186` // Estimated: `1671` - // Minimum execution time: 77_672_503_000 picoseconds. - Weight::from_parts(82_785_961_000, 0) + // Minimum execution time: 122_321_126_000 picoseconds. + Weight::from_parts(126_620_944_000, 0) .saturating_add(Weight::from_parts(0, 1671)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/system-parachains/coretime-paseo/src/weights/pallet_balances.rs b/system-parachains/coretime-paseo/src/weights/pallet_balances.rs index b5281ef..fd506d7 100644 --- a/system-parachains/coretime-paseo/src/weights/pallet_balances.rs +++ b/system-parachains/coretime-paseo/src/weights/pallet_balances.rs @@ -17,23 +17,23 @@ //! Autogenerated weights for `pallet_balances` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-09-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `zur1-vm-benchpas-001`, CPU: `AMD EPYC 9354 32-Core Processor` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./coretime.local.raw.json")`, DB CACHE: 1024 +//! HOSTNAME: `ggwpez-ref-hw`, CPU: `AMD EPYC 7232P 8-Core Processor` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./coretime-paseo-chain-spec.json")`, DB CACHE: 1024 // Executed Command: -// ./polkadot-parachain +// ./target/production/paseo-parachain // benchmark // pallet -// --chain=./coretime.local.raw.json +// --chain=./coretime-paseo-chain-spec.json // --steps=50 // --repeat=20 // --pallet=pallet_balances // --extrinsic=* // --wasm-execution=compiled // --heap-pages=4096 -// --output=./coretime-weights/ +// --output=./coretime-paseo-weights/ // --header=./file_header.txt #![cfg_attr(rustfmt, rustfmt_skip)] @@ -53,8 +53,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `52` // Estimated: `3593` - // Minimum execution time: 40_681_000 picoseconds. - Weight::from_parts(55_002_000, 0) + // Minimum execution time: 52_610_000 picoseconds. + Weight::from_parts(53_031_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -65,8 +65,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `52` // Estimated: `3593` - // Minimum execution time: 32_338_000 picoseconds. - Weight::from_parts(46_138_000, 0) + // Minimum execution time: 41_580_000 picoseconds. + Weight::from_parts(42_130_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -77,8 +77,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `174` // Estimated: `3593` - // Minimum execution time: 10_245_000 picoseconds. - Weight::from_parts(13_300_000, 0) + // Minimum execution time: 15_060_000 picoseconds. + Weight::from_parts(15_380_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -89,8 +89,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `174` // Estimated: `3593` - // Minimum execution time: 15_734_000 picoseconds. - Weight::from_parts(23_996_000, 0) + // Minimum execution time: 20_520_000 picoseconds. + Weight::from_parts(20_760_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -101,8 +101,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `155` // Estimated: `6196` - // Minimum execution time: 45_237_000 picoseconds. - Weight::from_parts(62_433_000, 0) + // Minimum execution time: 54_091_000 picoseconds. + Weight::from_parts(54_670_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -113,8 +113,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `52` // Estimated: `3593` - // Minimum execution time: 39_800_000 picoseconds. - Weight::from_parts(52_048_000, 0) + // Minimum execution time: 51_701_000 picoseconds. + Weight::from_parts(52_140_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -125,8 +125,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `174` // Estimated: `3593` - // Minimum execution time: 12_269_000 picoseconds. - Weight::from_parts(14_632_000, 0) + // Minimum execution time: 18_140_000 picoseconds. + Weight::from_parts(18_450_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -138,11 +138,11 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0 + u * (136 ±0)` // Estimated: `990 + u * (2603 ±0)` - // Minimum execution time: 13_050_000 picoseconds. - Weight::from_parts(17_557_000, 0) + // Minimum execution time: 17_041_000 picoseconds. + Weight::from_parts(17_200_000, 0) .saturating_add(Weight::from_parts(0, 990)) - // Standard Error: 50_880 - .saturating_add(Weight::from_parts(13_234_143, 0).saturating_mul(u.into())) + // Standard Error: 13_048 + .saturating_add(Weight::from_parts(15_460_275, 0).saturating_mul(u.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(u.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(u.into()))) .saturating_add(Weight::from_parts(0, 2603).saturating_mul(u.into())) @@ -153,8 +153,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1501` - // Minimum execution time: 3_606_000 picoseconds. - Weight::from_parts(3_926_000, 0) + // Minimum execution time: 6_230_000 picoseconds. + Weight::from_parts(6_400_000, 0) .saturating_add(Weight::from_parts(0, 1501)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -162,16 +162,16 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 22_474_000 picoseconds. - Weight::from_parts(26_060_000, 0) + // Minimum execution time: 31_740_000 picoseconds. + Weight::from_parts(32_170_000, 0) .saturating_add(Weight::from_parts(0, 0)) } fn burn_keep_alive() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 14_842_000 picoseconds. - Weight::from_parts(15_383_000, 0) + // Minimum execution time: 21_330_000 picoseconds. + Weight::from_parts(21_630_000, 0) .saturating_add(Weight::from_parts(0, 0)) } } diff --git a/system-parachains/coretime-paseo/src/weights/pallet_broker.rs b/system-parachains/coretime-paseo/src/weights/pallet_broker.rs index 327f79f..80aeb73 100644 --- a/system-parachains/coretime-paseo/src/weights/pallet_broker.rs +++ b/system-parachains/coretime-paseo/src/weights/pallet_broker.rs @@ -17,23 +17,23 @@ //! Autogenerated weights for `pallet_broker` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-09-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `zur1-vm-benchpas-001`, CPU: `AMD EPYC 9354 32-Core Processor` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./coretime.local.raw.json")`, DB CACHE: 1024 +//! HOSTNAME: `ggwpez-ref-hw`, CPU: `AMD EPYC 7232P 8-Core Processor` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./coretime-paseo-chain-spec.json")`, DB CACHE: 1024 // Executed Command: -// ./polkadot-parachain +// ./target/production/paseo-parachain // benchmark // pallet -// --chain=./coretime.local.raw.json +// --chain=./coretime-paseo-chain-spec.json // --steps=50 // --repeat=20 // --pallet=pallet_broker // --extrinsic=* // --wasm-execution=compiled // --heap-pages=4096 -// --output=./coretime-weights/ +// --output=./coretime-paseo-weights/ // --header=./file_header.txt #![cfg_attr(rustfmt, rustfmt_skip)] @@ -53,8 +53,8 @@ impl pallet_broker::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_473_000 picoseconds. - Weight::from_parts(1_663_000, 0) + // Minimum execution time: 2_600_000 picoseconds. + Weight::from_parts(2_730_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -64,8 +64,8 @@ impl pallet_broker::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `10888` // Estimated: `13506` - // Minimum execution time: 22_164_000 picoseconds. - Weight::from_parts(22_834_000, 0) + // Minimum execution time: 28_640_000 picoseconds. + Weight::from_parts(29_100_000, 0) .saturating_add(Weight::from_parts(0, 13506)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -76,8 +76,8 @@ impl pallet_broker::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `12090` // Estimated: `13506` - // Minimum execution time: 21_693_000 picoseconds. - Weight::from_parts(22_123_000, 0) + // Minimum execution time: 27_170_000 picoseconds. + Weight::from_parts(27_680_000, 0) .saturating_add(Weight::from_parts(0, 13506)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -92,8 +92,8 @@ impl pallet_broker::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `506` // Estimated: `1991` - // Minimum execution time: 8_463_000 picoseconds. - Weight::from_parts(8_863_000, 0) + // Minimum execution time: 13_220_000 picoseconds. + Weight::from_parts(13_480_000, 0) .saturating_add(Weight::from_parts(0, 1991)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) @@ -133,11 +133,11 @@ impl pallet_broker::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `12639` // Estimated: `15093 + n * (2 ±0)` - // Minimum execution time: 32_548_000 picoseconds. - Weight::from_parts(140_341_695, 0) + // Minimum execution time: 50_950_000 picoseconds. + Weight::from_parts(157_424_047, 0) .saturating_add(Weight::from_parts(0, 15093)) - // Standard Error: 3_667 - .saturating_add(Weight::from_parts(8_422, 0).saturating_mul(n.into())) + // Standard Error: 2_906 + .saturating_add(Weight::from_parts(27_470, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(14)) .saturating_add(T::DbWeight::get().writes(62)) .saturating_add(Weight::from_parts(0, 2).saturating_mul(n.into())) @@ -154,8 +154,8 @@ impl pallet_broker::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `371` // Estimated: `3593` - // Minimum execution time: 57_807_000 picoseconds. - Weight::from_parts(62_484_000, 0) + // Minimum execution time: 59_920_000 picoseconds. + Weight::from_parts(61_020_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -176,8 +176,8 @@ impl pallet_broker::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `624` // Estimated: `4698` - // Minimum execution time: 111_167_000 picoseconds. - Weight::from_parts(146_941_000, 0) + // Minimum execution time: 99_041_000 picoseconds. + Weight::from_parts(106_060_000, 0) .saturating_add(Weight::from_parts(0, 4698)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) @@ -188,8 +188,8 @@ impl pallet_broker::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `358` // Estimated: `3551` - // Minimum execution time: 11_276_000 picoseconds. - Weight::from_parts(11_828_000, 0) + // Minimum execution time: 16_870_000 picoseconds. + Weight::from_parts(17_260_000, 0) .saturating_add(Weight::from_parts(0, 3551)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -200,8 +200,8 @@ impl pallet_broker::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `358` // Estimated: `3551` - // Minimum execution time: 13_550_000 picoseconds. - Weight::from_parts(18_739_000, 0) + // Minimum execution time: 18_590_000 picoseconds. + Weight::from_parts(18_920_000, 0) .saturating_add(Weight::from_parts(0, 3551)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -212,8 +212,8 @@ impl pallet_broker::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `358` // Estimated: `3551` - // Minimum execution time: 14_132_000 picoseconds. - Weight::from_parts(15_283_000, 0) + // Minimum execution time: 20_140_000 picoseconds. + Weight::from_parts(20_470_000, 0) .saturating_add(Weight::from_parts(0, 3551)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(3)) @@ -230,8 +230,8 @@ impl pallet_broker::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `939` // Estimated: `4681` - // Minimum execution time: 23_906_000 picoseconds. - Weight::from_parts(28_352_000, 0) + // Minimum execution time: 30_771_000 picoseconds. + Weight::from_parts(31_420_000, 0) .saturating_add(Weight::from_parts(0, 4681)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -250,8 +250,8 @@ impl pallet_broker::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1005` // Estimated: `5996` - // Minimum execution time: 26_690_000 picoseconds. - Weight::from_parts(29_655_000, 0) + // Minimum execution time: 37_280_000 picoseconds. + Weight::from_parts(37_810_000, 0) .saturating_add(Weight::from_parts(0, 5996)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(5)) @@ -267,11 +267,11 @@ impl pallet_broker::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `652` // Estimated: `6196 + m * (2520 ±0)` - // Minimum execution time: 48_873_000 picoseconds. - Weight::from_parts(47_232_922, 0) + // Minimum execution time: 66_560_000 picoseconds. + Weight::from_parts(66_057_752, 0) .saturating_add(Weight::from_parts(0, 6196)) - // Standard Error: 269_012 - .saturating_add(Weight::from_parts(5_114_520, 0).saturating_mul(m.into())) + // Standard Error: 24_295 + .saturating_add(Weight::from_parts(1_482_574, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(m.into()))) .saturating_add(T::DbWeight::get().writes(5)) @@ -283,8 +283,8 @@ impl pallet_broker::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3593` - // Minimum execution time: 34_522_000 picoseconds. - Weight::from_parts(36_014_000, 0) + // Minimum execution time: 44_871_000 picoseconds. + Weight::from_parts(45_320_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -297,8 +297,8 @@ impl pallet_broker::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `466` // Estimated: `3551` - // Minimum execution time: 37_918_000 picoseconds. - Weight::from_parts(42_284_000, 0) + // Minimum execution time: 51_721_000 picoseconds. + Weight::from_parts(69_191_000, 0) .saturating_add(Weight::from_parts(0, 3551)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -313,8 +313,8 @@ impl pallet_broker::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `463` // Estimated: `3533` - // Minimum execution time: 55_854_000 picoseconds. - Weight::from_parts(68_874_000, 0) + // Minimum execution time: 68_830_000 picoseconds. + Weight::from_parts(87_120_000, 0) .saturating_add(Weight::from_parts(0, 3533)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) @@ -331,8 +331,8 @@ impl pallet_broker::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `960` // Estimated: `3593` - // Minimum execution time: 64_957_000 picoseconds. - Weight::from_parts(80_501_000, 0) + // Minimum execution time: 83_850_000 picoseconds. + Weight::from_parts(138_931_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(1)) @@ -345,8 +345,8 @@ impl pallet_broker::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `890` // Estimated: `4698` - // Minimum execution time: 31_777_000 picoseconds. - Weight::from_parts(37_807_000, 0) + // Minimum execution time: 49_270_000 picoseconds. + Weight::from_parts(57_281_000, 0) .saturating_add(Weight::from_parts(0, 4698)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -368,8 +368,8 @@ impl pallet_broker::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `74` // Estimated: `3539` - // Minimum execution time: 14_732_000 picoseconds. - Weight::from_parts(19_958_837, 0) + // Minimum execution time: 23_590_000 picoseconds. + Weight::from_parts(24_449_052, 0) .saturating_add(Weight::from_parts(0, 3539)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) @@ -377,13 +377,15 @@ impl pallet_broker::WeightInfo for WeightInfo { /// Storage: `Broker::CoreCountInbox` (r:1 w:1) /// Proof: `Broker::CoreCountInbox` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`) /// The range of component `n` is `[0, 1000]`. - fn process_core_count(_n: u32, ) -> Weight { + fn process_core_count(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `266` // Estimated: `1487` - // Minimum execution time: 4_727_000 picoseconds. - Weight::from_parts(6_591_793, 0) + // Minimum execution time: 7_050_000 picoseconds. + Weight::from_parts(7_394_987, 0) .saturating_add(Weight::from_parts(0, 1487)) + // Standard Error: 11 + .saturating_add(Weight::from_parts(39, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -397,8 +399,8 @@ impl pallet_broker::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `481` // Estimated: `6196` - // Minimum execution time: 52_007_000 picoseconds. - Weight::from_parts(56_906_000, 0) + // Minimum execution time: 55_480_000 picoseconds. + Weight::from_parts(56_840_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) @@ -414,15 +416,13 @@ impl pallet_broker::WeightInfo for WeightInfo { /// Storage: `Broker::Workplan` (r:0 w:65) /// Proof: `Broker::Workplan` (`max_values`: None, `max_size`: Some(1216), added: 3691, mode: `MaxEncodedLen`) /// The range of component `n` is `[0, 1000]`. - fn rotate_sale(n: u32, ) -> Weight { + fn rotate_sale(_n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `12554` // Estimated: `13506` - // Minimum execution time: 97_537_000 picoseconds. - Weight::from_parts(107_337_002, 0) + // Minimum execution time: 126_081_000 picoseconds. + Weight::from_parts(127_414_317, 0) .saturating_add(Weight::from_parts(0, 13506)) - // Standard Error: 2_442 - .saturating_add(Weight::from_parts(9_497, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(70)) } @@ -434,8 +434,8 @@ impl pallet_broker::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3493` - // Minimum execution time: 6_650_000 picoseconds. - Weight::from_parts(7_411_000, 0) + // Minimum execution time: 7_350_000 picoseconds. + Weight::from_parts(7_580_000, 0) .saturating_add(Weight::from_parts(0, 3493)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -460,8 +460,8 @@ impl pallet_broker::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1321` // Estimated: `4786` - // Minimum execution time: 26_510_000 picoseconds. - Weight::from_parts(32_149_000, 0) + // Minimum execution time: 38_320_000 picoseconds. + Weight::from_parts(38_780_000, 0) .saturating_add(Weight::from_parts(0, 4786)) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(4)) @@ -482,8 +482,8 @@ impl pallet_broker::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `74` // Estimated: `3539` - // Minimum execution time: 11_878_000 picoseconds. - Weight::from_parts(13_891_000, 0) + // Minimum execution time: 18_490_000 picoseconds. + Weight::from_parts(18_900_000, 0) .saturating_add(Weight::from_parts(0, 3539)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) @@ -494,8 +494,8 @@ impl pallet_broker::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_292_000 picoseconds. - Weight::from_parts(2_194_000, 0) + // Minimum execution time: 2_180_000 picoseconds. + Weight::from_parts(2_320_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -505,8 +505,8 @@ impl pallet_broker::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_392_000 picoseconds. - Weight::from_parts(1_492_000, 0) + // Minimum execution time: 2_400_000 picoseconds. + Weight::from_parts(2_580_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -524,8 +524,8 @@ impl pallet_broker::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `408` // Estimated: `1893` - // Minimum execution time: 9_273_000 picoseconds. - Weight::from_parts(9_774_000, 0) + // Minimum execution time: 13_100_000 picoseconds. + Weight::from_parts(13_520_000, 0) .saturating_add(Weight::from_parts(0, 1893)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(1)) @@ -536,8 +536,8 @@ impl pallet_broker::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `502` // Estimated: `1926` - // Minimum execution time: 5_498_000 picoseconds. - Weight::from_parts(5_668_000, 0) + // Minimum execution time: 7_960_000 picoseconds. + Weight::from_parts(8_210_000, 0) .saturating_add(Weight::from_parts(0, 1926)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -548,8 +548,8 @@ impl pallet_broker::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `174` // Estimated: `3593` - // Minimum execution time: 3_576_000 picoseconds. - Weight::from_parts(3_906_000, 0) + // Minimum execution time: 5_450_000 picoseconds. + Weight::from_parts(5_570_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) } diff --git a/system-parachains/coretime-paseo/src/weights/pallet_collator_selection.rs b/system-parachains/coretime-paseo/src/weights/pallet_collator_selection.rs index d2c8ca8..11d1010 100644 --- a/system-parachains/coretime-paseo/src/weights/pallet_collator_selection.rs +++ b/system-parachains/coretime-paseo/src/weights/pallet_collator_selection.rs @@ -17,23 +17,23 @@ //! Autogenerated weights for `pallet_collator_selection` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-09-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `zur1-vm-benchpas-001`, CPU: `AMD EPYC 9354 32-Core Processor` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./coretime.local.raw.json")`, DB CACHE: 1024 +//! HOSTNAME: `ggwpez-ref-hw`, CPU: `AMD EPYC 7232P 8-Core Processor` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./coretime-paseo-chain-spec.json")`, DB CACHE: 1024 // Executed Command: -// ./polkadot-parachain +// ./target/production/paseo-parachain // benchmark // pallet -// --chain=./coretime.local.raw.json +// --chain=./coretime-paseo-chain-spec.json // --steps=50 // --repeat=20 // --pallet=pallet_collator_selection // --extrinsic=* // --wasm-execution=compiled // --heap-pages=4096 -// --output=./coretime-weights/ +// --output=./coretime-paseo-weights/ // --header=./file_header.txt #![cfg_attr(rustfmt, rustfmt_skip)] @@ -56,11 +56,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `197 + b * (79 ±0)` // Estimated: `1188 + b * (2555 ±0)` - // Minimum execution time: 8_713_000 picoseconds. - Weight::from_parts(8_974_000, 0) + // Minimum execution time: 13_750_000 picoseconds. + Weight::from_parts(10_287_377, 0) .saturating_add(Weight::from_parts(0, 1188)) - // Standard Error: 31_515 - .saturating_add(Weight::from_parts(3_610_565, 0).saturating_mul(b.into())) + // Standard Error: 5_985 + .saturating_add(Weight::from_parts(3_786_275, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(Weight::from_parts(0, 2555).saturating_mul(b.into())) @@ -79,13 +79,13 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `795 + b * (32 ±0) + c * (53 ±0)` // Estimated: `6287 + b * (37 ±0) + c * (53 ±0)` - // Minimum execution time: 31_778_000 picoseconds. - Weight::from_parts(36_483_386, 0) + // Minimum execution time: 43_020_000 picoseconds. + Weight::from_parts(43_284_060, 0) .saturating_add(Weight::from_parts(0, 6287)) - // Standard Error: 35_281 - .saturating_add(Weight::from_parts(184_086, 0).saturating_mul(b.into())) - // Standard Error: 6_687 - .saturating_add(Weight::from_parts(102_026, 0).saturating_mul(c.into())) + // Standard Error: 3_959 + .saturating_add(Weight::from_parts(37_028, 0).saturating_mul(b.into())) + // Standard Error: 750 + .saturating_add(Weight::from_parts(91_896, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 37).saturating_mul(b.into())) @@ -100,11 +100,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `119 + b * (32 ±0)` // Estimated: `6287` - // Minimum execution time: 8_242_000 picoseconds. - Weight::from_parts(8_392_313, 0) + // Minimum execution time: 13_191_000 picoseconds. + Weight::from_parts(13_423_604, 0) .saturating_add(Weight::from_parts(0, 6287)) - // Standard Error: 2_649 - .saturating_add(Weight::from_parts(126_026, 0).saturating_mul(b.into())) + // Standard Error: 1_180 + .saturating_add(Weight::from_parts(72_525, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -114,8 +114,8 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_874_000 picoseconds. - Weight::from_parts(3_055_000, 0) + // Minimum execution time: 4_900_000 picoseconds. + Weight::from_parts(5_130_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -133,13 +133,13 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `0 + c * (182 ±0) + k * (116 ±0)` // Estimated: `6287 + c * (901 ±29) + k * (901 ±29)` - // Minimum execution time: 7_171_000 picoseconds. - Weight::from_parts(7_371_000, 0) + // Minimum execution time: 11_160_000 picoseconds. + Weight::from_parts(11_420_000, 0) .saturating_add(Weight::from_parts(0, 6287)) - // Standard Error: 165_348 - .saturating_add(Weight::from_parts(5_123_865, 0).saturating_mul(c.into())) - // Standard Error: 165_348 - .saturating_add(Weight::from_parts(5_147_050, 0).saturating_mul(k.into())) + // Standard Error: 181_630 + .saturating_add(Weight::from_parts(6_002_954, 0).saturating_mul(c.into())) + // Standard Error: 181_630 + .saturating_add(Weight::from_parts(5_776_695, 0).saturating_mul(k.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(c.into()))) @@ -156,11 +156,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `320 + c * (49 ±0)` // Estimated: `6287` - // Minimum execution time: 22_914_000 picoseconds. - Weight::from_parts(25_682_358, 0) + // Minimum execution time: 30_120_000 picoseconds. + Weight::from_parts(30_914_629, 0) .saturating_add(Weight::from_parts(0, 6287)) - // Standard Error: 6_355 - .saturating_add(Weight::from_parts(91_711, 0).saturating_mul(c.into())) + // Standard Error: 747 + .saturating_add(Weight::from_parts(70_375, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -179,11 +179,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `765 + c * (52 ±0)` // Estimated: `6287 + c * (54 ±0)` - // Minimum execution time: 30_435_000 picoseconds. - Weight::from_parts(36_761_654, 0) + // Minimum execution time: 39_821_000 picoseconds. + Weight::from_parts(41_903_347, 0) .saturating_add(Weight::from_parts(0, 6287)) - // Standard Error: 6_764 - .saturating_add(Weight::from_parts(86_912, 0).saturating_mul(c.into())) + // Standard Error: 687 + .saturating_add(Weight::from_parts(98_450, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(Weight::from_parts(0, 54).saturating_mul(c.into())) @@ -205,11 +205,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `905 + c * (53 ±0)` // Estimated: `6287 + c * (54 ±0)` - // Minimum execution time: 40_731_000 picoseconds. - Weight::from_parts(45_377_723, 0) + // Minimum execution time: 57_401_000 picoseconds. + Weight::from_parts(59_561_036, 0) .saturating_add(Weight::from_parts(0, 6287)) - // Standard Error: 6_391 - .saturating_add(Weight::from_parts(191_574, 0).saturating_mul(c.into())) + // Standard Error: 2_229 + .saturating_add(Weight::from_parts(134_564, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) .saturating_add(Weight::from_parts(0, 54).saturating_mul(c.into())) @@ -225,11 +225,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `347 + c * (48 ±0)` // Estimated: `6287` - // Minimum execution time: 22_123_000 picoseconds. - Weight::from_parts(27_139_390, 0) + // Minimum execution time: 32_150_000 picoseconds. + Weight::from_parts(33_304_879, 0) .saturating_add(Weight::from_parts(0, 6287)) - // Standard Error: 5_905 - .saturating_add(Weight::from_parts(105_428, 0).saturating_mul(c.into())) + // Standard Error: 828 + .saturating_add(Weight::from_parts(86_292, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -243,8 +243,8 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `155` // Estimated: `6196` - // Minimum execution time: 32_910_000 picoseconds. - Weight::from_parts(34_212_000, 0) + // Minimum execution time: 44_420_000 picoseconds. + Weight::from_parts(44_890_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(4)) @@ -267,11 +267,11 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `2268 + c * (97 ±0) + r * (115 ±0)` // Estimated: `6287 + c * (2519 ±0) + r * (2603 ±0)` - // Minimum execution time: 14_231_000 picoseconds. - Weight::from_parts(14_662_000, 0) + // Minimum execution time: 21_780_000 picoseconds. + Weight::from_parts(22_210_000, 0) .saturating_add(Weight::from_parts(0, 6287)) - // Standard Error: 271_878 - .saturating_add(Weight::from_parts(12_053_318, 0).saturating_mul(c.into())) + // Standard Error: 320_591 + .saturating_add(Weight::from_parts(14_050_985, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(c.into()))) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/system-parachains/coretime-paseo/src/weights/pallet_message_queue.rs b/system-parachains/coretime-paseo/src/weights/pallet_message_queue.rs index 49a0aa9..fa04f95 100644 --- a/system-parachains/coretime-paseo/src/weights/pallet_message_queue.rs +++ b/system-parachains/coretime-paseo/src/weights/pallet_message_queue.rs @@ -17,23 +17,23 @@ //! Autogenerated weights for `pallet_message_queue` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-09-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `zur1-vm-benchpas-001`, CPU: `AMD EPYC 9354 32-Core Processor` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./coretime.local.raw.json")`, DB CACHE: 1024 +//! HOSTNAME: `ggwpez-ref-hw`, CPU: `AMD EPYC 7232P 8-Core Processor` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./coretime-paseo-chain-spec.json")`, DB CACHE: 1024 // Executed Command: -// ./polkadot-parachain +// ./target/production/paseo-parachain // benchmark // pallet -// --chain=./coretime.local.raw.json +// --chain=./coretime-paseo-chain-spec.json // --steps=50 // --repeat=20 // --pallet=pallet_message_queue // --extrinsic=* // --wasm-execution=compiled // --heap-pages=4096 -// --output=./coretime-weights/ +// --output=./coretime-paseo-weights/ // --header=./file_header.txt #![cfg_attr(rustfmt, rustfmt_skip)] @@ -55,8 +55,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `223` // Estimated: `6044` - // Minimum execution time: 10_486_000 picoseconds. - Weight::from_parts(10_806_000, 0) + // Minimum execution time: 14_121_000 picoseconds. + Weight::from_parts(14_551_000, 0) .saturating_add(Weight::from_parts(0, 6044)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -69,8 +69,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `218` // Estimated: `6044` - // Minimum execution time: 8_993_000 picoseconds. - Weight::from_parts(9_303_000, 0) + // Minimum execution time: 12_300_000 picoseconds. + Weight::from_parts(12_721_000, 0) .saturating_add(Weight::from_parts(0, 6044)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -81,8 +81,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `6` // Estimated: `3517` - // Minimum execution time: 2_854_000 picoseconds. - Weight::from_parts(3_035_000, 0) + // Minimum execution time: 4_190_000 picoseconds. + Weight::from_parts(4_280_000, 0) .saturating_add(Weight::from_parts(0, 3517)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -93,8 +93,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `72` // Estimated: `69050` - // Minimum execution time: 4_597_000 picoseconds. - Weight::from_parts(5_418_000, 0) + // Minimum execution time: 6_300_000 picoseconds. + Weight::from_parts(6_550_000, 0) .saturating_add(Weight::from_parts(0, 69050)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -105,8 +105,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `72` // Estimated: `69050` - // Minimum execution time: 4_748_000 picoseconds. - Weight::from_parts(4_968_000, 0) + // Minimum execution time: 6_570_000 picoseconds. + Weight::from_parts(6_750_000, 0) .saturating_add(Weight::from_parts(0, 69050)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -119,8 +119,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 169_565_000 picoseconds. - Weight::from_parts(178_238_000, 0) + // Minimum execution time: 155_631_000 picoseconds. + Weight::from_parts(156_451_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -132,8 +132,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `171` // Estimated: `3517` - // Minimum execution time: 6_119_000 picoseconds. - Weight::from_parts(6_319_000, 0) + // Minimum execution time: 8_190_000 picoseconds. + Weight::from_parts(8_510_000, 0) .saturating_add(Weight::from_parts(0, 3517)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -146,8 +146,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `65667` // Estimated: `69050` - // Minimum execution time: 42_714_000 picoseconds. - Weight::from_parts(45_749_000, 0) + // Minimum execution time: 52_981_000 picoseconds. + Weight::from_parts(53_590_000, 0) .saturating_add(Weight::from_parts(0, 69050)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -160,8 +160,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `65667` // Estimated: `69050` - // Minimum execution time: 59_690_000 picoseconds. - Weight::from_parts(63_945_000, 0) + // Minimum execution time: 70_340_000 picoseconds. + Weight::from_parts(71_050_000, 0) .saturating_add(Weight::from_parts(0, 69050)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -174,8 +174,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `65667` // Estimated: `69050` - // Minimum execution time: 105_568_000 picoseconds. - Weight::from_parts(121_222_000, 0) + // Minimum execution time: 104_350_000 picoseconds. + Weight::from_parts(105_701_000, 0) .saturating_add(Weight::from_parts(0, 69050)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/system-parachains/coretime-paseo/src/weights/pallet_multisig.rs b/system-parachains/coretime-paseo/src/weights/pallet_multisig.rs index 0823bd0..18105a2 100644 --- a/system-parachains/coretime-paseo/src/weights/pallet_multisig.rs +++ b/system-parachains/coretime-paseo/src/weights/pallet_multisig.rs @@ -17,23 +17,23 @@ //! Autogenerated weights for `pallet_multisig` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-09-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `zur1-vm-benchpas-001`, CPU: `AMD EPYC 9354 32-Core Processor` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./coretime.local.raw.json")`, DB CACHE: 1024 +//! HOSTNAME: `ggwpez-ref-hw`, CPU: `AMD EPYC 7232P 8-Core Processor` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./coretime-paseo-chain-spec.json")`, DB CACHE: 1024 // Executed Command: -// ./polkadot-parachain +// ./target/production/paseo-parachain // benchmark // pallet -// --chain=./coretime.local.raw.json +// --chain=./coretime-paseo-chain-spec.json // --steps=50 // --repeat=20 // --pallet=pallet_multisig // --extrinsic=* // --wasm-execution=compiled // --heap-pages=4096 -// --output=./coretime-weights/ +// --output=./coretime-paseo-weights/ // --header=./file_header.txt #![cfg_attr(rustfmt, rustfmt_skip)] @@ -52,11 +52,11 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 9_494_000 picoseconds. - Weight::from_parts(11_618_225, 0) + // Minimum execution time: 13_000_000 picoseconds. + Weight::from_parts(13_575_167, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 25 - .saturating_add(Weight::from_parts(408, 0).saturating_mul(z.into())) + // Standard Error: 1 + .saturating_add(Weight::from_parts(510, 0).saturating_mul(z.into())) } /// Storage: `Multisig::Multisigs` (r:1 w:1) /// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(3346), added: 5821, mode: `MaxEncodedLen`) @@ -66,13 +66,13 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `263 + s * (2 ±0)` // Estimated: `6811` - // Minimum execution time: 33_070_000 picoseconds. - Weight::from_parts(31_884_772, 0) + // Minimum execution time: 42_680_000 picoseconds. + Weight::from_parts(35_147_874, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 7_345 - .saturating_add(Weight::from_parts(77_645, 0).saturating_mul(s.into())) - // Standard Error: 71 - .saturating_add(Weight::from_parts(1_134, 0).saturating_mul(z.into())) + // Standard Error: 349 + .saturating_add(Weight::from_parts(81_434, 0).saturating_mul(s.into())) + // Standard Error: 3 + .saturating_add(Weight::from_parts(1_472, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -84,13 +84,13 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `282` // Estimated: `6811` - // Minimum execution time: 22_905_000 picoseconds. - Weight::from_parts(13_321_201, 0) + // Minimum execution time: 27_161_000 picoseconds. + Weight::from_parts(19_703_120, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 6_644 - .saturating_add(Weight::from_parts(122_872, 0).saturating_mul(s.into())) - // Standard Error: 65 - .saturating_add(Weight::from_parts(1_473, 0).saturating_mul(z.into())) + // Standard Error: 260 + .saturating_add(Weight::from_parts(78_833, 0).saturating_mul(s.into())) + // Standard Error: 2 + .saturating_add(Weight::from_parts(1_496, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -104,13 +104,13 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `388 + s * (33 ±0)` // Estimated: `6811` - // Minimum execution time: 36_044_000 picoseconds. - Weight::from_parts(28_706_017, 0) + // Minimum execution time: 47_821_000 picoseconds. + Weight::from_parts(37_672_150, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 9_689 - .saturating_add(Weight::from_parts(141_224, 0).saturating_mul(s.into())) - // Standard Error: 94 - .saturating_add(Weight::from_parts(1_637, 0).saturating_mul(z.into())) + // Standard Error: 378 + .saturating_add(Weight::from_parts(104_915, 0).saturating_mul(s.into())) + // Standard Error: 3 + .saturating_add(Weight::from_parts(1_525, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -121,11 +121,11 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `263 + s * (2 ±0)` // Estimated: `6811` - // Minimum execution time: 22_975_000 picoseconds. - Weight::from_parts(24_450_409, 0) + // Minimum execution time: 31_871_000 picoseconds. + Weight::from_parts(33_241_107, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 7_712 - .saturating_add(Weight::from_parts(180_442, 0).saturating_mul(s.into())) + // Standard Error: 456 + .saturating_add(Weight::from_parts(85_264, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -136,11 +136,11 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `282` // Estimated: `6811` - // Minimum execution time: 12_269_000 picoseconds. - Weight::from_parts(14_293_910, 0) + // Minimum execution time: 17_450_000 picoseconds. + Weight::from_parts(18_501_749, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 3_668 - .saturating_add(Weight::from_parts(78_708, 0).saturating_mul(s.into())) + // Standard Error: 333 + .saturating_add(Weight::from_parts(80_028, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -151,11 +151,11 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `454 + s * (1 ±0)` // Estimated: `6811` - // Minimum execution time: 22_584_000 picoseconds. - Weight::from_parts(24_440_557, 0) + // Minimum execution time: 32_230_000 picoseconds. + Weight::from_parts(33_660_144, 0) .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 6_311 - .saturating_add(Weight::from_parts(123_814, 0).saturating_mul(s.into())) + // Standard Error: 507 + .saturating_add(Weight::from_parts(86_011, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/system-parachains/coretime-paseo/src/weights/pallet_proxy.rs b/system-parachains/coretime-paseo/src/weights/pallet_proxy.rs index dfd01bc..505a711 100644 --- a/system-parachains/coretime-paseo/src/weights/pallet_proxy.rs +++ b/system-parachains/coretime-paseo/src/weights/pallet_proxy.rs @@ -17,23 +17,23 @@ //! Autogenerated weights for `pallet_proxy` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-09-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `zur1-vm-benchpas-001`, CPU: `AMD EPYC 9354 32-Core Processor` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./coretime.local.raw.json")`, DB CACHE: 1024 +//! HOSTNAME: `ggwpez-ref-hw`, CPU: `AMD EPYC 7232P 8-Core Processor` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./coretime-paseo-chain-spec.json")`, DB CACHE: 1024 // Executed Command: -// ./polkadot-parachain +// ./target/production/paseo-parachain // benchmark // pallet -// --chain=./coretime.local.raw.json +// --chain=./coretime-paseo-chain-spec.json // --steps=50 // --repeat=20 // --pallet=pallet_proxy // --extrinsic=* // --wasm-execution=compiled // --heap-pages=4096 -// --output=./coretime-weights/ +// --output=./coretime-paseo-weights/ // --header=./file_header.txt #![cfg_attr(rustfmt, rustfmt_skip)] @@ -54,11 +54,11 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `127 + p * (37 ±0)` // Estimated: `4706` - // Minimum execution time: 9_094_000 picoseconds. - Weight::from_parts(9_838_076, 0) + // Minimum execution time: 15_220_000 picoseconds. + Weight::from_parts(15_872_420, 0) .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 6_134 - .saturating_add(Weight::from_parts(78_840, 0).saturating_mul(p.into())) + // Standard Error: 948 + .saturating_add(Weight::from_parts(33_485, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) } /// Storage: `Proxy::Proxies` (r:1 w:0) @@ -69,15 +69,17 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// The range of component `a` is `[0, 31]`. /// The range of component `p` is `[1, 31]`. - fn proxy_announced(a: u32, _p: u32, ) -> Weight { + fn proxy_announced(a: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `454 + a * (68 ±0) + p * (37 ±0)` // Estimated: `5698` - // Minimum execution time: 26_209_000 picoseconds. - Weight::from_parts(28_127_710, 0) + // Minimum execution time: 39_110_000 picoseconds. + Weight::from_parts(39_056_811, 0) .saturating_add(Weight::from_parts(0, 5698)) - // Standard Error: 20_187 - .saturating_add(Weight::from_parts(353_555, 0).saturating_mul(a.into())) + // Standard Error: 1_382 + .saturating_add(Weight::from_parts(154_030, 0).saturating_mul(a.into())) + // Standard Error: 1_428 + .saturating_add(Weight::from_parts(31_452, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -91,13 +93,13 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `369 + a * (68 ±0)` // Estimated: `5698` - // Minimum execution time: 18_057_000 picoseconds. - Weight::from_parts(19_580_758, 0) + // Minimum execution time: 26_900_000 picoseconds. + Weight::from_parts(27_442_296, 0) .saturating_add(Weight::from_parts(0, 5698)) - // Standard Error: 8_154 - .saturating_add(Weight::from_parts(139_937, 0).saturating_mul(a.into())) - // Standard Error: 8_425 - .saturating_add(Weight::from_parts(27_483, 0).saturating_mul(p.into())) + // Standard Error: 1_247 + .saturating_add(Weight::from_parts(155_001, 0).saturating_mul(a.into())) + // Standard Error: 1_288 + .saturating_add(Weight::from_parts(5_806, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -111,13 +113,13 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `369 + a * (68 ±0)` // Estimated: `5698` - // Minimum execution time: 18_608_000 picoseconds. - Weight::from_parts(21_941_922, 0) + // Minimum execution time: 27_040_000 picoseconds. + Weight::from_parts(27_290_346, 0) .saturating_add(Weight::from_parts(0, 5698)) - // Standard Error: 13_064 - .saturating_add(Weight::from_parts(133_816, 0).saturating_mul(a.into())) - // Standard Error: 13_498 - .saturating_add(Weight::from_parts(8_001, 0).saturating_mul(p.into())) + // Standard Error: 1_300 + .saturating_add(Weight::from_parts(156_027, 0).saturating_mul(a.into())) + // Standard Error: 1_343 + .saturating_add(Weight::from_parts(9_710, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -129,28 +131,32 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// The range of component `a` is `[0, 31]`. /// The range of component `p` is `[1, 31]`. - fn announce(a: u32, _p: u32, ) -> Weight { + fn announce(a: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `386 + a * (68 ±0) + p * (37 ±0)` // Estimated: `5698` - // Minimum execution time: 24_257_000 picoseconds. - Weight::from_parts(26_103_221, 0) + // Minimum execution time: 35_350_000 picoseconds. + Weight::from_parts(35_288_702, 0) .saturating_add(Weight::from_parts(0, 5698)) - // Standard Error: 12_977 - .saturating_add(Weight::from_parts(240_681, 0).saturating_mul(a.into())) + // Standard Error: 1_279 + .saturating_add(Weight::from_parts(148_035, 0).saturating_mul(a.into())) + // Standard Error: 1_321 + .saturating_add(Weight::from_parts(37_904, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `Proxy::Proxies` (r:1 w:1) /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1241), added: 3716, mode: `MaxEncodedLen`) /// The range of component `p` is `[1, 31]`. - fn add_proxy(_p: u32, ) -> Weight { + fn add_proxy(p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `127 + p * (37 ±0)` // Estimated: `4706` - // Minimum execution time: 17_467_000 picoseconds. - Weight::from_parts(23_103_040, 0) + // Minimum execution time: 25_590_000 picoseconds. + Weight::from_parts(26_101_220, 0) .saturating_add(Weight::from_parts(0, 4706)) + // Standard Error: 864 + .saturating_add(Weight::from_parts(39_811, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -161,11 +167,11 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `127 + p * (37 ±0)` // Estimated: `4706` - // Minimum execution time: 17_236_000 picoseconds. - Weight::from_parts(18_873_782, 0) + // Minimum execution time: 25_400_000 picoseconds. + Weight::from_parts(26_030_034, 0) .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 3_954 - .saturating_add(Weight::from_parts(6_375, 0).saturating_mul(p.into())) + // Standard Error: 979 + .saturating_add(Weight::from_parts(56_472, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -176,11 +182,11 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `127 + p * (37 ±0)` // Estimated: `4706` - // Minimum execution time: 15_634_000 picoseconds. - Weight::from_parts(16_400_380, 0) + // Minimum execution time: 22_951_000 picoseconds. + Weight::from_parts(23_604_770, 0) .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 2_331 - .saturating_add(Weight::from_parts(35_179, 0).saturating_mul(p.into())) + // Standard Error: 813 + .saturating_add(Weight::from_parts(35_473, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -191,11 +197,11 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `139` // Estimated: `4706` - // Minimum execution time: 17_866_000 picoseconds. - Weight::from_parts(18_827_498, 0) + // Minimum execution time: 26_810_000 picoseconds. + Weight::from_parts(27_644_911, 0) .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 1_439 - .saturating_add(Weight::from_parts(10_114, 0).saturating_mul(p.into())) + // Standard Error: 728 + .saturating_add(Weight::from_parts(5_498, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -206,11 +212,11 @@ impl pallet_proxy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `164 + p * (37 ±0)` // Estimated: `4706` - // Minimum execution time: 15_844_000 picoseconds. - Weight::from_parts(16_659_562, 0) + // Minimum execution time: 23_790_000 picoseconds. + Weight::from_parts(24_487_221, 0) .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 3_118 - .saturating_add(Weight::from_parts(53_112, 0).saturating_mul(p.into())) + // Standard Error: 962 + .saturating_add(Weight::from_parts(34_464, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/system-parachains/coretime-paseo/src/weights/pallet_session.rs b/system-parachains/coretime-paseo/src/weights/pallet_session.rs index 46a6a79..0edc935 100644 --- a/system-parachains/coretime-paseo/src/weights/pallet_session.rs +++ b/system-parachains/coretime-paseo/src/weights/pallet_session.rs @@ -17,23 +17,23 @@ //! Autogenerated weights for `pallet_session` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-09-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `zur1-vm-benchpas-001`, CPU: `AMD EPYC 9354 32-Core Processor` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./coretime.local.raw.json")`, DB CACHE: 1024 +//! HOSTNAME: `ggwpez-ref-hw`, CPU: `AMD EPYC 7232P 8-Core Processor` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./coretime-paseo-chain-spec.json")`, DB CACHE: 1024 // Executed Command: -// ./polkadot-parachain +// ./target/production/paseo-parachain // benchmark // pallet -// --chain=./coretime.local.raw.json +// --chain=./coretime-paseo-chain-spec.json // --steps=50 // --repeat=20 // --pallet=pallet_session // --extrinsic=* // --wasm-execution=compiled // --heap-pages=4096 -// --output=./coretime-weights/ +// --output=./coretime-paseo-weights/ // --header=./file_header.txt #![cfg_attr(rustfmt, rustfmt_skip)] @@ -55,8 +55,8 @@ impl pallet_session::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `298` // Estimated: `3763` - // Minimum execution time: 13_850_000 picoseconds. - Weight::from_parts(14_142_000, 0) + // Minimum execution time: 19_360_000 picoseconds. + Weight::from_parts(20_000_000, 0) .saturating_add(Weight::from_parts(0, 3763)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -69,8 +69,8 @@ impl pallet_session::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `280` // Estimated: `3745` - // Minimum execution time: 9_514_000 picoseconds. - Weight::from_parts(9_805_000, 0) + // Minimum execution time: 14_361_000 picoseconds. + Weight::from_parts(14_880_000, 0) .saturating_add(Weight::from_parts(0, 3745)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/system-parachains/coretime-paseo/src/weights/pallet_timestamp.rs b/system-parachains/coretime-paseo/src/weights/pallet_timestamp.rs index 89dd399..ff8e2fb 100644 --- a/system-parachains/coretime-paseo/src/weights/pallet_timestamp.rs +++ b/system-parachains/coretime-paseo/src/weights/pallet_timestamp.rs @@ -17,23 +17,23 @@ //! Autogenerated weights for `pallet_timestamp` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-09-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `zur1-vm-benchpas-001`, CPU: `AMD EPYC 9354 32-Core Processor` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./coretime.local.raw.json")`, DB CACHE: 1024 +//! HOSTNAME: `ggwpez-ref-hw`, CPU: `AMD EPYC 7232P 8-Core Processor` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./coretime-paseo-chain-spec.json")`, DB CACHE: 1024 // Executed Command: -// ./polkadot-parachain +// ./target/production/paseo-parachain // benchmark // pallet -// --chain=./coretime.local.raw.json +// --chain=./coretime-paseo-chain-spec.json // --steps=50 // --repeat=20 // --pallet=pallet_timestamp // --extrinsic=* // --wasm-execution=compiled // --heap-pages=4096 -// --output=./coretime-weights/ +// --output=./coretime-paseo-weights/ // --header=./file_header.txt #![cfg_attr(rustfmt, rustfmt_skip)] @@ -55,8 +55,8 @@ impl pallet_timestamp::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `49` // Estimated: `1493` - // Minimum execution time: 4_286_000 picoseconds. - Weight::from_parts(4_688_000, 0) + // Minimum execution time: 7_210_000 picoseconds. + Weight::from_parts(7_380_000, 0) .saturating_add(Weight::from_parts(0, 1493)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -65,8 +65,8 @@ impl pallet_timestamp::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `57` // Estimated: `0` - // Minimum execution time: 2_484_000 picoseconds. - Weight::from_parts(2_694_000, 0) + // Minimum execution time: 3_400_000 picoseconds. + Weight::from_parts(3_680_000, 0) .saturating_add(Weight::from_parts(0, 0)) } } diff --git a/system-parachains/coretime-paseo/src/weights/pallet_utility.rs b/system-parachains/coretime-paseo/src/weights/pallet_utility.rs index 333c7d6..99b89ca 100644 --- a/system-parachains/coretime-paseo/src/weights/pallet_utility.rs +++ b/system-parachains/coretime-paseo/src/weights/pallet_utility.rs @@ -17,23 +17,23 @@ //! Autogenerated weights for `pallet_utility` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-09-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `zur1-vm-benchpas-001`, CPU: `AMD EPYC 9354 32-Core Processor` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./coretime.local.raw.json")`, DB CACHE: 1024 +//! HOSTNAME: `ggwpez-ref-hw`, CPU: `AMD EPYC 7232P 8-Core Processor` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./coretime-paseo-chain-spec.json")`, DB CACHE: 1024 // Executed Command: -// ./polkadot-parachain +// ./target/production/paseo-parachain // benchmark // pallet -// --chain=./coretime.local.raw.json +// --chain=./coretime-paseo-chain-spec.json // --steps=50 // --repeat=20 // --pallet=pallet_utility // --extrinsic=* // --wasm-execution=compiled // --heap-pages=4096 -// --output=./coretime-weights/ +// --output=./coretime-paseo-weights/ // --header=./file_header.txt #![cfg_attr(rustfmt, rustfmt_skip)] @@ -52,18 +52,18 @@ impl pallet_utility::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_817_000 picoseconds. - Weight::from_parts(3_966_000, 0) + // Minimum execution time: 5_010_000 picoseconds. + Weight::from_parts(30_389_734, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 14_261 - .saturating_add(Weight::from_parts(2_482_493, 0).saturating_mul(c.into())) + // Standard Error: 2_974 + .saturating_add(Weight::from_parts(3_287_461, 0).saturating_mul(c.into())) } fn as_derivative() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_184_000 picoseconds. - Weight::from_parts(4_757_000, 0) + // Minimum execution time: 4_660_000 picoseconds. + Weight::from_parts(4_870_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// The range of component `c` is `[0, 1000]`. @@ -71,18 +71,18 @@ impl pallet_utility::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_676_000 picoseconds. - Weight::from_parts(70_703_574, 0) + // Minimum execution time: 4_990_000 picoseconds. + Weight::from_parts(10_736_086, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 26_091 - .saturating_add(Weight::from_parts(2_525_142, 0).saturating_mul(c.into())) + // Standard Error: 647 + .saturating_add(Weight::from_parts(3_524_052, 0).saturating_mul(c.into())) } fn dispatch_as() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_936_000 picoseconds. - Weight::from_parts(4_186_000, 0) + // Minimum execution time: 6_930_000 picoseconds. + Weight::from_parts(7_110_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// The range of component `c` is `[0, 1000]`. @@ -90,10 +90,10 @@ impl pallet_utility::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_833_000 picoseconds. - Weight::from_parts(2_904_000, 0) + // Minimum execution time: 4_920_000 picoseconds. + Weight::from_parts(8_177_438, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 23_608 - .saturating_add(Weight::from_parts(2_437_694, 0).saturating_mul(c.into())) + // Standard Error: 733 + .saturating_add(Weight::from_parts(3_300_112, 0).saturating_mul(c.into())) } } diff --git a/system-parachains/coretime-paseo/src/weights/pallet_xcm.rs b/system-parachains/coretime-paseo/src/weights/pallet_xcm.rs index 379a038..846c39b 100644 --- a/system-parachains/coretime-paseo/src/weights/pallet_xcm.rs +++ b/system-parachains/coretime-paseo/src/weights/pallet_xcm.rs @@ -17,23 +17,23 @@ //! Autogenerated weights for `pallet_xcm` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-09-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-14, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `zur1-vm-benchpas-001`, CPU: `AMD EPYC 9354 32-Core Processor` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./coretime.local.raw.json")`, DB CACHE: 1024 +//! HOSTNAME: `ggwpez-ref-hw`, CPU: `AMD EPYC 7232P 8-Core Processor` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./coretime-paseo-chain-spec.json")`, DB CACHE: 1024 // Executed Command: -// ./polkadot-parachain +// ./target/production/paseo-parachain // benchmark // pallet -// --chain=./coretime.local.raw.json +// --chain=./coretime-paseo-chain-spec.json // --steps=50 // --repeat=20 // --pallet=pallet_xcm // --extrinsic=* // --wasm-execution=compiled // --heap-pages=4096 -// --output=./coretime-weights/ +// --output=./coretime-paseo-weights/ // --header=./file_header.txt #![cfg_attr(rustfmt, rustfmt_skip)] @@ -63,8 +63,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `74` // Estimated: `3539` - // Minimum execution time: 15_324_000 picoseconds. - Weight::from_parts(16_254_000, 0) + // Minimum execution time: 24_701_000 picoseconds. + Weight::from_parts(25_710_000, 0) .saturating_add(Weight::from_parts(0, 3539)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(2)) @@ -89,8 +89,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `106` // Estimated: `3593` - // Minimum execution time: 71_367_000 picoseconds. - Weight::from_parts(81_182_000, 0) + // Minimum execution time: 99_940_000 picoseconds. + Weight::from_parts(101_560_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(2)) @@ -119,8 +119,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_370_000 picoseconds. - Weight::from_parts(6_820_000, 0) + // Minimum execution time: 10_900_000 picoseconds. + Weight::from_parts(11_220_000, 0) .saturating_add(Weight::from_parts(0, 0)) } /// Storage: `PolkadotXcm::SupportedVersion` (r:0 w:1) @@ -129,8 +129,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_357_000 picoseconds. - Weight::from_parts(4_687_000, 0) + // Minimum execution time: 7_560_000 picoseconds. + Weight::from_parts(7_650_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -140,8 +140,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_372_000 picoseconds. - Weight::from_parts(1_542_000, 0) + // Minimum execution time: 2_530_000 picoseconds. + Weight::from_parts(2_650_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -167,8 +167,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `74` // Estimated: `3539` - // Minimum execution time: 19_810_000 picoseconds. - Weight::from_parts(20_660_000, 0) + // Minimum execution time: 31_600_000 picoseconds. + Weight::from_parts(32_120_000, 0) .saturating_add(Weight::from_parts(0, 3539)) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(5)) @@ -193,8 +193,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `292` // Estimated: `3757` - // Minimum execution time: 23_515_000 picoseconds. - Weight::from_parts(25_148_000, 0) + // Minimum execution time: 35_460_000 picoseconds. + Weight::from_parts(36_360_000, 0) .saturating_add(Weight::from_parts(0, 3757)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(4)) @@ -205,8 +205,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_342_000 picoseconds. - Weight::from_parts(1_492_000, 0) + // Minimum execution time: 2_520_000 picoseconds. + Weight::from_parts(2_670_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -216,8 +216,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `89` // Estimated: `13454` - // Minimum execution time: 15_584_000 picoseconds. - Weight::from_parts(22_684_000, 0) + // Minimum execution time: 20_850_000 picoseconds. + Weight::from_parts(21_330_000, 0) .saturating_add(Weight::from_parts(0, 13454)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) @@ -228,8 +228,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `93` // Estimated: `13458` - // Minimum execution time: 15_122_000 picoseconds. - Weight::from_parts(15_453_000, 0) + // Minimum execution time: 21_050_000 picoseconds. + Weight::from_parts(21_400_000, 0) .saturating_add(Weight::from_parts(0, 13458)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) @@ -240,8 +240,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `106` // Estimated: `15946` - // Minimum execution time: 17_076_000 picoseconds. - Weight::from_parts(17_316_000, 0) + // Minimum execution time: 22_990_000 picoseconds. + Weight::from_parts(23_360_000, 0) .saturating_add(Weight::from_parts(0, 15946)) .saturating_add(T::DbWeight::get().reads(6)) } @@ -263,8 +263,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `142` // Estimated: `6082` - // Minimum execution time: 20_821_000 picoseconds. - Weight::from_parts(22_223_000, 0) + // Minimum execution time: 32_260_000 picoseconds. + Weight::from_parts(33_041_000, 0) .saturating_add(Weight::from_parts(0, 6082)) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(3)) @@ -275,8 +275,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `103` // Estimated: `10993` - // Minimum execution time: 10_486_000 picoseconds. - Weight::from_parts(10_845_000, 0) + // Minimum execution time: 14_221_000 picoseconds. + Weight::from_parts(14_600_000, 0) .saturating_add(Weight::from_parts(0, 10993)) .saturating_add(T::DbWeight::get().reads(4)) } @@ -286,8 +286,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `100` // Estimated: `13465` - // Minimum execution time: 15_474_000 picoseconds. - Weight::from_parts(15_864_000, 0) + // Minimum execution time: 21_541_000 picoseconds. + Weight::from_parts(22_180_000, 0) .saturating_add(Weight::from_parts(0, 13465)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(2)) @@ -310,8 +310,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `142` // Estimated: `13507` - // Minimum execution time: 28_963_000 picoseconds. - Weight::from_parts(31_086_000, 0) + // Minimum execution time: 42_870_000 picoseconds. + Weight::from_parts(43_560_000, 0) .saturating_add(Weight::from_parts(0, 13507)) .saturating_add(T::DbWeight::get().reads(11)) .saturating_add(T::DbWeight::get().writes(4)) @@ -324,8 +324,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `32` // Estimated: `1517` - // Minimum execution time: 3_315_000 picoseconds. - Weight::from_parts(3_456_000, 0) + // Minimum execution time: 4_510_000 picoseconds. + Weight::from_parts(4_700_000, 0) .saturating_add(Weight::from_parts(0, 1517)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) @@ -336,8 +336,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `7669` // Estimated: `11134` - // Minimum execution time: 25_017_000 picoseconds. - Weight::from_parts(25_858_000, 0) + // Minimum execution time: 31_020_000 picoseconds. + Weight::from_parts(31_550_000, 0) .saturating_add(Weight::from_parts(0, 11134)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -348,8 +348,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `90` // Estimated: `3555` - // Minimum execution time: 30_535_000 picoseconds. - Weight::from_parts(32_158_000, 0) + // Minimum execution time: 43_620_000 picoseconds. + Weight::from_parts(44_320_000, 0) .saturating_add(Weight::from_parts(0, 3555)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/system-parachains/coretime-paseo/src/weights/paritydb_weights.rs b/system-parachains/coretime-paseo/src/weights/paritydb_weights.rs index 2567970..793408c 100644 --- a/system-parachains/coretime-paseo/src/weights/paritydb_weights.rs +++ b/system-parachains/coretime-paseo/src/weights/paritydb_weights.rs @@ -1,6 +1,5 @@ -// This file is part of Substrate. - -// Copyright (C) Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies and the various Paseo contributors, see Contributions.md +// for a list of specific contributors. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/system-parachains/coretime-paseo/src/weights/rocksdb_weights.rs b/system-parachains/coretime-paseo/src/weights/rocksdb_weights.rs index 3dd817a..4046b02 100644 --- a/system-parachains/coretime-paseo/src/weights/rocksdb_weights.rs +++ b/system-parachains/coretime-paseo/src/weights/rocksdb_weights.rs @@ -1,6 +1,5 @@ -// This file is part of Substrate. - -// Copyright (C) Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies and the various Paseo contributors, see Contributions.md +// for a list of specific contributors. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/system-parachains/coretime-paseo/src/xcm_config.rs b/system-parachains/coretime-paseo/src/xcm_config.rs index 90ec2f8..151b6c3 100644 --- a/system-parachains/coretime-paseo/src/xcm_config.rs +++ b/system-parachains/coretime-paseo/src/xcm_config.rs @@ -63,9 +63,10 @@ parameter_types! { pub StakingPot: AccountId = CollatorSelection::account_id(); } -/// Type for specifying how a `Location` can be converted into an `AccountId`. This is used -/// when determining ownership of accounts for asset transacting and when attempting to use XCM -/// `Transact` in order to determine the dispatch Origin. +/// Type for specifying how a `Location` can be converted into an `AccountId`. +/// +/// This is used when determining ownership of accounts for asset transacting and when attempting to +/// use XCM `Transact` in order to determine the dispatch Origin. pub type LocationToAccountId = ( // The parent (Relay-chain) origin converts to the parent `AccountId`. ParentIsPreset, @@ -112,8 +113,9 @@ pub type RegionTransactor = NonFungibleAdapter< pub type AssetTransactors = (FungibleTransactor, RegionTransactor); /// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, -/// ready for dispatching a transaction with XCM's `Transact`. There is an `OriginKind` that can -/// bias the kind of local `Origin` it will become. +/// ready for dispatching a transaction with XCM's `Transact`. +/// +/// There is an `OriginKind` that can bias the kind of local `Origin` it will become. pub type XcmOriginToTransactDispatchOrigin = ( // Sovereign account converter; this attempts to derive an `AccountId` from the origin location // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for From dd6e4f4be79c7e506a211450a316054dd3f1bd2c Mon Sep 17 00:00:00 2001 From: Ezequiel Raynaudo Date: Thu, 14 Nov 2024 11:57:53 -0300 Subject: [PATCH 09/18] Update people to v1.3.4 --- ...lkadot_runtime_common_identity_migrator.rs | 91 ------------------- .../people-paseo/src/xcm_config.rs | 12 ++- 2 files changed, 7 insertions(+), 96 deletions(-) delete mode 100644 system-parachains/people-paseo/src/weights/polkadot_runtime_common_identity_migrator.rs diff --git a/system-parachains/people-paseo/src/weights/polkadot_runtime_common_identity_migrator.rs b/system-parachains/people-paseo/src/weights/polkadot_runtime_common_identity_migrator.rs deleted file mode 100644 index bcd87b2..0000000 --- a/system-parachains/people-paseo/src/weights/polkadot_runtime_common_identity_migrator.rs +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (C) Parity Technologies and the various Polkadot contributors, see Contributions.md -// for a list of specific contributors. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `polkadot_runtime_common::identity_migrator` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-05-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `ggwpez-ref-hw`, CPU: `AMD EPYC 7232P 8-Core Processor` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./people-polkadot-chain-spec.json")`, DB CACHE: 1024 - -// Executed Command: -// ./target/production/polkadot -// benchmark -// pallet -// --chain=./people-polkadot-chain-spec.json -// --steps=50 -// --repeat=20 -// --pallet=polkadot_runtime_common::identity_migrator -// --extrinsic=* -// --wasm-execution=compiled -// --heap-pages=4096 -// --output=./people-polkadot-weights/ -// --header=./file_header.txt - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] -#![allow(missing_docs)] - -use frame_support::{traits::Get, weights::Weight}; -use core::marker::PhantomData; - -/// Weight functions for `polkadot_runtime_common::identity_migrator`. -pub struct WeightInfo(PhantomData); -impl polkadot_runtime_common::identity_migrator::WeightInfo for WeightInfo { - /// Storage: `Identity::IdentityOf` (r:1 w:1) - /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(838), added: 3313, mode: `MaxEncodedLen`) - /// Storage: `Identity::SubsOf` (r:1 w:1) - /// Proof: `Identity::SubsOf` (`max_values`: None, `max_size`: Some(3258), added: 5733, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `Identity::SuperOf` (r:0 w:100) - /// Proof: `Identity::SuperOf` (`max_values`: None, `max_size`: Some(114), added: 2589, mode: `MaxEncodedLen`) - /// The range of component `r` is `[0, 20]`. - /// The range of component `s` is `[0, 100]`. - fn reap_identity(r: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `741 + r * (5 ±0) + s * (32 ±0)` - // Estimated: `6723` - // Minimum execution time: 36_130_000 picoseconds. - Weight::from_parts(38_663_715, 0) - .saturating_add(Weight::from_parts(0, 6723)) - // Standard Error: 4_799 - .saturating_add(Weight::from_parts(49_078, 0).saturating_mul(r.into())) - // Standard Error: 983 - .saturating_add(Weight::from_parts(1_498_325, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) - } - /// Storage: `Identity::IdentityOf` (r:1 w:1) - /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(838), added: 3313, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `Identity::SubsOf` (r:1 w:1) - /// Proof: `Identity::SubsOf` (`max_values`: None, `max_size`: Some(3258), added: 5733, mode: `MaxEncodedLen`) - fn poke_deposit() -> Weight { - // Proof Size summary in bytes: - // Measured: `706` - // Estimated: `6723` - // Minimum execution time: 51_511_000 picoseconds. - Weight::from_parts(52_060_000, 0) - .saturating_add(Weight::from_parts(0, 6723)) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) - } -} diff --git a/system-parachains/people-paseo/src/xcm_config.rs b/system-parachains/people-paseo/src/xcm_config.rs index 9d8c01c..7ba939b 100644 --- a/system-parachains/people-paseo/src/xcm_config.rs +++ b/system-parachains/people-paseo/src/xcm_config.rs @@ -85,9 +85,10 @@ pub type PriceForSiblingParachainDelivery = polkadot_runtime_common::xcm_sender: XcmpQueue, >; -/// Type for specifying how a `Location` can be converted into an `AccountId`. This is used -/// when determining ownership of accounts for asset transacting and when attempting to use XCM -/// `Transact` in order to determine the dispatch Origin. +/// Type for specifying how a `Location` can be converted into an `AccountId`. +/// +/// This is used when determining ownership of accounts for asset transacting and when attempting to +/// use XCM `Transact` in order to determine the dispatch Origin. pub type LocationToAccountId = ( // The parent (Relay-chain) origin converts to the parent `AccountId`. ParentIsPreset, @@ -116,8 +117,9 @@ pub type FungibleTransactor = FungibleAdapter< >; /// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, -/// ready for dispatching a transaction with XCM's `Transact`. There is an `OriginKind` that can -/// bias the kind of local `Origin` it will become. +/// ready for dispatching a transaction with XCM's `Transact`. +/// +/// There is an `OriginKind` that can bias the kind of local `Origin` it will become. pub type XcmOriginToTransactDispatchOrigin = ( // Sovereign account converter; this attempts to derive an `AccountId` from the origin location // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for From d52ab9b6dce30c5149d69d7af0a3e52c44aa5865 Mon Sep 17 00:00:00 2001 From: Ezequiel Raynaudo Date: Thu, 14 Nov 2024 12:11:06 -0300 Subject: [PATCH 10/18] Update asset-hub to v1.3.4 --- system-parachains/asset-hub-paseo/src/lib.rs | 69 +- .../src/weights/cumulus_pallet_dmp_queue.rs | 130 ---- .../src/weights/pallet_message_queue.rs | 63 +- .../asset-hub-paseo/src/xcm_config.rs | 30 +- .../asset-hub-paseo/tests/tests.rs | 631 +++++++++++++++++- .../asset-hub-paseo/tests/weight_trader.rs | 70 +- 6 files changed, 727 insertions(+), 266 deletions(-) delete mode 100644 system-parachains/asset-hub-paseo/src/weights/cumulus_pallet_dmp_queue.rs diff --git a/system-parachains/asset-hub-paseo/src/lib.rs b/system-parachains/asset-hub-paseo/src/lib.rs index d975cfe..02e5a2b 100644 --- a/system-parachains/asset-hub-paseo/src/lib.rs +++ b/system-parachains/asset-hub-paseo/src/lib.rs @@ -81,7 +81,7 @@ use sp_runtime::{ transaction_validity::{TransactionSource, TransactionValidity}, ApplyExtrinsicResult, Perbill, Permill, }; -use xcm_config::TrustBackedAssetsPalletLocationV3; +use xcm_config::TrustBackedAssetsPalletLocation; use xcm_runtime_apis::{ dry_run::{CallDryRunEffects, Error as XcmDryRunApiError, XcmDryRunEffects}, fees::Error as XcmPaymentApiError, @@ -112,7 +112,7 @@ use frame_system::{ }; use pallet_nfts::PalletFeatures; use parachains_common::{ - message_queue::*, AccountId, AssetIdForTrustBackedAssets, AuraId, + message_queue::*, AccountId, AuraId, AssetIdForTrustBackedAssets, Balance, BlockNumber, Hash, Header, Nonce, Signature, }; @@ -127,7 +127,7 @@ use xcm::{ VersionedAssetId, VersionedAssets, VersionedLocation, VersionedXcm, }; use xcm_config::{ - DotLocation, DotLocationV3, FellowshipLocation, ForeignAssetsConvertedConcreteId, + DotLocation, FellowshipLocation, ForeignAssetsConvertedConcreteId, ForeignCreatorsSovereignAccountOf, GovernanceLocation, PoolAssetsConvertedConcreteId, TrustBackedAssetsConvertedConcreteId, XcmOriginToTransactDispatchOrigin, }; @@ -152,7 +152,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("asset-hub-paseo"), impl_name: create_runtime_str!("asset-hub-paseo"), authoring_version: 1, - spec_version: 1_003_003, + spec_version: 1_003_004, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 15, @@ -290,7 +290,7 @@ impl pallet_transaction_payment::Config for Runtime { type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = impls::tx_payment::FungiblesAdapter< NativeAndAssets, - DotLocationV3, + DotLocation, ResolveAssetTo, >; type WeightToFee = WeightToFee; @@ -349,29 +349,31 @@ parameter_types! { pub const ForeignAssetsMetadataDepositPerByte: Balance = MetadataDepositPerByte::get(); } -/// Assets managed by some foreign location. Note: we do not declare a `ForeignAssetsCall` type, as -/// this type is used in proxy definitions. We assume that a foreign location would not want to set -/// an individual, local account as a proxy for the issuance of their assets. This issuance should -/// be managed by the foreign location's governance. +/// Assets managed by some foreign location. +/// +/// Note: we do not declare a `ForeignAssetsCall` type, as this type is used in proxy definitions. +/// We assume that a foreign location would not want to set an individual, local account as a proxy +/// for the issuance of their assets. This issuance should be managed by the foreign location's +/// governance. pub type ForeignAssetsInstance = pallet_assets::Instance2; impl pallet_assets::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Balance = Balance; - type AssetId = xcm::v3::Location; - type AssetIdParameter = xcm::v3::Location; + type AssetId = xcm::v4::Location; + type AssetIdParameter = xcm::v4::Location; type Currency = Balances; type CreateOrigin = ForeignCreators< ( - FromSiblingParachain, xcm::v3::Location>, + FromSiblingParachain, xcm::v4::Location>, FromNetwork< xcm_config::UniversalLocation, xcm_config::bridging::to_ethereum::EthereumNetwork, - xcm::v3::Location, + xcm::v4::Location, >, ), ForeignCreatorsSovereignAccountOf, AccountId, - xcm::v3::Location, + xcm::v4::Location, >; type ForceOrigin = AssetsForceOrigin; type AssetDeposit = ForeignAssetsAssetDeposit; @@ -488,7 +490,8 @@ impl InstanceFilter for ProxyType { RuntimeCall::Assets { .. } | RuntimeCall::Utility { .. } | RuntimeCall::Multisig { .. } | - RuntimeCall::Nfts { .. } | RuntimeCall::Uniques { .. } + RuntimeCall::Nfts { .. } | + RuntimeCall::Uniques { .. } ) }, ProxyType::AssetOwner => matches!( @@ -759,7 +762,7 @@ impl pallet_asset_conversion_tx_payment::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Fungibles = LocalAndForeignAssets; type OnChargeAssetTransaction = - impls::tx_payment::SwapCreditAdapter; + impls::tx_payment::SwapCreditAdapter; } parameter_types! { @@ -892,11 +895,11 @@ pub type LocalAndForeignAssets = fungibles::UnionOf< Assets, ForeignAssets, LocalFromLeft< - AssetIdForTrustBackedAssetsConvert, + AssetIdForTrustBackedAssetsConvert, AssetIdForTrustBackedAssets, - xcm::v3::Location, + xcm::v4::Location, >, - xcm::v3::Location, + xcm::v4::Location, AccountId, >; @@ -904,8 +907,8 @@ pub type LocalAndForeignAssets = fungibles::UnionOf< pub type NativeAndAssets = fungible::UnionOf< Balances, LocalAndForeignAssets, - TargetFromLeft, - xcm::v3::Location, + TargetFromLeft, + xcm::v4::Location, AccountId, >; @@ -919,18 +922,18 @@ parameter_types! { pub type PoolIdToAccountId = pallet_asset_conversion::AccountIdConverter< AssetConversionPalletId, - (xcm::v3::Location, xcm::v3::Location), + (xcm::v4::Location, xcm::v4::Location), >; impl pallet_asset_conversion::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Balance = Balance; type HigherPrecisionBalance = sp_core::U256; - type AssetKind = xcm::v3::Location; + type AssetKind = xcm::v4::Location; type Assets = NativeAndAssets; type PoolId = (Self::AssetKind, Self::AssetKind); type PoolLocator = pallet_asset_conversion::WithFirstAsset< - DotLocationV3, + DotLocation, AccountId, Self::AssetKind, PoolIdToAccountId, @@ -938,7 +941,7 @@ impl pallet_asset_conversion::Config for Runtime { type PoolAssetId = u32; type PoolAssets = PoolAssets; type PoolSetupFee = PoolSetupFee; - type PoolSetupFeeAsset = DotLocationV3; + type PoolSetupFeeAsset = DotLocation; type PoolSetupFeeTarget = ResolveAssetTo; type LiquidityWithdrawalFee = LiquidityWithdrawalFee; type LPFee = ConstU32<3>; @@ -948,7 +951,7 @@ impl pallet_asset_conversion::Config for Runtime { type WeightInfo = weights::pallet_asset_conversion::WeightInfo; #[cfg(feature = "runtime-benchmarks")] type BenchmarkHelper = assets_common::benchmarks::AssetPairFactory< - DotLocationV3, + DotLocation, parachain_info::Pallet, xcm_config::TrustBackedAssetsPalletIndex, Self::AssetKind, @@ -1350,10 +1353,10 @@ impl_runtime_apis! { } } - impl pallet_asset_conversion::AssetConversionApi for Runtime { + impl pallet_asset_conversion::AssetConversionApi for Runtime { fn quote_price_exact_tokens_for_tokens( - asset1: xcm::v3::Location, - asset2: xcm::v3::Location, + asset1: xcm::v4::Location, + asset2: xcm::v4::Location, amount: Balance, include_fee: bool, ) -> Option { @@ -1366,8 +1369,8 @@ impl_runtime_apis! { } fn quote_price_tokens_for_exact_tokens( - asset1: xcm::v3::Location, - asset2: xcm::v3::Location, + asset1: xcm::v4::Location, + asset2: xcm::v4::Location, amount: Balance, include_fee: bool, ) -> Option { @@ -1380,8 +1383,8 @@ impl_runtime_apis! { } fn get_reserves( - asset1: xcm::v3::Location, - asset2: xcm::v3::Location, + asset1: xcm::v4::Location, + asset2: xcm::v4::Location, ) -> Option<(Balance, Balance)> { AssetConversion::get_reserves(asset1, asset2).ok() } diff --git a/system-parachains/asset-hub-paseo/src/weights/cumulus_pallet_dmp_queue.rs b/system-parachains/asset-hub-paseo/src/weights/cumulus_pallet_dmp_queue.rs deleted file mode 100644 index e3cafb9..0000000 --- a/system-parachains/asset-hub-paseo/src/weights/cumulus_pallet_dmp_queue.rs +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (C) Parity Technologies and the various Polkadot contributors, see Contributions.md -// for a list of specific contributors. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `cumulus_pallet_dmp_queue` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-08-13, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `zur1-vm-benchpas-001`, CPU: `AMD EPYC 9354 32-Core Processor` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./paseo.ah.local.raw.json")`, DB CACHE: 1024 - -// Executed Command: -// ./polkadot-parachain -// benchmark -// pallet -// --chain=./paseo.ah.local.raw.json -// --steps=50 -// --repeat=20 -// --pallet=cumulus_pallet_dmp_queue -// --extrinsic=* -// --wasm-execution=compiled -// --heap-pages=4096 -// --output=./ah-weights/ -// --header=./file_header.txt - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] -#![allow(missing_docs)] - -use frame_support::{traits::Get, weights::Weight}; -use core::marker::PhantomData; - -/// Weight functions for `cumulus_pallet_dmp_queue`. -pub struct WeightInfo(PhantomData); -impl cumulus_pallet_dmp_queue::WeightInfo for WeightInfo { - /// Storage: `DmpQueue::MigrationStatus` (r:1 w:1) - /// Proof: `DmpQueue::MigrationStatus` (`max_values`: Some(1), `max_size`: Some(1028), added: 1523, mode: `MaxEncodedLen`) - /// Storage: UNKNOWN KEY `0xcd5c1f6df63bc97f4a8ce37f14a50ca754904d6d8c6fe06c4e5965f9b8397421` (r:1 w:0) - /// Proof: UNKNOWN KEY `0xcd5c1f6df63bc97f4a8ce37f14a50ca754904d6d8c6fe06c4e5965f9b8397421` (r:1 w:0) - /// Storage: UNKNOWN KEY `0xcd5c1f6df63bc97f4a8ce37f14a50ca7d95d3e948effbeccff2de2c182672836` (r:1 w:1) - /// Proof: UNKNOWN KEY `0xcd5c1f6df63bc97f4a8ce37f14a50ca7d95d3e948effbeccff2de2c182672836` (r:1 w:1) - /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::ServiceHead` (r:1 w:1) - /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::Pages` (r:0 w:1) - /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65585), added: 68060, mode: `MaxEncodedLen`) - fn on_idle_good_msg() -> Weight { - // Proof Size summary in bytes: - // Measured: `65696` - // Estimated: `69161` - // Minimum execution time: 112_439_000 picoseconds. - Weight::from_parts(118_148_000, 0) - .saturating_add(Weight::from_parts(0, 69161)) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(5)) - } - /// Storage: `DmpQueue::MigrationStatus` (r:1 w:1) - /// Proof: `DmpQueue::MigrationStatus` (`max_values`: Some(1), `max_size`: Some(1028), added: 1523, mode: `MaxEncodedLen`) - /// Storage: UNKNOWN KEY `0xcd5c1f6df63bc97f4a8ce37f14a50ca754904d6d8c6fe06c4e5965f9b8397421` (r:1 w:0) - /// Proof: UNKNOWN KEY `0xcd5c1f6df63bc97f4a8ce37f14a50ca754904d6d8c6fe06c4e5965f9b8397421` (r:1 w:0) - /// Storage: UNKNOWN KEY `0xcd5c1f6df63bc97f4a8ce37f14a50ca7d95d3e948effbeccff2de2c182672836` (r:1 w:1) - /// Proof: UNKNOWN KEY `0xcd5c1f6df63bc97f4a8ce37f14a50ca7d95d3e948effbeccff2de2c182672836` (r:1 w:1) - fn on_idle_large_msg() -> Weight { - // Proof Size summary in bytes: - // Measured: `65659` - // Estimated: `69124` - // Minimum execution time: 67_883_000 picoseconds. - Weight::from_parts(85_037_000, 0) - .saturating_add(Weight::from_parts(0, 69124)) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `DmpQueue::MigrationStatus` (r:1 w:1) - /// Proof: `DmpQueue::MigrationStatus` (`max_values`: Some(1), `max_size`: Some(1028), added: 1523, mode: `MaxEncodedLen`) - /// Storage: UNKNOWN KEY `0xcd5c1f6df63bc97f4a8ce37f14a50ca754904d6d8c6fe06c4e5965f9b8397421` (r:1 w:0) - /// Proof: UNKNOWN KEY `0xcd5c1f6df63bc97f4a8ce37f14a50ca754904d6d8c6fe06c4e5965f9b8397421` (r:1 w:0) - /// Storage: UNKNOWN KEY `0xcd5c1f6df63bc97f4a8ce37f14a50ca70f923ef3252d0166429d36d20ed665a8` (r:1 w:1) - /// Proof: UNKNOWN KEY `0xcd5c1f6df63bc97f4a8ce37f14a50ca70f923ef3252d0166429d36d20ed665a8` (r:1 w:1) - /// Storage: UNKNOWN KEY `0xcd5c1f6df63bc97f4a8ce37f14a50ca772275f64c354954352b71eea39cfaca2` (r:1 w:1) - /// Proof: UNKNOWN KEY `0xcd5c1f6df63bc97f4a8ce37f14a50ca772275f64c354954352b71eea39cfaca2` (r:1 w:1) - /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::ServiceHead` (r:1 w:1) - /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::Pages` (r:0 w:1) - /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65585), added: 68060, mode: `MaxEncodedLen`) - fn on_idle_overweight_good_msg() -> Weight { - // Proof Size summary in bytes: - // Measured: `65726` - // Estimated: `69191` - // Minimum execution time: 105_189_000 picoseconds. - Weight::from_parts(110_317_000, 0) - .saturating_add(Weight::from_parts(0, 69191)) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(6)) - } - /// Storage: `DmpQueue::MigrationStatus` (r:1 w:1) - /// Proof: `DmpQueue::MigrationStatus` (`max_values`: Some(1), `max_size`: Some(1028), added: 1523, mode: `MaxEncodedLen`) - /// Storage: UNKNOWN KEY `0xcd5c1f6df63bc97f4a8ce37f14a50ca754904d6d8c6fe06c4e5965f9b8397421` (r:1 w:0) - /// Proof: UNKNOWN KEY `0xcd5c1f6df63bc97f4a8ce37f14a50ca754904d6d8c6fe06c4e5965f9b8397421` (r:1 w:0) - /// Storage: UNKNOWN KEY `0xcd5c1f6df63bc97f4a8ce37f14a50ca70f923ef3252d0166429d36d20ed665a8` (r:1 w:1) - /// Proof: UNKNOWN KEY `0xcd5c1f6df63bc97f4a8ce37f14a50ca70f923ef3252d0166429d36d20ed665a8` (r:1 w:1) - /// Storage: UNKNOWN KEY `0xcd5c1f6df63bc97f4a8ce37f14a50ca772275f64c354954352b71eea39cfaca2` (r:1 w:1) - /// Proof: UNKNOWN KEY `0xcd5c1f6df63bc97f4a8ce37f14a50ca772275f64c354954352b71eea39cfaca2` (r:1 w:1) - fn on_idle_overweight_large_msg() -> Weight { - // Proof Size summary in bytes: - // Measured: `65689` - // Estimated: `69154` - // Minimum execution time: 57_206_000 picoseconds. - Weight::from_parts(61_574_000, 0) - .saturating_add(Weight::from_parts(0, 69154)) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(3)) - } -} diff --git a/system-parachains/asset-hub-paseo/src/weights/pallet_message_queue.rs b/system-parachains/asset-hub-paseo/src/weights/pallet_message_queue.rs index b201df9..232738c 100644 --- a/system-parachains/asset-hub-paseo/src/weights/pallet_message_queue.rs +++ b/system-parachains/asset-hub-paseo/src/weights/pallet_message_queue.rs @@ -17,24 +17,23 @@ //! Autogenerated weights for `pallet_message_queue` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-08-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `ggwpez-ref-hw`, CPU: `AMD EPYC 7232P 8-Core Processor` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./asset-hub-paseo-chain-spec.json")`, DB CACHE: 1024 +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// ./target/production/paseo-parachain +// frame-omni-bencher +// v1 // benchmark // pallet -// --chain=./asset-hub-paseo-chain-spec.json -// --steps=50 -// --repeat=20 -// --pallet=pallet_message_queue -// --extrinsic=* -// --wasm-execution=compiled -// --heap-pages=4096 -// --output=./asset-hub-paseo-weights/ -// --header=./file_header.txt +// --runtime +// target/production/wbuild/asset-hub-paseo-runtime/asset_hub_paseo_runtime.compact.compressed.wasm +// --pallet=pallet-message-queue +// --extrinsic= +// --output +// system-parachains/asset-hubs/asset-hub-paseo/src/weights/pallet_message_queue.rs +// --header=.github/scripts/cmd/file_header.txt #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -55,8 +54,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `260` // Estimated: `6044` - // Minimum execution time: 14_740_000 picoseconds. - Weight::from_parts(15_120_000, 0) + // Minimum execution time: 19_870_000 picoseconds. + Weight::from_parts(20_150_000, 0) .saturating_add(Weight::from_parts(0, 6044)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -69,8 +68,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `255` // Estimated: `6044` - // Minimum execution time: 13_030_000 picoseconds. - Weight::from_parts(13_470_000, 0) + // Minimum execution time: 18_080_000 picoseconds. + Weight::from_parts(18_301_000, 0) .saturating_add(Weight::from_parts(0, 6044)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -81,8 +80,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `42` // Estimated: `3517` - // Minimum execution time: 5_920_000 picoseconds. - Weight::from_parts(6_130_000, 0) + // Minimum execution time: 7_820_000 picoseconds. + Weight::from_parts(8_070_000, 0) .saturating_add(Weight::from_parts(0, 3517)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -93,8 +92,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `109` // Estimated: `69050` - // Minimum execution time: 8_230_000 picoseconds. - Weight::from_parts(8_490_000, 0) + // Minimum execution time: 10_530_000 picoseconds. + Weight::from_parts(10_820_000, 0) .saturating_add(Weight::from_parts(0, 69050)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -105,8 +104,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `109` // Estimated: `69050` - // Minimum execution time: 8_340_000 picoseconds. - Weight::from_parts(8_600_000, 0) + // Minimum execution time: 10_650_000 picoseconds. + Weight::from_parts(11_050_000, 0) .saturating_add(Weight::from_parts(0, 69050)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -119,8 +118,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 156_191_000 picoseconds. - Weight::from_parts(157_371_000, 0) + // Minimum execution time: 161_831_000 picoseconds. + Weight::from_parts(162_761_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -132,8 +131,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `208` // Estimated: `3517` - // Minimum execution time: 8_661_000 picoseconds. - Weight::from_parts(8_900_000, 0) + // Minimum execution time: 12_210_000 picoseconds. + Weight::from_parts(12_511_000, 0) .saturating_add(Weight::from_parts(0, 3517)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -146,8 +145,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `65704` // Estimated: `69050` - // Minimum execution time: 53_740_000 picoseconds. - Weight::from_parts(54_180_000, 0) + // Minimum execution time: 66_210_000 picoseconds. + Weight::from_parts(66_961_000, 0) .saturating_add(Weight::from_parts(0, 69050)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -160,8 +159,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `65704` // Estimated: `69050` - // Minimum execution time: 71_451_000 picoseconds. - Weight::from_parts(72_250_000, 0) + // Minimum execution time: 85_680_000 picoseconds. + Weight::from_parts(86_270_000, 0) .saturating_add(Weight::from_parts(0, 69050)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -174,8 +173,8 @@ impl pallet_message_queue::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `65704` // Estimated: `69050` - // Minimum execution time: 106_120_000 picoseconds. - Weight::from_parts(107_530_000, 0) + // Minimum execution time: 119_101_000 picoseconds. + Weight::from_parts(120_431_000, 0) .saturating_add(Weight::from_parts(0, 69050)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/system-parachains/asset-hub-paseo/src/xcm_config.rs b/system-parachains/asset-hub-paseo/src/xcm_config.rs index 4d2efcf..78385ab 100644 --- a/system-parachains/asset-hub-paseo/src/xcm_config.rs +++ b/system-parachains/asset-hub-paseo/src/xcm_config.rs @@ -60,7 +60,6 @@ use xcm_executor::{traits::ConvertLocation, XcmExecutor}; parameter_types! { pub const DotLocation: Location = Location::parent(); - pub const DotLocationV3: xcm::v3::Location = xcm::v3::Location::parent(); pub const RelayNetwork: Option = Some(NetworkId::Polkadot); pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub UniversalLocation: InteriorLocation = @@ -69,8 +68,6 @@ parameter_types! { pub TrustBackedAssetsPalletIndex: u8 = ::index() as u8; pub TrustBackedAssetsPalletLocation: Location = PalletInstance(TrustBackedAssetsPalletIndex::get()).into(); - pub TrustBackedAssetsPalletLocationV3: xcm::v3::Location = - xcm::v3::Junction::PalletInstance(TrustBackedAssetsPalletIndex::get()).into(); pub CheckingAccount: AccountId = PolkadotXcm::check_account(); pub FellowshipLocation: Location = Location::new(1, Parachain(system_parachain::COLLECTIVES_ID)); pub const GovernanceLocation: Location = Location::parent(); @@ -86,9 +83,10 @@ parameter_types! { .unwrap_or(TreasuryAccount::get()); } -/// Type for specifying how a `Location` can be converted into an `AccountId`. This is used -/// when determining ownership of accounts for asset transacting and when attempting to use XCM -/// `Transact` in order to determine the dispatch Origin. +/// Type for specifying how a `Location` can be converted into an `AccountId`. +/// +/// This is used when determining ownership of accounts for asset transacting and when attempting to +/// use XCM `Transact` in order to determine the dispatch Origin. pub type LocationToAccountId = ( // The parent (Relay-chain) origin converts to the parent `AccountId`. ParentIsPreset, @@ -154,7 +152,7 @@ pub type ForeignAssetsConvertedConcreteId = assets_common::ForeignAssetsConverte StartsWithExplicitGlobalConsensus, ), Balance, - xcm::v3::Location, + xcm::v4::Location, >; /// Means for transacting foreign assets from different global consensus. @@ -199,8 +197,9 @@ pub type AssetTransactors = (FungibleTransactor, FungiblesTransactor, ForeignFungiblesTransactor, PoolFungiblesTransactor); /// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, -/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can -/// biases the kind of local `Origin` it will become. +/// ready for dispatching a transaction with Xcm's `Transact`. +/// +/// There is an `OriginKind` which can biases the kind of local `Origin` it will become. pub type XcmOriginToTransactDispatchOrigin = ( // Sovereign account converter; this attempts to derive an `AccountId` from the origin location // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for @@ -333,7 +332,7 @@ impl xcm_executor::Config for XcmConfig { // This trader allows to pay with any assets exchangeable to DOT with // [`AssetConversion`]. cumulus_primitives_utility::SwapFirstAssetTrader< - DotLocationV3, + DotLocation, AssetConversion, WeightToFee, NativeAndAssets, @@ -341,7 +340,7 @@ impl xcm_executor::Config for XcmConfig { TrustBackedAssetsAsLocation< TrustBackedAssetsPalletLocation, Balance, - xcm::v3::Location, + xcm::v4::Location, >, ForeignAssetsConvertedConcreteId, ), @@ -477,9 +476,9 @@ pub type ForeignCreatorsSovereignAccountOf = ( /// Simple conversion of `u32` into an `AssetId` for use in benchmarking. pub struct XcmBenchmarkHelper; #[cfg(feature = "runtime-benchmarks")] -impl pallet_assets::BenchmarkHelper for XcmBenchmarkHelper { - fn create_asset_id_parameter(id: u32) -> xcm::v3::Location { - xcm::v3::Location::new(1, xcm::v3::Junction::Parachain(id)) +impl pallet_assets::BenchmarkHelper for XcmBenchmarkHelper { + fn create_asset_id_parameter(id: u32) -> xcm::v4::Location { + xcm::v4::Location::new(1, xcm::v4::Junction::Parachain(id)) } } @@ -609,7 +608,8 @@ pub mod bridging { } } impl, OriginLocation: Get> - ContainsPair for RemoteAssetFromLocation + ContainsPair + for RemoteAssetFromLocation { fn contains(asset: &Asset, origin: &Location) -> bool { >::contains(&asset.id.0, origin) diff --git a/system-parachains/asset-hub-paseo/tests/tests.rs b/system-parachains/asset-hub-paseo/tests/tests.rs index 9032c64..d88154a 100644 --- a/system-parachains/asset-hub-paseo/tests/tests.rs +++ b/system-parachains/asset-hub-paseo/tests/tests.rs @@ -78,7 +78,7 @@ fn slot_durations() -> SlotDurations { fn setup_pool_for_paying_fees_with_foreign_assets( (foreign_asset_owner, foreign_asset_id_location, foreign_asset_id_minimum_balance): ( AccountId, - xcm::v3::Location, + xcm::v4::Location, Balance, ), ) { @@ -86,7 +86,7 @@ fn setup_pool_for_paying_fees_with_foreign_assets( // setup a pool to pay fees with `foreign_asset_id_location` tokens let pool_owner: AccountId = [14u8; 32].into(); - let native_asset = xcm::v3::Location::parent(); + let native_asset = xcm::v4::Location::parent(); let pool_liquidity: Balance = existential_deposit.max(foreign_asset_id_minimum_balance).mul(100_000); @@ -98,15 +98,15 @@ fn setup_pool_for_paying_fees_with_foreign_assets( assert_ok!(ForeignAssets::mint( RuntimeOrigin::signed(foreign_asset_owner), - foreign_asset_id_location, + foreign_asset_id_location.clone(), pool_owner.clone().into(), (foreign_asset_id_minimum_balance + pool_liquidity).mul(2), )); assert_ok!(AssetConversion::create_pool( RuntimeOrigin::signed(pool_owner.clone()), - Box::new(native_asset), - Box::new(foreign_asset_id_location) + Box::new(native_asset.clone()), + Box::new(foreign_asset_id_location.clone()) )); assert_ok!(AssetConversion::add_liquidity( @@ -152,15 +152,15 @@ fn test_assets_balances_api_works() { .build() .execute_with(|| { let local_asset_id = 1; - let foreign_asset_id_location = xcm::v3::Location::new( + let foreign_asset_id_location = xcm::v4::Location::new( 1, - [xcm::v3::Junction::Parachain(1234), xcm::v3::Junction::GeneralIndex(12345)], + [xcm::v4::Junction::Parachain(1234), xcm::v4::Junction::GeneralIndex(12345)], ); // check before assert_eq!(Assets::balance(local_asset_id, AccountId::from(ALICE)), 0); assert_eq!( - ForeignAssets::balance(foreign_asset_id_location, AccountId::from(ALICE)), + ForeignAssets::balance(foreign_asset_id_location.clone(), AccountId::from(ALICE)), 0 ); assert_eq!(Balances::free_balance(AccountId::from(ALICE)), 0); @@ -197,7 +197,7 @@ fn test_assets_balances_api_works() { let foreign_asset_minimum_asset_balance = 3333333_u128; assert_ok!(ForeignAssets::force_create( RuntimeHelper::root_origin(), - foreign_asset_id_location, + foreign_asset_id_location.clone(), AccountId::from(SOME_ASSET_ADMIN).into(), false, foreign_asset_minimum_asset_balance @@ -206,7 +206,7 @@ fn test_assets_balances_api_works() { // We first mint enough asset for the account to exist for assets assert_ok!(ForeignAssets::mint( RuntimeHelper::origin_of(AccountId::from(SOME_ASSET_ADMIN)), - foreign_asset_id_location, + foreign_asset_id_location.clone(), AccountId::from(ALICE).into(), 6 * foreign_asset_minimum_asset_balance )); @@ -217,7 +217,7 @@ fn test_assets_balances_api_works() { minimum_asset_balance ); assert_eq!( - ForeignAssets::balance(foreign_asset_id_location, AccountId::from(ALICE)), + ForeignAssets::balance(foreign_asset_id_location.clone(), AccountId::from(ALICE)), 6 * minimum_asset_balance ); assert_eq!(Balances::free_balance(AccountId::from(ALICE)), some_currency); @@ -269,7 +269,7 @@ asset_test_utils::include_teleports_for_native_asset_works!( 1000 ); -asset_test_utils::include_teleports_for_foreign_assets_works!( +include_teleports_for_foreign_assets_works!( Runtime, AllPalletsWithoutSystem, XcmConfig, @@ -333,13 +333,13 @@ asset_test_utils::include_asset_transactor_transfer_with_pallet_assets_instance_ Runtime, XcmConfig, ForeignAssetsInstance, - xcm::v3::Location, + xcm::v4::Location, JustTry, collator_session_keys(), ExistentialDeposit::get(), - xcm::v3::Location::new( + xcm::v4::Location::new( 1, - [xcm::v3::Junction::Parachain(1313), xcm::v3::Junction::GeneralIndex(12345)] + [xcm::v4::Junction::Parachain(1313), xcm::v4::Junction::GeneralIndex(12345)] ), Box::new(|| { assert!(Assets::asset_ids().collect::>().is_empty()); @@ -355,8 +355,8 @@ asset_test_utils::include_create_and_manage_foreign_assets_for_local_consensus_p WeightToFee, ForeignCreatorsSovereignAccountOf, ForeignAssetsInstance, - xcm::v3::Location, - WithLatestLocationConverter, + xcm::v4::Location, + WithLatestLocationConverter, collator_session_keys(), ExistentialDeposit::get(), AssetDeposit::get(), @@ -732,3 +732,600 @@ fn change_xcm_bridge_hub_ethereum_base_fee_by_governance_works() { }, ) } + +#[allow(clippy::too_many_arguments)] +pub mod remove_when_updated_to_stable2409 { + use crate::{AccountId, Balance, TestBridgingConfig}; + + use asset_test_utils::*; + use codec::Encode; + use core::fmt::Debug; + use frame_support::{ + assert_ok, + traits::{ + fungible::Mutate, Currency, OnFinalize, OnInitialize, OriginTrait, ProcessMessageError, + }, + }; + use frame_system::pallet_prelude::BlockNumberFor; + use sp_core::Get; + use sp_runtime::traits::StaticLookup; + use xcm::prelude::*; + use xcm_builder::{CreateMatcher, MatchXcm}; + use xcm_executor::{traits::ConvertLocation, XcmExecutor}; + + #[macro_export] + macro_rules! include_teleports_for_foreign_assets_works( + ( + $runtime:path, + $all_pallets_without_system:path, + $xcm_config:path, + $checking_account:path, + $weight_to_fee:path, + $hrmp_channel_opener:path, + $sovereign_account_of:path, + $assets_pallet_instance:path, + $collator_session_key:expr, + $slot_durations:expr, + $existential_deposit:expr, + $unwrap_pallet_xcm_event:expr, + $unwrap_xcmp_queue_event:expr + ) => { + #[test] + fn teleports_for_foreign_assets_works() { + const BOB: [u8; 32] = [2u8; 32]; + let target_account = parachains_common::AccountId::from(BOB); + const SOME_ASSET_OWNER: [u8; 32] = [5u8; 32]; + let asset_owner = parachains_common::AccountId::from(SOME_ASSET_OWNER); + + $crate::remove_when_updated_to_stable2409::teleports_for_foreign_assets_works::< + $runtime, + $all_pallets_without_system, + $xcm_config, + $checking_account, + $weight_to_fee, + $hrmp_channel_opener, + $sovereign_account_of, + $assets_pallet_instance + >( + $collator_session_key, + $slot_durations, + target_account, + $existential_deposit, + asset_owner, + $unwrap_pallet_xcm_event, + $unwrap_xcmp_queue_event + ) + } + } + ); + + /// Test-case makes sure that `Runtime` can receive teleported assets from sibling parachain, + /// and can teleport it back + pub fn teleports_for_foreign_assets_works< + Runtime, + AllPalletsWithoutSystem, + XcmConfig, + CheckingAccount, + WeightToFee, + HrmpChannelOpener, + SovereignAccountOf, + ForeignAssetsPalletInstance, + >( + collator_session_keys: CollatorSessionKeys, + slot_durations: SlotDurations, + target_account: AccountIdOf, + existential_deposit: BalanceOf, + asset_owner: AccountIdOf, + unwrap_pallet_xcm_event: Box) -> Option>>, + unwrap_xcmp_queue_event: Box< + dyn Fn(Vec) -> Option>, + >, + ) where + Runtime: frame_system::Config + + pallet_balances::Config + + pallet_session::Config + + pallet_xcm::Config + + parachain_info::Config + + pallet_collator_selection::Config + + cumulus_pallet_parachain_system::Config + + cumulus_pallet_xcmp_queue::Config + + pallet_assets::Config + + pallet_timestamp::Config, + AllPalletsWithoutSystem: + OnInitialize> + OnFinalize>, + AccountIdOf: Into<[u8; 32]>, + ValidatorIdOf: From>, + BalanceOf: From, + XcmConfig: xcm_executor::Config, + CheckingAccount: Get>, + HrmpChannelOpener: frame_support::inherent::ProvideInherent< + Call = cumulus_pallet_parachain_system::Call, + >, + WeightToFee: frame_support::weights::WeightToFee, + ::Balance: From + Into, + SovereignAccountOf: ConvertLocation>, + >::AssetId: + From + Into, + >::AssetIdParameter: + From + Into, + >::Balance: + From + Into, + ::AccountId: + Into<<::RuntimeOrigin as OriginTrait>::AccountId>, + <::Lookup as StaticLookup>::Source: + From<::AccountId>, + ::AccountId: From, + ForeignAssetsPalletInstance: 'static, + { + // foreign parachain with the same consensus currency as asset + let foreign_para_id = 2222; + let foreign_asset_id_location = xcm::v4::Location { + parents: 1, + interior: [ + xcm::v4::Junction::Parachain(foreign_para_id), + xcm::v4::Junction::GeneralIndex(1234567), + ] + .into(), + }; + + // foreign creator, which can be sibling parachain to match ForeignCreators + let foreign_creator = + Location { parents: 1, interior: [Parachain(foreign_para_id)].into() }; + let foreign_creator_as_account_id = + SovereignAccountOf::convert_location(&foreign_creator).expect(""); + + // we want to buy execution with local relay chain currency + let buy_execution_fee_amount = + WeightToFee::weight_to_fee(&Weight::from_parts(90_000_000_000, 0)); + let buy_execution_fee = + Asset { id: AssetId(Location::parent()), fun: Fungible(buy_execution_fee_amount) }; + + let teleported_foreign_asset_amount = 10_000_000_000_000; + let runtime_para_id = 1000; + ExtBuilder::::default() + .with_collators(collator_session_keys.collators()) + .with_session_keys(collator_session_keys.session_keys()) + .with_balances(vec![ + ( + foreign_creator_as_account_id, + existential_deposit + (buy_execution_fee_amount * 2).into(), + ), + (target_account.clone(), existential_deposit), + (CheckingAccount::get(), existential_deposit), + ]) + .with_safe_xcm_version(XCM_VERSION) + .with_para_id(runtime_para_id.into()) + .with_tracing() + .build() + .execute_with(|| { + let mut alice = [0u8; 32]; + alice[0] = 1; + + let included_head = RuntimeHelper::::run_to_block( + 2, + AccountId::from(alice).into(), + ); + // checks target_account before + assert_eq!( + >::free_balance(&target_account), + existential_deposit + ); + // check `CheckingAccount` before + assert_eq!( + >::free_balance(CheckingAccount::get()), + existential_deposit + ); + assert_eq!( + >::balance( + foreign_asset_id_location.clone().into(), + &target_account + ), + 0.into() + ); + assert_eq!( + >::balance( + foreign_asset_id_location.clone().into(), + CheckingAccount::get() + ), + 0.into() + ); + // check totals before + assert_total::< + pallet_assets::Pallet, + AccountIdOf, + >(foreign_asset_id_location.clone(), 0, 0); + + // create foreign asset (0 total issuance) + let asset_minimum_asset_balance = 3333333_u128; + assert_ok!( + >::force_create( + RuntimeHelper::::root_origin(), + foreign_asset_id_location.clone().into(), + asset_owner.into(), + false, + asset_minimum_asset_balance.into() + ) + ); + assert_total::< + pallet_assets::Pallet, + AccountIdOf, + >(foreign_asset_id_location.clone(), 0, 0); + assert!(teleported_foreign_asset_amount > asset_minimum_asset_balance); + + // 1. process received teleported assets from sibling parachain (foreign_para_id) + let xcm = Xcm(vec![ + // BuyExecution with relaychain native token + WithdrawAsset(buy_execution_fee.clone().into()), + BuyExecution { + fees: Asset { + id: AssetId(Location::parent()), + fun: Fungible(buy_execution_fee_amount), + }, + weight_limit: Limited(Weight::from_parts(403531000, 65536)), + }, + // Process teleported asset + ReceiveTeleportedAsset(Assets::from(vec![Asset { + id: AssetId(foreign_asset_id_location.clone()), + fun: Fungible(teleported_foreign_asset_amount), + }])), + DepositAsset { + assets: Wild(AllOf { + id: AssetId(foreign_asset_id_location.clone()), + fun: WildFungibility::Fungible, + }), + beneficiary: Location { + parents: 0, + interior: [AccountId32 { + network: None, + id: target_account.clone().into(), + }] + .into(), + }, + }, + ExpectTransactStatus(MaybeErrorCode::Success), + ]); + let mut hash = xcm.using_encoded(sp_io::hashing::blake2_256); + + let outcome = XcmExecutor::::prepare_and_execute( + foreign_creator, + xcm, + &mut hash, + RuntimeHelper::::xcm_max_weight(XcmReceivedFrom::Sibling), + Weight::zero(), + ); + assert_ok!(outcome.ensure_complete()); + + // checks target_account after + assert_eq!( + >::free_balance(&target_account), + existential_deposit + ); + assert_eq!( + >::balance( + foreign_asset_id_location.clone().into(), + &target_account + ), + teleported_foreign_asset_amount.into() + ); + // checks `CheckingAccount` after + assert_eq!( + >::free_balance(CheckingAccount::get()), + existential_deposit + ); + assert_eq!( + >::balance( + foreign_asset_id_location.clone().into(), + CheckingAccount::get() + ), + 0.into() + ); + // check total after (twice: target_account + CheckingAccount) + assert_total::< + pallet_assets::Pallet, + AccountIdOf, + >( + foreign_asset_id_location.clone(), + teleported_foreign_asset_amount, + teleported_foreign_asset_amount, + ); + + // 2. try to teleport asset back to source parachain (foreign_para_id) + { + let dest = Location::new(1, [Parachain(foreign_para_id)]); + let mut dest_beneficiary = Location::new(1, [Parachain(foreign_para_id)]) + .appended_with(AccountId32 { + network: None, + id: sp_runtime::AccountId32::new([3; 32]).into(), + }) + .unwrap(); + dest_beneficiary.reanchor(&dest, &XcmConfig::UniversalLocation::get()).unwrap(); + + let target_account_balance_before_teleport = + >::balance( + foreign_asset_id_location.clone().into(), + &target_account, + ); + let asset_to_teleport_away = asset_minimum_asset_balance * 3; + assert!( + asset_to_teleport_away < + (target_account_balance_before_teleport - + asset_minimum_asset_balance.into()) + .into() + ); + + // Make sure the target account has enough native asset to pay for delivery fees + let delivery_fees = + xcm_helpers::teleport_assets_delivery_fees::( + (foreign_asset_id_location.clone(), asset_to_teleport_away).into(), + 0, + Unlimited, + dest_beneficiary.clone(), + dest.clone(), + ); + >::mint_into( + &target_account, + delivery_fees.into(), + ) + .unwrap(); + + assert_ok!( + RuntimeHelper::::do_teleport_assets::( + RuntimeHelper::::origin_of(target_account.clone()), + dest, + dest_beneficiary, + (foreign_asset_id_location.clone(), asset_to_teleport_away), + Some((runtime_para_id, foreign_para_id)), + included_head, + &alice, + &slot_durations, + ) + ); + + // check balances + assert_eq!( + >::balance( + foreign_asset_id_location.clone().into(), + &target_account + ), + (target_account_balance_before_teleport - asset_to_teleport_away.into()) + ); + assert_eq!( + >::balance( + foreign_asset_id_location.clone().into(), + CheckingAccount::get() + ), + 0.into() + ); + // check total after (twice: target_account + CheckingAccount) + assert_total::< + pallet_assets::Pallet, + AccountIdOf, + >( + foreign_asset_id_location.clone(), + teleported_foreign_asset_amount - asset_to_teleport_away, + teleported_foreign_asset_amount - asset_to_teleport_away, + ); + + // check events + RuntimeHelper::::assert_pallet_xcm_event_outcome( + &unwrap_pallet_xcm_event, + |outcome| { + assert_ok!(outcome.ensure_complete()); + }, + ); + assert!(RuntimeHelper::::xcmp_queue_message_sent( + unwrap_xcmp_queue_event + ) + .is_some()); + } + }) + } + + /// Helper function to verify `xcm` contains all relevant instructions expected on destination + /// chain as part of a reserve-asset-transfer. + pub(crate) fn assert_matches_reserve_asset_deposited_instructions( + xcm: &mut Xcm, + expected_reserve_assets_deposited: &Assets, + expected_beneficiary: &Location, + ) { + let _ = xcm + .0 + .matcher() + .skip_inst_while(|inst| !matches!(inst, ReserveAssetDeposited(..))) + .expect("no instruction ReserveAssetDeposited?") + .match_next_inst(|instr| match instr { + ReserveAssetDeposited(reserve_assets) => { + assert_eq!(reserve_assets.clone(), expected_reserve_assets_deposited.clone()); + Ok(()) + }, + _ => Err(ProcessMessageError::BadFormat), + }) + .expect("expected instruction ReserveAssetDeposited") + .match_next_inst(|instr| match instr { + ClearOrigin => Ok(()), + _ => Err(ProcessMessageError::BadFormat), + }) + .expect("expected instruction ClearOrigin") + .match_next_inst(|instr| match instr { + BuyExecution { .. } => Ok(()), + _ => Err(ProcessMessageError::BadFormat), + }) + .expect("expected instruction BuyExecution") + .match_next_inst(|instr| match instr { + DepositAsset { assets: _, beneficiary } if beneficiary == expected_beneficiary => + Ok(()), + _ => Err(ProcessMessageError::BadFormat), + }) + .expect("expected instruction DepositAsset"); + } + + pub fn receive_reserve_asset_deposited_from_different_consensus_works< + Runtime, + AllPalletsWithoutSystem, + XcmConfig, + ForeignAssetsPalletInstance, + >( + collator_session_keys: CollatorSessionKeys, + existential_deposit: BalanceOf, + target_account: AccountIdOf, + block_author_account: AccountIdOf, + (foreign_asset_owner, foreign_asset_id_location, foreign_asset_id_minimum_balance): ( + AccountIdOf, + xcm::v4::Location, + u128, + ), + foreign_asset_id_amount_to_transfer: u128, + prepare_configuration: impl FnOnce() -> TestBridgingConfig, + (bridge_instance, universal_origin, descend_origin): (Junctions, Junction, Junctions), /* bridge adds origin manipulation on the way */ + additional_checks_before: impl FnOnce(), + additional_checks_after: impl FnOnce(), + ) where + Runtime: frame_system::Config + + pallet_balances::Config + + pallet_session::Config + + pallet_xcm::Config + + parachain_info::Config + + pallet_collator_selection::Config + + cumulus_pallet_parachain_system::Config + + cumulus_pallet_xcmp_queue::Config + + pallet_assets::Config + + pallet_timestamp::Config, + AllPalletsWithoutSystem: + OnInitialize> + OnFinalize>, + AccountIdOf: Into<[u8; 32]> + From<[u8; 32]>, + ValidatorIdOf: From>, + BalanceOf: From + Into, + XcmConfig: xcm_executor::Config, + >::AssetId: + From + Into, + >::AssetIdParameter: + From + Into, + >::Balance: + From + Into + From, + ::AccountId: Into<<::RuntimeOrigin as OriginTrait>::AccountId> + + Into, + <::Lookup as StaticLookup>::Source: + From<::AccountId>, + ForeignAssetsPalletInstance: 'static, + { + ExtBuilder::::default() + .with_collators(collator_session_keys.collators()) + .with_session_keys(collator_session_keys.session_keys()) + .with_tracing() + .build() + .execute_with(|| { + // Set account as block author, who will receive fees + RuntimeHelper::::run_to_block( + 2, + block_author_account.clone(), + ); + + // drip 'ED' user target account + let _ = >::deposit_creating( + &target_account, + existential_deposit, + ); + + // create foreign asset for wrapped/derived representation + assert_ok!( + >::force_create( + RuntimeHelper::::root_origin(), + foreign_asset_id_location.clone().into(), + foreign_asset_owner.into(), + true, // is_sufficient=true + foreign_asset_id_minimum_balance.into() + ) + ); + + // prepare bridge config + let TestBridgingConfig { local_bridge_hub_location, .. } = prepare_configuration(); + + // Balances before + assert_eq!( + >::free_balance(&target_account), + existential_deposit.clone() + ); + + // ForeignAssets balances before + assert_eq!( + >::balance( + foreign_asset_id_location.clone().into(), + &target_account + ), + 0.into() + ); + + // additional check before + additional_checks_before(); + + let expected_assets = Assets::from(vec![Asset { + id: AssetId(foreign_asset_id_location.clone()), + fun: Fungible(foreign_asset_id_amount_to_transfer), + }]); + let expected_beneficiary = Location::new( + 0, + [AccountId32 { network: None, id: target_account.clone().into() }], + ); + + // Call received XCM execution + let xcm = Xcm(vec![ + DescendOrigin(bridge_instance), + UniversalOrigin(universal_origin), + DescendOrigin(descend_origin), + ReserveAssetDeposited(expected_assets.clone()), + ClearOrigin, + BuyExecution { + fees: Asset { + id: AssetId(foreign_asset_id_location.clone()), + fun: Fungible(foreign_asset_id_amount_to_transfer), + }, + weight_limit: Unlimited, + }, + DepositAsset { + assets: Wild(AllCounted(1)), + beneficiary: expected_beneficiary.clone(), + }, + SetTopic([ + 220, 188, 144, 32, 213, 83, 111, 175, 44, 210, 111, 19, 90, 165, 191, 112, + 140, 247, 192, 124, 42, 17, 153, 141, 114, 34, 189, 20, 83, 69, 237, 173, + ]), + ]); + assert_matches_reserve_asset_deposited_instructions( + &mut xcm.clone(), + &expected_assets, + &expected_beneficiary, + ); + + let mut hash = xcm.using_encoded(sp_io::hashing::blake2_256); + + // execute xcm as XcmpQueue would do + let outcome = XcmExecutor::::prepare_and_execute( + local_bridge_hub_location, + xcm, + &mut hash, + RuntimeHelper::::xcm_max_weight( + XcmReceivedFrom::Sibling, + ), + Weight::zero(), + ); + assert_ok!(outcome.ensure_complete()); + + // Balances after + assert_eq!( + >::free_balance(&target_account), + existential_deposit.clone() + ); + + // ForeignAssets balances after + assert!( + >::balance( + foreign_asset_id_location.into(), + &target_account + ) > 0.into() + ); + + // additional check after + additional_checks_after(); + }) + } +} diff --git a/system-parachains/asset-hub-paseo/tests/weight_trader.rs b/system-parachains/asset-hub-paseo/tests/weight_trader.rs index 03cb29b..0e9780d 100644 --- a/system-parachains/asset-hub-paseo/tests/weight_trader.rs +++ b/system-parachains/asset-hub-paseo/tests/weight_trader.rs @@ -17,8 +17,8 @@ use asset_hub_paseo_runtime::{ xcm_config::{ - AssetFeeAsExistentialDepositMultiplierFeeCharger, DotLocation, DotLocationV3, StakingPot, - TrustBackedAssetsPalletLocation, TrustBackedAssetsPalletLocationV3, XcmConfig, + AssetFeeAsExistentialDepositMultiplierFeeCharger, DotLocation, StakingPot, + TrustBackedAssetsPalletLocation, XcmConfig, }, AllPalletsWithoutSystem, AssetConversion, Assets, Balances, ExistentialDeposit, ForeignAssets, Runtime, SessionKeys, @@ -470,10 +470,10 @@ fn test_buy_and_refund_weight_with_swap_local_asset_xcm_trader() { let bob: AccountId = SOME_ASSET_ADMIN.into(); let staking_pot = StakingPot::get(); let asset_1: u32 = 1; - let native_location = DotLocationV3::get(); + let native_location = DotLocation::get(); let asset_1_location = AssetIdForTrustBackedAssetsConvert::< - TrustBackedAssetsPalletLocationV3, - xcm::v3::Location, + TrustBackedAssetsPalletLocation, + xcm::v4::Location, >::convert_back(&asset_1) .unwrap(); // bob's initial balance for native and `asset1` assets. @@ -490,14 +490,14 @@ fn test_buy_and_refund_weight_with_swap_local_asset_xcm_trader() { assert_ok!(AssetConversion::create_pool( RuntimeHelper::origin_of(bob.clone()), - Box::new(native_location), - Box::new(asset_1_location) + Box::new(native_location.clone()), + Box::new(asset_1_location.clone()) )); assert_ok!(AssetConversion::add_liquidity( RuntimeHelper::origin_of(bob.clone()), - Box::new(native_location), - Box::new(asset_1_location), + Box::new(native_location.clone()), + Box::new(asset_1_location.clone()), pool_liquidity, pool_liquidity, 1, @@ -509,8 +509,6 @@ fn test_buy_and_refund_weight_with_swap_local_asset_xcm_trader() { let asset_total_issuance = Assets::total_issuance(asset_1); let native_total_issuance = Balances::total_issuance(); - let asset_1_location_latest: Location = asset_1_location.try_into().unwrap(); - // prepare input to buy weight. let weight = Weight::from_parts(4_000_000_000, 0); let fee = WeightToFee::weight_to_fee(&weight); @@ -518,7 +516,7 @@ fn test_buy_and_refund_weight_with_swap_local_asset_xcm_trader() { AssetConversion::get_amount_in(&fee, &pool_liquidity, &pool_liquidity).unwrap(); let extra_amount = 100; let ctx = XcmContext { origin: None, message_id: XcmHash::default(), topic: None }; - let payment: Asset = (asset_1_location_latest.clone(), asset_fee + extra_amount).into(); + let payment: Asset = (asset_1_location.clone(), asset_fee + extra_amount).into(); // init trader and buy weight. let mut trader = ::Trader::new(); @@ -526,10 +524,8 @@ fn test_buy_and_refund_weight_with_swap_local_asset_xcm_trader() { trader.buy_weight(weight, payment.into(), &ctx).expect("Expected Ok"); // assert. - let unused_amount = unused_asset - .fungible - .get(&asset_1_location_latest.clone().into()) - .map_or(0, |a| *a); + let unused_amount = + unused_asset.fungible.get(&asset_1_location.clone().into()).map_or(0, |a| *a); assert_eq!(unused_amount, extra_amount); assert_eq!(Assets::total_issuance(asset_1), asset_total_issuance + asset_fee); @@ -537,13 +533,13 @@ fn test_buy_and_refund_weight_with_swap_local_asset_xcm_trader() { let refund_weight = Weight::from_parts(1_000_000_000, 0); let refund = WeightToFee::weight_to_fee(&refund_weight); let (reserve1, reserve2) = - AssetConversion::get_reserves(native_location, asset_1_location).unwrap(); + AssetConversion::get_reserves(native_location, asset_1_location.clone()).unwrap(); let asset_refund = AssetConversion::get_amount_out(&refund, &reserve1, &reserve2).unwrap(); // refund. let actual_refund = trader.refund_weight(refund_weight, &ctx).unwrap(); - assert_eq!(actual_refund, (asset_1_location_latest, asset_refund).into()); + assert_eq!(actual_refund, (asset_1_location, asset_refund).into()); // assert. assert_eq!(Balances::balance(&staking_pot), initial_balance); @@ -572,12 +568,12 @@ fn test_buy_and_refund_weight_with_swap_foreign_asset_xcm_trader() { .execute_with(|| { let bob: AccountId = SOME_ASSET_ADMIN.into(); let staking_pot = StakingPot::get(); - let native_location = DotLocationV3::get(); - let foreign_location = xcm::v3::Location { + let native_location = DotLocation::get(); + let foreign_location = xcm::v4::Location { parents: 1, interior: ( - xcm::v3::Junction::Parachain(1234), - xcm::v3::Junction::GeneralIndex(12345), + xcm::v4::Junction::Parachain(1234), + xcm::v4::Junction::GeneralIndex(12345), ) .into(), }; @@ -588,26 +584,26 @@ fn test_buy_and_refund_weight_with_swap_foreign_asset_xcm_trader() { // init asset, balances and pool. assert_ok!(>::create( - foreign_location, + foreign_location.clone(), bob.clone(), true, 10 )); - assert_ok!(ForeignAssets::mint_into(foreign_location, &bob, initial_balance)); + assert_ok!(ForeignAssets::mint_into(foreign_location.clone(), &bob, initial_balance)); assert_ok!(Balances::mint_into(&bob, initial_balance)); assert_ok!(Balances::mint_into(&staking_pot, initial_balance)); assert_ok!(AssetConversion::create_pool( RuntimeHelper::origin_of(bob.clone()), - Box::new(native_location), - Box::new(foreign_location) + Box::new(native_location.clone()), + Box::new(foreign_location.clone()) )); assert_ok!(AssetConversion::add_liquidity( RuntimeHelper::origin_of(bob.clone()), - Box::new(native_location), - Box::new(foreign_location), + Box::new(native_location.clone()), + Box::new(foreign_location.clone()), pool_liquidity, pool_liquidity, 1, @@ -616,11 +612,9 @@ fn test_buy_and_refund_weight_with_swap_foreign_asset_xcm_trader() { )); // keep initial total issuance to assert later. - let asset_total_issuance = ForeignAssets::total_issuance(foreign_location); + let asset_total_issuance = ForeignAssets::total_issuance(foreign_location.clone()); let native_total_issuance = Balances::total_issuance(); - let foreign_location_latest: Location = foreign_location.try_into().unwrap(); - // prepare input to buy weight. let weight = Weight::from_parts(4_000_000_000, 0); let fee = WeightToFee::weight_to_fee(&weight); @@ -628,7 +622,7 @@ fn test_buy_and_refund_weight_with_swap_foreign_asset_xcm_trader() { AssetConversion::get_amount_in(&fee, &pool_liquidity, &pool_liquidity).unwrap(); let extra_amount = 100; let ctx = XcmContext { origin: None, message_id: XcmHash::default(), topic: None }; - let payment: Asset = (foreign_location_latest.clone(), asset_fee + extra_amount).into(); + let payment: Asset = (foreign_location.clone(), asset_fee + extra_amount).into(); // init trader and buy weight. let mut trader = ::Trader::new(); @@ -636,13 +630,11 @@ fn test_buy_and_refund_weight_with_swap_foreign_asset_xcm_trader() { trader.buy_weight(weight, payment.into(), &ctx).expect("Expected Ok"); // assert. - let unused_amount = unused_asset - .fungible - .get(&foreign_location_latest.clone().into()) - .map_or(0, |a| *a); + let unused_amount = + unused_asset.fungible.get(&foreign_location.clone().into()).map_or(0, |a| *a); assert_eq!(unused_amount, extra_amount); assert_eq!( - ForeignAssets::total_issuance(foreign_location), + ForeignAssets::total_issuance(foreign_location.clone()), asset_total_issuance + asset_fee ); @@ -650,13 +642,13 @@ fn test_buy_and_refund_weight_with_swap_foreign_asset_xcm_trader() { let refund_weight = Weight::from_parts(1_000_000_000, 0); let refund = WeightToFee::weight_to_fee(&refund_weight); let (reserve1, reserve2) = - AssetConversion::get_reserves(native_location, foreign_location).unwrap(); + AssetConversion::get_reserves(native_location, foreign_location.clone()).unwrap(); let asset_refund = AssetConversion::get_amount_out(&refund, &reserve1, &reserve2).unwrap(); // refund. let actual_refund = trader.refund_weight(refund_weight, &ctx).unwrap(); - assert_eq!(actual_refund, (foreign_location_latest, asset_refund).into()); + assert_eq!(actual_refund, (foreign_location.clone(), asset_refund).into()); // assert. assert_eq!(Balances::balance(&staking_pot), initial_balance); From c5f3312c3f9b1ba9ed4039b948cb0680cc298366 Mon Sep 17 00:00:00 2001 From: Ezequiel Raynaudo Date: Thu, 14 Nov 2024 12:29:33 -0300 Subject: [PATCH 11/18] Minor change in bridge-hub --- .../bridge-hub-paseo/src/xcm_config.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/system-parachains/bridge-hub-paseo/src/xcm_config.rs b/system-parachains/bridge-hub-paseo/src/xcm_config.rs index e4eaa88..c5af4a8 100644 --- a/system-parachains/bridge-hub-paseo/src/xcm_config.rs +++ b/system-parachains/bridge-hub-paseo/src/xcm_config.rs @@ -73,9 +73,10 @@ parameter_types! { pub StakingPot: AccountId = CollatorSelection::account_id(); } -/// Type for specifying how a `Location` can be converted into an `AccountId`. This is used -/// when determining ownership of accounts for asset transacting and when attempting to use XCM -/// `Transact` in order to determine the dispatch Origin. +/// Type for specifying how a `Location` can be converted into an `AccountId`. +/// +/// This is used when determining ownership of accounts for asset transacting and when attempting to +/// use XCM `Transact` in order to determine the dispatch Origin. pub type LocationToAccountId = ( // The parent (Relay-chain) origin converts to the parent `AccountId`. ParentIsPreset, @@ -102,8 +103,9 @@ pub type FungibleTransactor = FungibleAdapter< >; /// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, -/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can -/// biases the kind of local `Origin` it will become. +/// ready for dispatching a transaction with Xcm's `Transact`. +/// +/// There is an `OriginKind` which can biases the kind of local `Origin` it will become. pub type XcmOriginToTransactDispatchOrigin = ( // Sovereign account converter; this attempts to derive an `AccountId` from the origin location // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for @@ -301,6 +303,7 @@ impl cumulus_pallet_xcm::Config for Runtime { } /// A `FeeManager` implementation that forces fees for any message delivered to Ethereum. +/// /// Otherwise, it permits the specified `WaivedLocations` to not pay for fees and uses the provided /// `HandleFee` implementation. pub struct XcmFeeManagerFromComponentsBridgeHub( From 2d8188900f021f7a9966848ce8dae3ff4ac8230c Mon Sep 17 00:00:00 2001 From: Ezequiel Raynaudo Date: Thu, 14 Nov 2024 14:38:02 -0300 Subject: [PATCH 12/18] Add string replace --- scripts/replacements_config.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/replacements_config.json b/scripts/replacements_config.json index 83b8533..2b0a177 100644 --- a/scripts/replacements_config.json +++ b/scripts/replacements_config.json @@ -16,7 +16,8 @@ "pub const EPOCH_DURATION_IN_SLOTS: BlockNumber = prod_or_fast!(4 * HOURS, 1 * MINUTES);":"pub const EPOCH_DURATION_IN_SLOTS: BlockNumber = prod_or_fast!(1 * HOURS, 1 * MINUTES);", "Polkadot": "Paseo", "polkadot": "paseo", - "DOT": "PAS" + "DOT": "PAS", + "PaseoXcm" : "PolkadotXcm" }, "remove_block_pattern": "\\s*// Polkadot Genesis was on May 26, 2020\\..*?DOT_LEASE_OFFSET\\\"\\);", "revert_if_deleted": [ From bc3a257497e501d491f0c14f924571badeb25e01 Mon Sep 17 00:00:00 2001 From: Ezequiel Raynaudo Date: Thu, 14 Nov 2024 15:09:15 -0300 Subject: [PATCH 13/18] Update integration tests [breaking] --- .../assets/asset-hub-paseo/src/genesis.rs | 4 +- .../assets/asset-hub-paseo/src/lib.rs | 2 +- .../coretime/coretime-paseo/src/lib.rs | 2 +- .../parachains/testing/penpal/src/genesis.rs | 1 + .../parachains/testing/penpal/src/lib.rs | 29 +++- integration-tests/emulated/helpers/src/lib.rs | 1 - .../tests/bridges/bridge-hub-paseo/src/lib.rs | 6 +- .../src/tests/claim_assets.rs | 2 - .../bridges/bridge-hub-paseo/src/tests/mod.rs | 5 +- .../src/tests/register_bridged_assets.rs | 128 ++++++++++++++++++ .../bridge-hub-paseo/src/tests/send_xcm.rs | 6 +- .../bridge-hub-paseo/src/tests/snowbridge.rs | 10 +- .../coretime-paseo/src/tests/teleport.rs | 1 - 13 files changed, 172 insertions(+), 25 deletions(-) create mode 100644 integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/register_bridged_assets.rs diff --git a/integration-tests/emulated/chains/parachains/assets/asset-hub-paseo/src/genesis.rs b/integration-tests/emulated/chains/parachains/assets/asset-hub-paseo/src/genesis.rs index fec1761..73f9b1b 100644 --- a/integration-tests/emulated/chains/parachains/assets/asset-hub-paseo/src/genesis.rs +++ b/integration-tests/emulated/chains/parachains/assets/asset-hub-paseo/src/genesis.rs @@ -114,13 +114,13 @@ pub fn genesis() -> Storage { assets: vec![ // Penpal's teleportable asset representation ( - PenpalATeleportableAssetLocation::get().try_into().unwrap(), + PenpalATeleportableAssetLocation::get(), PenpalASiblingSovereignAccount::get(), false, ED, ), ( - PenpalBTeleportableAssetLocation::get().try_into().unwrap(), + PenpalBTeleportableAssetLocation::get(), PenpalBSiblingSovereignAccount::get(), false, ED, diff --git a/integration-tests/emulated/chains/parachains/assets/asset-hub-paseo/src/lib.rs b/integration-tests/emulated/chains/parachains/assets/asset-hub-paseo/src/lib.rs index 7ef4b16..e248697 100644 --- a/integration-tests/emulated/chains/parachains/assets/asset-hub-paseo/src/lib.rs +++ b/integration-tests/emulated/chains/parachains/assets/asset-hub-paseo/src/lib.rs @@ -57,5 +57,5 @@ impl_accounts_helpers_for_parachain!(AssetHubPaseo); impl_assert_events_helpers_for_parachain!(AssetHubPaseo); impl_assets_helpers_for_system_parachain!(AssetHubPaseo, Paseo); impl_assets_helpers_for_parachain!(AssetHubPaseo); -impl_foreign_assets_helpers_for_parachain!(AssetHubPaseo, xcm::v3::Location); +impl_foreign_assets_helpers_for_parachain!(AssetHubPaseo, xcm::v4::Location); impl_xcm_helpers_for_parachain!(AssetHubPaseo); diff --git a/integration-tests/emulated/chains/parachains/coretime/coretime-paseo/src/lib.rs b/integration-tests/emulated/chains/parachains/coretime/coretime-paseo/src/lib.rs index 42a68eb..5608fe6 100644 --- a/integration-tests/emulated/chains/parachains/coretime/coretime-paseo/src/lib.rs +++ b/integration-tests/emulated/chains/parachains/coretime/coretime-paseo/src/lib.rs @@ -25,7 +25,7 @@ use emulated_integration_tests_common::{ impls::Parachain, xcm_emulator::decl_test_parachains, }; -// CoretimePolkadot Parachain declaration +// CoretimePaseo Parachain declaration decl_test_parachains! { pub struct CoretimePaseo { genesis = genesis::genesis(), diff --git a/integration-tests/emulated/chains/parachains/testing/penpal/src/genesis.rs b/integration-tests/emulated/chains/parachains/testing/penpal/src/genesis.rs index 5433ff1..fae816b 100644 --- a/integration-tests/emulated/chains/parachains/testing/penpal/src/genesis.rs +++ b/integration-tests/emulated/chains/parachains/testing/penpal/src/genesis.rs @@ -22,6 +22,7 @@ use emulated_integration_tests_common::{ accounts, build_genesis_storage, collators, get_account_id_from_seed, SAFE_XCM_VERSION, }; use parachains_common::{AccountId, Balance}; +use penpal_runtime::xcm_config::{LocalReservableFromAssetHub, RelayLocation}; // Penpal pub const PARA_ID_A: u32 = 2000; diff --git a/integration-tests/emulated/chains/parachains/testing/penpal/src/lib.rs b/integration-tests/emulated/chains/parachains/testing/penpal/src/lib.rs index 09fe2aa..c0d1f71 100644 --- a/integration-tests/emulated/chains/parachains/testing/penpal/src/lib.rs +++ b/integration-tests/emulated/chains/parachains/testing/penpal/src/lib.rs @@ -15,18 +15,25 @@ mod genesis; pub use genesis::{genesis, PenpalAssetOwner, ED, PARA_ID_A, PARA_ID_B}; -pub use penpal_runtime::xcm_config::{ - CustomizableAssetFromSystemAssetHub, LocalReservableFromAssetHub, LocalTeleportableToAssetHub, - XcmConfig, ASSETS_PALLET_ID, RESERVABLE_ASSET_ID, TELEPORTABLE_ASSET_ID, +pub use penpal_runtime::{ + self, + xcm_config::{ + CustomizableAssetFromSystemAssetHub, LocalReservableFromAssetHub, + LocalTeleportableToAssetHub, RelayNetworkId as PenpalRelayNetworkId, XcmConfig, + ASSETS_PALLET_ID, RESERVABLE_ASSET_ID, TELEPORTABLE_ASSET_ID, + }, }; // Substrate use frame_support::traits::OnInitialize; +use sp_core::Encode; // Cumulus use emulated_integration_tests_common::{ impl_accounts_helpers_for_parachain, impl_assert_events_helpers_for_parachain, - impl_assets_helpers_for_parachain, impl_foreign_assets_helpers_for_parachain, impls::Parachain, + impl_assets_helpers_for_parachain, impl_foreign_assets_helpers_for_parachain, + impl_xcm_helpers_for_parachain, + impls::{NetworkId, Parachain}, xcm_emulator::decl_test_parachains, }; @@ -36,6 +43,10 @@ decl_test_parachains! { genesis = genesis(PARA_ID_A), on_init = { penpal_runtime::AuraExt::on_initialize(1); + frame_support::assert_ok!(penpal_runtime::System::set_storage( + penpal_runtime::RuntimeOrigin::root(), + vec![(PenpalRelayNetworkId::key().to_vec(), NetworkId::Kusama.encode())], + )); }, runtime = penpal_runtime, core = { @@ -55,6 +66,10 @@ decl_test_parachains! { genesis = genesis(PARA_ID_B), on_init = { penpal_runtime::AuraExt::on_initialize(1); + frame_support::assert_ok!(penpal_runtime::System::set_storage( + penpal_runtime::RuntimeOrigin::root(), + vec![(PenpalRelayNetworkId::key().to_vec(), NetworkId::Polkadot.encode())], + )); }, runtime = penpal_runtime, core = { @@ -75,9 +90,11 @@ decl_test_parachains! { // Penpal implementation impl_accounts_helpers_for_parachain!(PenpalA); impl_accounts_helpers_for_parachain!(PenpalB); +impl_assert_events_helpers_for_parachain!(PenpalA); +impl_assert_events_helpers_for_parachain!(PenpalB); impl_assets_helpers_for_parachain!(PenpalA); impl_assets_helpers_for_parachain!(PenpalB); impl_foreign_assets_helpers_for_parachain!(PenpalA, xcm::latest::Location); impl_foreign_assets_helpers_for_parachain!(PenpalB, xcm::latest::Location); -impl_assert_events_helpers_for_parachain!(PenpalA); -impl_assert_events_helpers_for_parachain!(PenpalB); +impl_xcm_helpers_for_parachain!(PenpalA); +impl_xcm_helpers_for_parachain!(PenpalB); diff --git a/integration-tests/emulated/helpers/src/lib.rs b/integration-tests/emulated/helpers/src/lib.rs index 379f7e0..704a7a7 100644 --- a/integration-tests/emulated/helpers/src/lib.rs +++ b/integration-tests/emulated/helpers/src/lib.rs @@ -30,7 +30,6 @@ pub use xcm_emulator::Chain; /// TODO: when bumping to polkadot-sdk v1.8.0, /// remove this crate altogether and get the macros from `emulated-integration-tests-common`. -/// remove this crate altogether and get the macros from `emulated-integration-tests-common`. /// TODO: backport this macros to paseo-sdk #[macro_export] diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/lib.rs b/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/lib.rs index 48fce56..cdfea30 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/lib.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/lib.rs @@ -21,11 +21,12 @@ pub use sp_runtime::DispatchError; pub use xcm::{ latest::ParentThen, prelude::{AccountId32 as AccountId32Junction, *}, - v3::{ + v4::{ self, Error, NetworkId::{Kusama as KusamaId, Polkadot as PaseoId}, }, }; +pub use xcm_executor::traits::TransferType; // Bridges pub use bp_messages::LaneId; @@ -40,7 +41,7 @@ pub use emulated_integration_tests_common::{ RelayChain as Relay, Test, TestArgs, TestContext, TestExt, }, xcm_helpers::{xcm_transact_paid_execution, xcm_transact_unpaid_execution}, - PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, XCM_V3, + ASSETS_PALLET_ID, PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, XCM_V4, }; pub use paseo_system_emulated_network::{ asset_hub_paseo_emulated_chain::{ @@ -67,7 +68,6 @@ pub use paseo_system_emulated_network::{ pub const ASSET_ID: u32 = 1; pub const ASSET_MIN_BALANCE: u128 = 1000; -pub const ASSETS_PALLET_ID: u8 = 50; #[cfg(test)] mod tests; diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/claim_assets.rs b/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/claim_assets.rs index 641bdc8..c1327b6 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/claim_assets.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/claim_assets.rs @@ -20,8 +20,6 @@ use crate::*; use bridge_hub_paseo_runtime::ExistentialDeposit; use integration_tests_helpers::test_chain_can_claim_assets; use xcm_executor::traits::DropAssets; -use xcm::v3::NetworkId::Polkadot as PaseoId; - #[test] fn assets_can_be_claimed() { diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/mod.rs b/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/mod.rs index 04eb320..f189035 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/mod.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/mod.rs @@ -15,7 +15,10 @@ use crate::*; - +mod asset_transfers; +mod claim_assets; +mod register_bridged_assets; +mod send_xcm; mod snowbridge; mod teleport; mod claim_assets; diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/register_bridged_assets.rs b/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/register_bridged_assets.rs new file mode 100644 index 0000000..928b486 --- /dev/null +++ b/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/register_bridged_assets.rs @@ -0,0 +1,128 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use crate::tests::{ + snowbridge::{CHAIN_ID, WETH}, + *, +}; + +const XCM_FEE: u128 = 40_000_000_000; + +/// Tests the registering of a Polkadot Asset as a bridged asset on Kusama Asset Hub. +#[test] +fn register_polkadot_asset_on_kah_from_pah() { + // Polkadot Asset Hub asset when bridged to Kusama Asset Hub. + let bridged_asset_at_kah = v4::Location::new( + 2, + [ + v4::Junction::GlobalConsensus(v4::NetworkId::Polkadot), + v4::Junction::Parachain(AssetHubPolkadot::para_id().into()), + v4::Junction::PalletInstance(ASSETS_PALLET_ID), + v4::Junction::GeneralIndex(ASSET_ID.into()), + ], + ); + // Register above asset on Kusama AH from Polkadot AH. + register_asset_on_kah_from_pah(bridged_asset_at_kah); +} + +/// Tests the registering of an Ethereum Asset as a bridged asset on Kusama Asset Hub. +#[test] +fn register_ethereum_asset_on_kah_from_pah() { + // Ethereum asset when bridged to Kusama Asset Hub. + let bridged_asset_at_kah = v4::Location::new( + 2, + [ + v4::Junction::GlobalConsensus(v4::NetworkId::Ethereum { chain_id: CHAIN_ID }), + v4::Junction::AccountKey20 { network: None, key: WETH }, + ], + ); + // Register above asset on Kusama AH from Polkadot AH. + register_asset_on_kah_from_pah(bridged_asset_at_kah); +} + +fn register_asset_on_kah_from_pah(bridged_asset_at_kah: v4::Location) { + let sa_of_pah_on_kah = AssetHubKusama::sovereign_account_of_parachain_on_other_global_consensus( + Polkadot, + AssetHubPolkadot::para_id(), + ); + + // Encoded `create_asset` call to be executed in Kusama Asset Hub ForeignAssets pallet. + let call = AssetHubKusama::create_foreign_asset_call( + bridged_asset_at_kah.clone(), + ASSET_MIN_BALANCE, + sa_of_pah_on_kah.clone(), + ); + + let origin_kind = OriginKind::Xcm; + let fee_amount = XCM_FEE; + let fees = (Parent, fee_amount).into(); + + let xcm = xcm_transact_paid_execution(call, origin_kind, fees, sa_of_pah_on_kah.clone()); + + // SA-of-PAH-on-KAH needs to have balance to pay for fees and asset creation deposit + AssetHubKusama::fund_accounts(vec![( + sa_of_pah_on_kah.clone(), + ASSET_HUB_KUSAMA_ED * 10000000000, + )]); + + let destination = asset_hub_kusama_location(); + + // fund the PAH's SA on PBH for paying bridge transport fees + BridgeHubPolkadot::fund_para_sovereign(AssetHubPolkadot::para_id(), 10_000_000_000_000u128); + + // set XCM versions + AssetHubPolkadot::force_xcm_version(destination.clone(), XCM_VERSION); + BridgeHubPolkadot::force_xcm_version(bridge_hub_kusama_location(), XCM_VERSION); + + let root_origin = ::RuntimeOrigin::root(); + AssetHubPolkadot::execute_with(|| { + assert_ok!(::PolkadotXcm::send( + root_origin, + bx!(destination.into()), + bx!(xcm), + )); + + AssetHubPolkadot::assert_xcm_pallet_sent(); + }); + + assert_bridge_hub_polkadot_message_accepted(true); + assert_bridge_hub_kusama_message_received(); + AssetHubKusama::execute_with(|| { + type RuntimeEvent = ::RuntimeEvent; + AssetHubKusama::assert_xcmp_queue_success(None); + assert_expected_events!( + AssetHubKusama, + vec![ + // Burned the fee + RuntimeEvent::Balances(pallet_balances::Event::Burned { who, amount }) => { + who: *who == sa_of_pah_on_kah.clone(), + amount: *amount == fee_amount, + }, + // Foreign Asset created + RuntimeEvent::ForeignAssets(pallet_assets::Event::Created { asset_id, creator, owner }) => { + asset_id: *asset_id == bridged_asset_at_kah, + creator: *creator == sa_of_pah_on_kah.clone(), + owner: *owner == sa_of_pah_on_kah, + }, + // Unspent fee minted to origin + RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => { + who: *who == sa_of_pah_on_kah.clone(), + }, + ] + ); + type ForeignAssets = ::ForeignAssets; + assert!(ForeignAssets::asset_exists(bridged_asset_at_kah)); + }); +} diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/send_xcm.rs b/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/send_xcm.rs index 568fede..337a9c0 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/send_xcm.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/send_xcm.rs @@ -13,8 +13,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +use bridge_hub_paseo_runtime::bridge_to_kusama_config::BridgeHubPolkadot; use crate::tests::*; - +/* #[test] fn send_xcm_from_polkadot_relay_to_kusama_asset_hub_should_fail_on_not_applicable() { // Init tests variables @@ -29,7 +30,7 @@ fn send_xcm_from_polkadot_relay_to_kusama_asset_hub_should_fail_on_not_applicabl let xcm = VersionedXcm::from(Xcm(vec![ UnpaidExecution { weight_limit, check_origin }, ExportMessage { - network: KusamaId.into(), + network: KusamaId, destination: [Parachain(AssetHubKusama::para_id().into())].into(), xcm: remote_xcm, }, @@ -135,3 +136,4 @@ fn send_xcm_through_opened_lane_with_different_xcm_version_on_hops_works() { ); }); } +*/ diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/snowbridge.rs b/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/snowbridge.rs index cad40f1..390b647 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/snowbridge.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/snowbridge.rs @@ -283,7 +283,7 @@ fn send_token_from_ethereum_to_penpal() { let weth_asset_location: Location = (Parent, Parent, EthereumNetwork::get(), AccountKey20 { network: None, key: WETH }).into(); // Converts the Weth asset location into an asset ID - let weth_asset_id: v3::Location = weth_asset_location.clone().try_into().unwrap(); + let weth_asset_id = weth_asset_location.clone(); // Fund ethereum sovereign on AssetHub AssetHubPaseo::fund_accounts(vec![(ethereum_sovereign_account(), INITIAL_FUND)]); @@ -312,7 +312,7 @@ fn send_token_from_ethereum_to_penpal() { AssetHubPaseo::execute_with(|| { assert_ok!(::ForeignAssets::force_create( ::RuntimeOrigin::root(), - weth_asset_id, + weth_asset_id.clone(), asset_hub_sovereign.clone().into(), true, 1000, @@ -733,7 +733,7 @@ fn asset_hub_foreign_assets_pallet_is_configured_correctly_in_bridge_hub() { ::Runtime, pallet_assets::Instance2, >::create { - id: v3::Location::default(), + id: v4::Location::default(), min_balance: ASSET_MIN_BALANCE, admin: assethub_sovereign.into(), }) @@ -852,14 +852,14 @@ fn send_token_from_ethereum_to_asset_hub_with_fee(account_id: [u8; 32], fee: u12 assert_ok!(::ForeignAssets::force_create( RuntimeOrigin::root(), - weth_asset_location.clone().try_into().unwrap(), + weth_asset_location.clone(), asset_hub_sovereign.into(), false, 1, )); assert!(::ForeignAssets::asset_exists( - weth_asset_location.clone().try_into().unwrap(), + weth_asset_location.clone(), )); }); diff --git a/integration-tests/emulated/tests/coretime/coretime-paseo/src/tests/teleport.rs b/integration-tests/emulated/tests/coretime/coretime-paseo/src/tests/teleport.rs index a6ee83c..464f0e3 100644 --- a/integration-tests/emulated/tests/coretime/coretime-paseo/src/tests/teleport.rs +++ b/integration-tests/emulated/tests/coretime/coretime-paseo/src/tests/teleport.rs @@ -15,7 +15,6 @@ // limitations under the License. use crate::*; -use coretime_paseo_runtime::xcm_config::XcmConfig; use frame_support::{ dispatch::RawOrigin, sp_runtime::traits::Dispatchable, traits::fungible::Mutate, }; From 41617f487d0b5c9db65ec07fe2b277bc398175b2 Mon Sep 17 00:00:00 2001 From: Ezequiel Raynaudo Date: Fri, 15 Nov 2024 07:56:23 -0300 Subject: [PATCH 14/18] Fix duplicated mod --- .../emulated/tests/bridges/bridge-hub-paseo/src/tests/mod.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/mod.rs b/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/mod.rs index f189035..0a9110f 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/mod.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/mod.rs @@ -21,7 +21,6 @@ mod register_bridged_assets; mod send_xcm; mod snowbridge; mod teleport; -mod claim_assets; From c204f4665db435dd7ee840abe7ec6b923314eefc Mon Sep 17 00:00:00 2001 From: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> Date: Mon, 18 Nov 2024 09:09:33 +0100 Subject: [PATCH 15/18] fix(paseo): adjust inflation values for multiplier_tests --- relay/paseo/src/lib.rs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/relay/paseo/src/lib.rs b/relay/paseo/src/lib.rs index 8355a04..89195c1 100644 --- a/relay/paseo/src/lib.rs +++ b/relay/paseo/src/lib.rs @@ -710,8 +710,8 @@ impl pallet_staking::EraPayout for EraPayout { let relative_era_len = FixedU128::from_rational(era_duration_millis.into(), MILLISECONDS_PER_YEAR.into()); - // TI at the time of execution of [Referendum 1139](https://paseo.subsquare.io/referenda/1139), block hash: `0x39422610299a75ef69860417f4d0e1d94e77699f45005645ffc5e8e619950f9f`. - let fixed_total_issuance: i128 = 15_011_657_390_566_252_333; + // TI at the time of execution of [Referendum 1139](https://polkadot.subsquare.io/referenda/1139), block hash: `0x39422610299a75ef69860417f4d0e1d94e77699f45005645ffc5e8e619950f9f`. + let fixed_total_issuance: i128 = 1_487_502_468_008_283_162; let fixed_inflation_rate = FixedU128::from_rational(8, 100); let yearly_emission = fixed_inflation_rate.saturating_mul_int(fixed_total_issuance); @@ -3236,12 +3236,12 @@ mod multiplier_tests { ); // Values are within 0.1% - assert_relative_eq!(to_stakers as f64, (279_477 * UNITS) as f64, max_relative = 0.001); - assert_relative_eq!(to_treasury as f64, (49_320 * UNITS) as f64, max_relative = 0.001); - // Total per day is ~328,797 PAS + assert_relative_eq!(to_stakers as f64, (27_693 * UNITS) as f64, max_relative = 0.001); + assert_relative_eq!(to_treasury as f64, (4_887 * UNITS) as f64, max_relative = 0.001); + // Total per day is ~32,580 PAS assert_relative_eq!( (to_stakers as f64 + to_treasury as f64), - (328_797 * UNITS) as f64, + (32_580 * UNITS) as f64, max_relative = 0.001 ); } @@ -3257,12 +3257,12 @@ mod multiplier_tests { assert_relative_eq!( to_stakers as f64, - (279_477 * UNITS) as f64 * 2.0, + (27_693 * UNITS) as f64 * 2.0, max_relative = 0.001 ); assert_relative_eq!( to_treasury as f64, - (49_320 * UNITS) as f64 * 2.0, + (4_887 * UNITS) as f64 * 2.0, max_relative = 0.001 ); } @@ -3275,8 +3275,8 @@ mod multiplier_tests { (36525 * MILLISECONDS_PER_DAY) / 100, // 1 year ); - // Our yearly emissions is about 120M PAS: - let yearly_emission = 120_093_259 * UNITS; + // Our yearly emissions is about 12M PAS: + let yearly_emission = 11_909_325 * UNITS; assert_relative_eq!( to_stakers as f64 + to_treasury as f64, yearly_emission as f64, @@ -3299,13 +3299,13 @@ mod multiplier_tests { 456, // ignored (36525 * MILLISECONDS_PER_DAY) / 10, // 10 years ); - let initial_ti: i128 = 15_011_657_390_566_252_333; + let initial_ti: i128 = 1_487_502_468_008_283_162; let projected_total_issuance = (to_stakers as i128 + to_treasury as i128) + initial_ti; - // In 2034, there will be about 2.7 billion PAS in existence. + // In 2034, there will be about 267 million PAS in existence. assert_relative_eq!( projected_total_issuance as f64, - (2_700_000_000 * UNITS) as f64, + (267_750_000 * UNITS) as f64, max_relative = 0.001 ); } @@ -3319,7 +3319,7 @@ mod multiplier_tests { (36525 * MILLISECONDS_PER_DAY) / 100, // 1 year ); let yearly_emission = to_stakers + to_treasury; - let mut ti: i128 = 15_011_657_390_566_252_333; + let mut ti: i128 = 1_487_502_468_008_283_162; for y in 0..10 { let new_ti = ti + yearly_emission as i128; From 517f8242b23e54925926fcdc16ab5b45d01d7e17 Mon Sep 17 00:00:00 2001 From: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> Date: Tue, 26 Nov 2024 22:18:45 +0100 Subject: [PATCH 16/18] fix(integration-tests): remove kusama bh tests --- .../src/tests/asset_transfers.rs | 420 ------------------ .../bridges/bridge-hub-paseo/src/tests/mod.rs | 94 ---- .../src/tests/register_bridged_assets.rs | 128 ------ .../bridge-hub-paseo/src/tests/send_xcm.rs | 139 ------ 4 files changed, 781 deletions(-) delete mode 100644 integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/asset_transfers.rs delete mode 100644 integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/register_bridged_assets.rs delete mode 100644 integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/send_xcm.rs diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/asset_transfers.rs b/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/asset_transfers.rs deleted file mode 100644 index 31bcaa3..0000000 --- a/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/asset_transfers.rs +++ /dev/null @@ -1,420 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use crate::tests::*; -use frame_support::traits::fungible::Mutate; - -fn send_asset_from_asset_hub_polkadot_to_asset_hub_kusama(id: Location, amount: u128) { - let destination = asset_hub_kusama_location(); - - // fund the AHP's SA on BHP for paying bridge transport fees - BridgeHubPolkadot::fund_para_sovereign(AssetHubPolkadot::para_id(), 10_000_000_000_000u128); - - // set XCM versions - AssetHubPolkadot::force_xcm_version(destination.clone(), XCM_VERSION); - BridgeHubPolkadot::force_xcm_version(bridge_hub_kusama_location(), XCM_VERSION); - - // send message over bridge - assert_ok!(send_asset_from_asset_hub_polkadot(destination, (id, amount))); - assert_bridge_hub_polkadot_message_accepted(true); - assert_bridge_hub_kusama_message_received(); -} - -#[test] -fn send_dots_from_asset_hub_polkadot_to_asset_hub_kusama() { - let dot_at_asset_hub_polkadot: v3::Location = v3::Parent.into(); - let dot_at_asset_hub_kusama = - v3::Location::new(2, [v3::Junction::GlobalConsensus(v3::NetworkId::Polkadot)]); - let owner: AccountId = AssetHubKusama::account_id_of(ALICE); - AssetHubKusama::force_create_foreign_asset( - dot_at_asset_hub_kusama, - owner, - true, - ASSET_MIN_BALANCE, - vec![], - ); - let sov_ahk_on_ahp = AssetHubPolkadot::sovereign_account_of_parachain_on_other_global_consensus( - NetworkId::Kusama, - AssetHubKusama::para_id(), - ); - - let dots_in_reserve_on_ahp_before = - ::account_data_of(sov_ahk_on_ahp.clone()).free; - let sender_dots_before = - ::account_data_of(AssetHubPolkadotSender::get()).free; - let receiver_dots_before = AssetHubKusama::execute_with(|| { - type Assets = ::ForeignAssets; - >::balance(dot_at_asset_hub_kusama, &AssetHubKusamaReceiver::get()) - }); - - let dot_at_asset_hub_polkadot_latest: Location = dot_at_asset_hub_polkadot.try_into().unwrap(); - let amount = ASSET_HUB_POLKADOT_ED * 1_000; - send_asset_from_asset_hub_polkadot_to_asset_hub_kusama( - dot_at_asset_hub_polkadot_latest, - amount, - ); - AssetHubKusama::execute_with(|| { - type RuntimeEvent = ::RuntimeEvent; - assert_expected_events!( - AssetHubKusama, - vec![ - // issue DOTs on AHK - RuntimeEvent::ForeignAssets(pallet_assets::Event::Issued { asset_id, owner, .. }) => { - asset_id: *asset_id == dot_at_asset_hub_kusama, - owner: *owner == AssetHubKusamaReceiver::get(), - }, - // message processed successfully - RuntimeEvent::MessageQueue( - pallet_message_queue::Event::Processed { success: true, .. } - ) => {}, - ] - ); - }); - - let sender_dots_after = - ::account_data_of(AssetHubPolkadotSender::get()).free; - let receiver_dots_after = AssetHubKusama::execute_with(|| { - type Assets = ::ForeignAssets; - >::balance(dot_at_asset_hub_kusama, &AssetHubKusamaReceiver::get()) - }); - let dots_in_reserve_on_ahp_after = - ::account_data_of(sov_ahk_on_ahp).free; - - // Sender's balance is reduced - assert!(sender_dots_before > sender_dots_after); - // Receiver's balance is increased - assert!(receiver_dots_after > receiver_dots_before); - // Reserve balance is increased by sent amount - assert_eq!(dots_in_reserve_on_ahp_after, dots_in_reserve_on_ahp_before + amount); -} - -#[test] -fn send_ksms_from_asset_hub_polkadot_to_asset_hub_kusama() { - let prefund_amount = 10_000_000_000_000u128; - let ksm_at_asset_hub_polkadot = - v3::Location::new(2, [v3::Junction::GlobalConsensus(v3::NetworkId::Kusama)]); - let owner: AccountId = AssetHubPolkadot::account_id_of(ALICE); - AssetHubPolkadot::force_create_foreign_asset( - ksm_at_asset_hub_polkadot, - owner, - true, - ASSET_MIN_BALANCE, - vec![(AssetHubPolkadotSender::get(), prefund_amount)], - ); - - // fund the AHP's SA on AHK with the KSM tokens held in reserve - let sov_ahp_on_ahk = AssetHubKusama::sovereign_account_of_parachain_on_other_global_consensus( - NetworkId::Polkadot, - AssetHubPolkadot::para_id(), - ); - AssetHubKusama::fund_accounts(vec![(sov_ahp_on_ahk.clone(), prefund_amount)]); - - let ksms_in_reserve_on_ahk_before = - ::account_data_of(sov_ahp_on_ahk.clone()).free; - assert_eq!(ksms_in_reserve_on_ahk_before, prefund_amount); - let sender_ksms_before = AssetHubPolkadot::execute_with(|| { - type Assets = ::ForeignAssets; - >::balance(ksm_at_asset_hub_polkadot, &AssetHubPolkadotSender::get()) - }); - assert_eq!(sender_ksms_before, prefund_amount); - let receiver_ksms_before = - ::account_data_of(AssetHubKusamaReceiver::get()).free; - - let ksm_at_asset_hub_polkadot_latest: Location = ksm_at_asset_hub_polkadot.try_into().unwrap(); - let amount_to_send = ASSET_HUB_KUSAMA_ED * 1_000; - send_asset_from_asset_hub_polkadot_to_asset_hub_kusama( - ksm_at_asset_hub_polkadot_latest, - amount_to_send, - ); - AssetHubKusama::execute_with(|| { - type RuntimeEvent = ::RuntimeEvent; - assert_expected_events!( - AssetHubKusama, - vec![ - // KSM is withdrawn from AHP's SA on AHK - RuntimeEvent::Balances( - pallet_balances::Event::Burned { who, amount } - ) => { - who: *who == sov_ahp_on_ahk, - amount: *amount == amount_to_send, - }, - // KSMs deposited to beneficiary - RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => { - who: *who == AssetHubKusamaReceiver::get(), - }, - // message processed successfully - RuntimeEvent::MessageQueue( - pallet_message_queue::Event::Processed { success: true, .. } - ) => {}, - ] - ); - }); - - let sender_ksms_after = AssetHubPolkadot::execute_with(|| { - type Assets = ::ForeignAssets; - >::balance(ksm_at_asset_hub_polkadot, &AssetHubPolkadotSender::get()) - }); - let receiver_ksms_after = - ::account_data_of(AssetHubKusamaReceiver::get()).free; - let ksms_in_reserve_on_ahk_after = - ::account_data_of(sov_ahp_on_ahk.clone()).free; - - // Sender's balance is reduced - assert!(sender_ksms_before > sender_ksms_after); - // Receiver's balance is increased - assert!(receiver_ksms_after > receiver_ksms_before); - // Reserve balance is reduced by sent amount - assert_eq!(ksms_in_reserve_on_ahk_after, ksms_in_reserve_on_ahk_before - amount_to_send); -} - -#[test] -fn send_dots_from_asset_hub_polkadot_to_asset_hub_kusama_fee_from_pool() { - let dot_at_asset_hub_polkadot: v3::Location = v3::Parent.into(); - let dot_at_asset_hub_kusama = - v3::Location::new(2, [v3::Junction::GlobalConsensus(v3::NetworkId::Polkadot)]); - let owner: AccountId = AssetHubKusama::account_id_of(BOB); - AssetHubKusama::force_create_foreign_asset( - dot_at_asset_hub_kusama, - owner.clone(), - false, - ASSET_MIN_BALANCE, - vec![], - ); - let sov_ahk_on_ahp = AssetHubPolkadot::sovereign_account_of_parachain_on_other_global_consensus( - NetworkId::Kusama, - AssetHubKusama::para_id(), - ); - - AssetHubKusama::execute_with(|| { - type RuntimeEvent = ::RuntimeEvent; - - // setup a pool to pay xcm fees with `dot_at_asset_hub_kusama` tokens - assert_ok!(::ForeignAssets::mint( - ::RuntimeOrigin::signed(owner.clone()), - dot_at_asset_hub_kusama, - owner.clone().into(), - 3_000_000_000_000, - )); - - ::Balances::set_balance(&owner, 3_000_000_000_000); - - assert_ok!(::AssetConversion::create_pool( - ::RuntimeOrigin::signed(owner.clone()), - Box::new(dot_at_asset_hub_polkadot), - Box::new(dot_at_asset_hub_kusama), - )); - - assert_expected_events!( - AssetHubKusama, - vec![ - RuntimeEvent::AssetConversion(pallet_asset_conversion::Event::PoolCreated { .. }) => {}, - ] - ); - - assert_ok!(::AssetConversion::add_liquidity( - ::RuntimeOrigin::signed(owner.clone()), - Box::new(dot_at_asset_hub_polkadot), - Box::new(dot_at_asset_hub_kusama), - 1_000_000_000_000, - 2_000_000_000_000, - 1, - 1, - owner - )); - - assert_expected_events!( - AssetHubKusama, - vec![ - RuntimeEvent::AssetConversion(pallet_asset_conversion::Event::LiquidityAdded {..}) => {}, - ] - ); - }); - - let dots_in_reserve_on_ahp_before = - ::account_data_of(sov_ahk_on_ahp.clone()).free; - let sender_dots_before = - ::account_data_of(AssetHubPolkadotSender::get()).free; - let receiver_dots_before = AssetHubKusama::execute_with(|| { - type Assets = ::ForeignAssets; - >::balance(dot_at_asset_hub_kusama, &AssetHubKusamaReceiver::get()) - }); - - let dot_at_asset_hub_polkadot_latest: Location = dot_at_asset_hub_polkadot.try_into().unwrap(); - let amount = ASSET_HUB_POLKADOT_ED * 1_000; - send_asset_from_asset_hub_polkadot_to_asset_hub_kusama( - dot_at_asset_hub_polkadot_latest, - amount, - ); - AssetHubKusama::execute_with(|| { - type RuntimeEvent = ::RuntimeEvent; - assert_expected_events!( - AssetHubKusama, - vec![ - // issue DOTs on AHK - RuntimeEvent::ForeignAssets(pallet_assets::Event::Issued { asset_id, owner, .. }) => { - asset_id: *asset_id == dot_at_asset_hub_kusama, - owner: *owner == AssetHubKusamaReceiver::get(), - }, - // message processed successfully - RuntimeEvent::MessageQueue( - pallet_message_queue::Event::Processed { success: true, .. } - ) => {}, - ] - ); - }); - - let sender_dots_after = - ::account_data_of(AssetHubPolkadotSender::get()).free; - let receiver_dots_after = AssetHubKusama::execute_with(|| { - type Assets = ::ForeignAssets; - >::balance(dot_at_asset_hub_kusama, &AssetHubKusamaReceiver::get()) - }); - let dots_in_reserve_on_ahp_after = - ::account_data_of(sov_ahk_on_ahp).free; - - // Sender's balance is reduced - assert!(sender_dots_before >= sender_dots_after + amount); - // Receiver's balance is increased - assert!(receiver_dots_after > receiver_dots_before); - // Reserve balance is increased by sent amount - assert_eq!(dots_in_reserve_on_ahp_after, dots_in_reserve_on_ahp_before + amount); -} - -#[test] -fn send_ksms_from_asset_hub_polkadot_to_asset_hub_kusama_fee_from_pool() { - let prefund_amount = 10_000_000_000_000u128; - let ksm_at_asset_hub_polkadot = - v3::Location::new(2, [v3::Junction::GlobalConsensus(v3::NetworkId::Kusama)]); - let owner: AccountId = AssetHubPolkadot::account_id_of(BOB); - AssetHubPolkadot::force_create_foreign_asset( - ksm_at_asset_hub_polkadot, - owner.clone(), - false, - ASSET_MIN_BALANCE, - vec![(AssetHubPolkadotSender::get(), prefund_amount)], - ); - - AssetHubPolkadot::execute_with(|| { - type RuntimeEvent = ::RuntimeEvent; - - // setup a pool to pay xcm fees with `ksm_at_asset_hub_polkadot` tokens - assert_ok!(::ForeignAssets::mint( - ::RuntimeOrigin::signed(owner.clone()), - ksm_at_asset_hub_polkadot, - owner.clone().into(), - 3_000_000_000_000, - )); - - ::Balances::set_balance( - &owner, - 3_000_000_000_000, - ); - - assert_ok!(::AssetConversion::create_pool( - ::RuntimeOrigin::signed(owner.clone()), - Box::new(xcm::v3::Parent.into()), - Box::new(ksm_at_asset_hub_polkadot), - )); - - assert_expected_events!( - AssetHubPolkadot, - vec![ - RuntimeEvent::AssetConversion(pallet_asset_conversion::Event::PoolCreated { .. }) => {}, - ] - ); - - assert_ok!(::AssetConversion::add_liquidity( - ::RuntimeOrigin::signed(owner.clone()), - Box::new(xcm::v3::Parent.into()), - Box::new(ksm_at_asset_hub_polkadot), - 1_000_000_000_000, - 2_000_000_000_000, - 1, - 1, - owner.clone() - )); - - assert_expected_events!( - AssetHubPolkadot, - vec![ - RuntimeEvent::AssetConversion(pallet_asset_conversion::Event::LiquidityAdded {..}) => {}, - ] - ); - }); - - // fund the AHP's SA on AHK with the KSM tokens held in reserve - let sov_ahp_on_ahk = AssetHubKusama::sovereign_account_of_parachain_on_other_global_consensus( - NetworkId::Polkadot, - AssetHubPolkadot::para_id(), - ); - AssetHubKusama::fund_accounts(vec![(sov_ahp_on_ahk.clone(), prefund_amount)]); - - let ksms_in_reserve_on_ahk_before = - ::account_data_of(sov_ahp_on_ahk.clone()).free; - assert_eq!(ksms_in_reserve_on_ahk_before, prefund_amount); - let sender_ksms_before = AssetHubPolkadot::execute_with(|| { - type Assets = ::ForeignAssets; - >::balance(ksm_at_asset_hub_polkadot, &AssetHubPolkadotSender::get()) - }); - assert_eq!(sender_ksms_before, prefund_amount); - let receiver_ksms_before = - ::account_data_of(AssetHubKusamaReceiver::get()).free; - - let ksm_at_asset_hub_polkadot_latest: Location = ksm_at_asset_hub_polkadot.try_into().unwrap(); - let amount_to_send = ASSET_HUB_KUSAMA_ED * 1_000; - send_asset_from_asset_hub_polkadot_to_asset_hub_kusama( - ksm_at_asset_hub_polkadot_latest, - amount_to_send, - ); - AssetHubKusama::execute_with(|| { - type RuntimeEvent = ::RuntimeEvent; - assert_expected_events!( - AssetHubKusama, - vec![ - // KSM is withdrawn from AHP's SA on AHK - RuntimeEvent::Balances( - pallet_balances::Event::Burned { who, amount } - ) => { - who: *who == sov_ahp_on_ahk, - amount: *amount == amount_to_send, - }, - // KSMs deposited to beneficiary - RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => { - who: *who == AssetHubKusamaReceiver::get(), - }, - // message processed successfully - RuntimeEvent::MessageQueue( - pallet_message_queue::Event::Processed { success: true, .. } - ) => {}, - ] - ); - }); - - let sender_ksms_after = AssetHubPolkadot::execute_with(|| { - type Assets = ::ForeignAssets; - >::balance(ksm_at_asset_hub_polkadot, &AssetHubPolkadotSender::get()) - }); - let receiver_ksms_after = - ::account_data_of(AssetHubKusamaReceiver::get()).free; - let ksms_in_reserve_on_ahk_after = - ::account_data_of(sov_ahp_on_ahk.clone()).free; - - // Sender's balance is reduced - assert!(sender_ksms_before >= sender_ksms_after + amount_to_send); - // Receiver's balance is increased - assert!(receiver_ksms_after > receiver_ksms_before); - // Reserve balance is reduced by sent amount - assert_eq!(ksms_in_reserve_on_ahk_after, ksms_in_reserve_on_ahk_before - amount_to_send); -} diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/mod.rs b/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/mod.rs index 0a9110f..0786529 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/mod.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/mod.rs @@ -15,100 +15,6 @@ use crate::*; -mod asset_transfers; mod claim_assets; -mod register_bridged_assets; -mod send_xcm; mod snowbridge; mod teleport; - - - -// pub(crate) fn asset_hub_kusama_location() -> Location { -// Location::new( -// 2, -// [GlobalConsensus(NetworkId::Kusama), Parachain(AssetHubKusama::para_id().into())], -// ) -// } -// -// pub(crate) fn bridge_hub_kusama_location() -> Location { -// Location::new( -// 2, -// [GlobalConsensus(NetworkId::Kusama), Parachain(BridgeHubKusama::para_id().into())], -// ) -// } -// -// pub(crate) fn send_asset_from_asset_hub_paseo( -// destination: Location, -// (id, amount): (Location, u128), -// ) -> DispatchResult { -// let signed_origin = -// ::RuntimeOrigin::signed(AssetHubPaseoSender::get()); -// -// let beneficiary: Location = -// AccountId32Junction { network: None, id: AssetHubKusamaReceiver::get().into() }.into(); -// -// let assets: Assets = (id, amount).into(); -// let fee_asset_item = 0; -// -// AssetHubPaseo::execute_with(|| { -// ::PolkadotXcm::limited_reserve_transfer_assets( -// signed_origin, -// bx!(destination.into()), -// bx!(beneficiary.into()), -// bx!(assets.into()), -// fee_asset_item, -// WeightLimit::Unlimited, -// ) -// }) -// } -// -// pub(crate) fn assert_bridge_hub_paseo_message_accepted(expected_processed: bool) { -// BridgeHubPaseo::execute_with(|| { -// type RuntimeEvent = ::RuntimeEvent; -// -// if expected_processed { -// assert_expected_events!( -// BridgeHubPaseo, -// vec![ -// // pay for bridge fees -// RuntimeEvent::Balances(pallet_balances::Event::Burned { .. }) => {}, -// // message exported -// RuntimeEvent::BridgeKusamaMessages( -// pallet_bridge_messages::Event::MessageAccepted { .. } -// ) => {}, -// // message processed successfully -// RuntimeEvent::MessageQueue( -// pallet_message_queue::Event::Processed { success: true, .. } -// ) => {}, -// ] -// ); -// } else { -// assert_expected_events!( -// BridgeHubPaseo, -// vec![ -// RuntimeEvent::MessageQueue(pallet_message_queue::Event::Processed { -// success: false, -// .. -// }) => {}, -// ] -// ); -// } -// }); -// } -// -// pub(crate) fn assert_bridge_hub_kusama_message_received() { -// BridgeHubKusama::execute_with(|| { -// type RuntimeEvent = ::RuntimeEvent; -// assert_expected_events!( -// BridgeHubKusama, -// vec![ -// // message sent to destination -// RuntimeEvent::XcmpQueue( -// cumulus_pallet_xcmp_queue::Event::XcmpMessageSent { .. } -// ) => {}, -// ] -// ); -// }) -// } -// diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/register_bridged_assets.rs b/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/register_bridged_assets.rs deleted file mode 100644 index 928b486..0000000 --- a/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/register_bridged_assets.rs +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use crate::tests::{ - snowbridge::{CHAIN_ID, WETH}, - *, -}; - -const XCM_FEE: u128 = 40_000_000_000; - -/// Tests the registering of a Polkadot Asset as a bridged asset on Kusama Asset Hub. -#[test] -fn register_polkadot_asset_on_kah_from_pah() { - // Polkadot Asset Hub asset when bridged to Kusama Asset Hub. - let bridged_asset_at_kah = v4::Location::new( - 2, - [ - v4::Junction::GlobalConsensus(v4::NetworkId::Polkadot), - v4::Junction::Parachain(AssetHubPolkadot::para_id().into()), - v4::Junction::PalletInstance(ASSETS_PALLET_ID), - v4::Junction::GeneralIndex(ASSET_ID.into()), - ], - ); - // Register above asset on Kusama AH from Polkadot AH. - register_asset_on_kah_from_pah(bridged_asset_at_kah); -} - -/// Tests the registering of an Ethereum Asset as a bridged asset on Kusama Asset Hub. -#[test] -fn register_ethereum_asset_on_kah_from_pah() { - // Ethereum asset when bridged to Kusama Asset Hub. - let bridged_asset_at_kah = v4::Location::new( - 2, - [ - v4::Junction::GlobalConsensus(v4::NetworkId::Ethereum { chain_id: CHAIN_ID }), - v4::Junction::AccountKey20 { network: None, key: WETH }, - ], - ); - // Register above asset on Kusama AH from Polkadot AH. - register_asset_on_kah_from_pah(bridged_asset_at_kah); -} - -fn register_asset_on_kah_from_pah(bridged_asset_at_kah: v4::Location) { - let sa_of_pah_on_kah = AssetHubKusama::sovereign_account_of_parachain_on_other_global_consensus( - Polkadot, - AssetHubPolkadot::para_id(), - ); - - // Encoded `create_asset` call to be executed in Kusama Asset Hub ForeignAssets pallet. - let call = AssetHubKusama::create_foreign_asset_call( - bridged_asset_at_kah.clone(), - ASSET_MIN_BALANCE, - sa_of_pah_on_kah.clone(), - ); - - let origin_kind = OriginKind::Xcm; - let fee_amount = XCM_FEE; - let fees = (Parent, fee_amount).into(); - - let xcm = xcm_transact_paid_execution(call, origin_kind, fees, sa_of_pah_on_kah.clone()); - - // SA-of-PAH-on-KAH needs to have balance to pay for fees and asset creation deposit - AssetHubKusama::fund_accounts(vec![( - sa_of_pah_on_kah.clone(), - ASSET_HUB_KUSAMA_ED * 10000000000, - )]); - - let destination = asset_hub_kusama_location(); - - // fund the PAH's SA on PBH for paying bridge transport fees - BridgeHubPolkadot::fund_para_sovereign(AssetHubPolkadot::para_id(), 10_000_000_000_000u128); - - // set XCM versions - AssetHubPolkadot::force_xcm_version(destination.clone(), XCM_VERSION); - BridgeHubPolkadot::force_xcm_version(bridge_hub_kusama_location(), XCM_VERSION); - - let root_origin = ::RuntimeOrigin::root(); - AssetHubPolkadot::execute_with(|| { - assert_ok!(::PolkadotXcm::send( - root_origin, - bx!(destination.into()), - bx!(xcm), - )); - - AssetHubPolkadot::assert_xcm_pallet_sent(); - }); - - assert_bridge_hub_polkadot_message_accepted(true); - assert_bridge_hub_kusama_message_received(); - AssetHubKusama::execute_with(|| { - type RuntimeEvent = ::RuntimeEvent; - AssetHubKusama::assert_xcmp_queue_success(None); - assert_expected_events!( - AssetHubKusama, - vec![ - // Burned the fee - RuntimeEvent::Balances(pallet_balances::Event::Burned { who, amount }) => { - who: *who == sa_of_pah_on_kah.clone(), - amount: *amount == fee_amount, - }, - // Foreign Asset created - RuntimeEvent::ForeignAssets(pallet_assets::Event::Created { asset_id, creator, owner }) => { - asset_id: *asset_id == bridged_asset_at_kah, - creator: *creator == sa_of_pah_on_kah.clone(), - owner: *owner == sa_of_pah_on_kah, - }, - // Unspent fee minted to origin - RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => { - who: *who == sa_of_pah_on_kah.clone(), - }, - ] - ); - type ForeignAssets = ::ForeignAssets; - assert!(ForeignAssets::asset_exists(bridged_asset_at_kah)); - }); -} diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/send_xcm.rs b/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/send_xcm.rs deleted file mode 100644 index 337a9c0..0000000 --- a/integration-tests/emulated/tests/bridges/bridge-hub-paseo/src/tests/send_xcm.rs +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use bridge_hub_paseo_runtime::bridge_to_kusama_config::BridgeHubPolkadot; -use crate::tests::*; -/* -#[test] -fn send_xcm_from_polkadot_relay_to_kusama_asset_hub_should_fail_on_not_applicable() { - // Init tests variables - // XcmPallet send arguments - let sudo_origin = ::RuntimeOrigin::root(); - let destination = Polkadot::child_location_of(BridgeHubPolkadot::para_id()).into(); - let weight_limit = WeightLimit::Unlimited; - let check_origin = None; - - let remote_xcm = Xcm(vec![ClearOrigin]); - - let xcm = VersionedXcm::from(Xcm(vec![ - UnpaidExecution { weight_limit, check_origin }, - ExportMessage { - network: KusamaId, - destination: [Parachain(AssetHubKusama::para_id().into())].into(), - xcm: remote_xcm, - }, - ])); - - // Polkadot Global Consensus - // Send XCM message from Relay Chain to Bridge Hub source Parachain - Polkadot::execute_with(|| { - assert_ok!(::XcmPallet::send( - sudo_origin, - bx!(destination), - bx!(xcm), - )); - - type RuntimeEvent = ::RuntimeEvent; - - assert_expected_events!( - Polkadot, - vec![ - RuntimeEvent::XcmPallet(pallet_xcm::Event::Sent { .. }) => {}, - ] - ); - }); - // Receive XCM message in Bridge Hub source Parachain, it should fail, because we don't have - // opened bridge/lane. - assert_bridge_hub_polkadot_message_accepted(false); -} - -#[test] -fn send_xcm_through_opened_lane_with_different_xcm_version_on_hops_works() { - // Initially set only default version on all runtimes - let newer_xcm_version = xcm::prelude::XCM_VERSION; - let older_xcm_version = newer_xcm_version - 1; - - AssetHubKusama::force_default_xcm_version(Some(older_xcm_version)); - BridgeHubKusama::force_default_xcm_version(Some(older_xcm_version)); - BridgeHubPolkadot::force_default_xcm_version(Some(older_xcm_version)); - AssetHubPolkadot::force_default_xcm_version(Some(older_xcm_version)); - - // prepare data - let destination = asset_hub_kusama_location(); - let native_token = Location::parent(); - let amount = ASSET_HUB_POLKADOT_ED * 1_000; - - // fund the AHK's SA on BHK for paying bridge transport fees - BridgeHubPolkadot::fund_para_sovereign(AssetHubPolkadot::para_id(), 10_000_000_000_000u128); - // fund sender - AssetHubPolkadot::fund_accounts(vec![(AssetHubPolkadotSender::get(), amount * 10)]); - - // send XCM from AssetHubPolkadot - fails - destination version not known - assert_err!( - send_asset_from_asset_hub_polkadot(destination.clone(), (native_token.clone(), amount)), - DispatchError::Module(sp_runtime::ModuleError { - index: 31, - error: [1, 0, 0, 0], - message: Some("SendFailure") - }) - ); - - // set destination version - AssetHubPolkadot::force_xcm_version(destination.clone(), newer_xcm_version); - - // set version with `ExportMessage` for BridgeHubPolkadot - AssetHubPolkadot::force_xcm_version( - ParentThen(Parachain(BridgeHubPolkadot::para_id().into()).into()).into(), - newer_xcm_version, - ); - // send XCM from AssetHubPolkadot - ok - assert_ok!(send_asset_from_asset_hub_polkadot( - destination.clone(), - (native_token.clone(), amount) - )); - - // `ExportMessage` on local BridgeHub - fails - remote BridgeHub version not known - assert_bridge_hub_polkadot_message_accepted(false); - - // set version for remote BridgeHub on BridgeHubPolkadot - BridgeHubPolkadot::force_xcm_version(bridge_hub_kusama_location(), newer_xcm_version); - // set version for AssetHubKusama on BridgeHubKusama - BridgeHubKusama::force_xcm_version( - ParentThen(Parachain(AssetHubKusama::para_id().into()).into()).into(), - newer_xcm_version, - ); - - // send XCM from AssetHubPolkadot - ok - assert_ok!(send_asset_from_asset_hub_polkadot( - destination.clone(), - (native_token.clone(), amount) - )); - assert_bridge_hub_polkadot_message_accepted(true); - assert_bridge_hub_kusama_message_received(); - // message delivered and processed at destination - AssetHubKusama::execute_with(|| { - type RuntimeEvent = ::RuntimeEvent; - assert_expected_events!( - AssetHubKusama, - vec![ - // message processed with failure, but for this scenario it is ok, important is that was delivered - RuntimeEvent::MessageQueue( - pallet_message_queue::Event::Processed { success: false, .. } - ) => {}, - ] - ); - }); -} -*/ From 3a031570221f0a6720653031d83b3f22306fbe36 Mon Sep 17 00:00:00 2001 From: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> Date: Thu, 28 Nov 2024 12:58:14 +0100 Subject: [PATCH 17/18] chore: update Cargo.lock --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d892847..b47966a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3569,9 +3569,9 @@ dependencies = [ [[package]] name = "frame-system" -version = "36.0.1" +version = "36.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d19f388280c14dbabcee2a817e1123c59c55847c6d07a5b5ca901b34a5910093" +checksum = "64d6a0e7bb6503facdcc6f8e19c83cd0bfc8bbbd268522b1a50e107dfc6b972d" dependencies = [ "cfg-if", "docify", @@ -6720,9 +6720,9 @@ dependencies = [ [[package]] name = "pallet-message-queue" -version = "39.0.0" +version = "39.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20e65a37881d1998546254a5e50a1f768b3f82deabe774e750f4ea95aba8030c" +checksum = "8bb779dbfd58b3a4e6a84245392fe9d8c31a746ff7c6db414e91c012663859c3" dependencies = [ "environmental", "frame-benchmarking", From 5cef1e33f357cff2dbabf19ee75661f122179a96 Mon Sep 17 00:00:00 2001 From: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> Date: Tue, 3 Dec 2024 11:45:39 +0100 Subject: [PATCH 18/18] chore(paseo): include root at genesis --- relay/paseo/src/genesis_config_presets.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/relay/paseo/src/genesis_config_presets.rs b/relay/paseo/src/genesis_config_presets.rs index 83c374b..5335d07 100644 --- a/relay/paseo/src/genesis_config_presets.rs +++ b/relay/paseo/src/genesis_config_presets.rs @@ -153,7 +153,7 @@ fn paseo_testnet_genesis( AuthorityDiscoveryId, BeefyId, )>, - _root_key: AccountId, + root_key: AccountId, endowed_accounts: Option>, ) -> serde_json::Value { let endowed_accounts: Vec = endowed_accounts.unwrap_or_else(testnet_accounts); @@ -195,6 +195,9 @@ fn paseo_testnet_genesis( "forceEra": Forcing::NotForcing, "slashRewardFraction": Perbill::from_percent(10), }, + "sudo": { + "key": Some(root_key), + }, "babe": { "epochConfig": Some(BABE_GENESIS_EPOCH_CONFIG), },