Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inbound queue v2 #2

Closed
wants to merge 170 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
170 commits
Select commit Hold shift + click to select a range
b01161f
feat(xcm-v5): skeleton
franciscoaguirre Jun 5, 2024
0b83e68
feat(xcm-v3): no longer use v2 types
franciscoaguirre Jun 5, 2024
e917d67
feat: remove XCMv2
franciscoaguirre Jun 5, 2024
9005e04
Merge branch 'master' into xcm-v5
franciscoaguirre Jun 19, 2024
5fc4a32
fix(xcm-v5): fix most compilation errors
franciscoaguirre Jun 19, 2024
337e26e
Merge branch 'master' into xcm-v5
franciscoaguirre Jun 26, 2024
19cc1da
fix(pallet-xcm): change V4 to V5
franciscoaguirre Jun 26, 2024
5cfd108
Merge branch 'master' into xcm-v5
franciscoaguirre Aug 14, 2024
96b5b4b
Merge branch 'master' into xcm-v5
franciscoaguirre Aug 14, 2024
6de7a42
Merge branch 'master' into xcm-v5
franciscoaguirre Aug 16, 2024
126ef2f
fix(xcm-v5): change v4 to v5
franciscoaguirre Aug 16, 2024
a16e19f
fix: more v4 to v5 conversions
franciscoaguirre Aug 16, 2024
a3a09af
Merge branch 'master' into xcm-v5
franciscoaguirre Aug 16, 2024
bbba323
fix: more v4 to v5 conversions
franciscoaguirre Aug 16, 2024
98c3906
fix: more v4 to v5 conversions
franciscoaguirre Aug 16, 2024
08a82d1
fix(xcm-builder): use previously unused function
franciscoaguirre Aug 19, 2024
1f031ec
fix(xcm-executor): change v4 to v5
franciscoaguirre Aug 19, 2024
5b423ad
Merge branch 'master' into xcm-v5
franciscoaguirre Aug 21, 2024
1116cbb
Merge branch 'master' into xcm-v5
franciscoaguirre Aug 21, 2024
cfa2ef4
Merge branch 'master' into xcm-v5
franciscoaguirre Aug 27, 2024
241e992
Merge branch 'master' into xcm-v5
franciscoaguirre Sep 4, 2024
d421d3f
Merge branch 'master' into xcm-v5
franciscoaguirre Sep 4, 2024
3e85791
Merge branch 'master' into xcm-v5
franciscoaguirre Oct 1, 2024
f80c76a
fix: v4 -> v5
franciscoaguirre Oct 1, 2024
9a37238
Add migration to clear unapproved proposals from treasury pallet (#5892)
davidk-pt Oct 8, 2024
97a6ea5
SolochainDefaultConfig: Use correct `AccountData` (#5941)
bkchr Oct 8, 2024
4b40e76
improve prdoc generation (#5931)
mordamax Oct 8, 2024
a4dce86
Omni-Node renamings (#5915)
serban300 Oct 8, 2024
c482333
[omni-bencher] Make all runtimes work (#5872)
ggwpez Oct 8, 2024
1e5f5fe
bump zombienet version and set request for k8s (#5968)
pepoviola Oct 8, 2024
5d82bdc
Bump some dependencies (#5886)
bkchr Oct 8, 2024
6c2b46f
Disable flaky tests reported in 5972/5973/5974 (#5976)
pepoviola Oct 9, 2024
6765bcd
[ci] Remove short-benchmarks from Gitlab (#5988)
alvicsam Oct 9, 2024
c477076
[Release/CI] Github flow to build `polkadot`/`polkadot-parachain` rc …
EgorPopelyaev Oct 9, 2024
3ad1291
Bump PoV request timeout (#5924)
AndreiEres Oct 9, 2024
48b56aa
[ci] Move test-linux-stable-no-try-runtime to GHA (#5979)
alvicsam Oct 9, 2024
292bfac
Fix u256 conversion in BABE (#5994)
ordian Oct 9, 2024
90ff47d
Snowbridge V2 docs (#5902)
vgeddes Oct 9, 2024
e294d62
Add PVF execution priority (#4837)
AndreiEres Oct 9, 2024
e0062af
Bump strum from 0.26.2 to 0.26.3 (#5943)
dependabot[bot] Oct 9, 2024
cb1f19c
Add RadiumBlock bootnodes to Coretime Polkadot Chain spec (#5967)
radiumb Oct 10, 2024
4a70b2c
Remove redundant XCMs from dry run's forwarded xcms (#5913)
franciscoaguirre Oct 10, 2024
cba7d13
Fix `0003-beefy-and-mmr` test (#6003)
serban300 Oct 10, 2024
439b31e
Set larger timeout for cmd.yml (#6006)
mordamax Oct 10, 2024
c16ac92
[ci] Remove quick-benchmarks-omni from GitLab (#6014)
alvicsam Oct 11, 2024
e5ccc00
Rename QueueEvent::StartWork (#6015)
AndreiEres Oct 11, 2024
b45f89c
`substrate-node`: removed excessive polkadot-sdk features (#5925)
michalkucharczyk Oct 11, 2024
c0b7343
/cmd: Improved devx of benching many pallets simultaneously (#6007)
mordamax Oct 11, 2024
d1c115b
Fix storage expansion in pallet section (#6023)
eagr Oct 12, 2024
ff87db8
update cmd timeout (#6038)
mordamax Oct 14, 2024
d7f01a1
Use the umbrella crate for the parachain template (#5991)
serban300 Oct 14, 2024
aca11dc
Westend: Constant yearly emission (#5999)
ggwpez Oct 14, 2024
6f03f7a
Fix `feeless_if` in pallet section (#6032)
eagr Oct 14, 2024
f7119e4
Remove `check-migrations` for rococo chain (#6061)
bkontur Oct 15, 2024
36eadec
Remove "Check Features" test
bkchr Oct 15, 2024
b20be7c
pallet-xcm: added useful error logs (#2408) (#4982)
ayevbeosa Oct 15, 2024
d2ba567
Add assets in pool with native to query_acceptable_payment_assets's r…
franciscoaguirre Oct 15, 2024
183b55a
Bump zombienet version `v1.3.115` (#6065)
pepoviola Oct 15, 2024
26c11fc
fork-aware transaction pool added (#4639)
michalkucharczyk Oct 15, 2024
4edb219
[ci] Move build and publish rustdocs to GHA (#6047)
alvicsam Oct 15, 2024
f754863
Bump tokio-test from 0.4.3 to 0.4.4 (#5944)
dependabot[bot] Oct 15, 2024
5a8e082
Fix `solochain-template-runtime` freezes config (#5846)
rbochenek Oct 15, 2024
fbd69a3
remove pallet::getter from pallet-offences (#6027)
Zebedeusz Oct 16, 2024
38aa4b7
litep2p/discovery: Fix memory leak in `litep2p.public_addresses()` (#…
lexnv Oct 16, 2024
2c41656
Stabilize elastic-pov-recovery zombienet test (#6076)
skunert Oct 16, 2024
b649f4a
Metadata V16 (unstable): Enrich metadata with associated types of con…
lexnv Oct 16, 2024
9d78c51
Refactor staking pallet benchmarks to `v2` (#6025)
rockbmb Oct 16, 2024
e610059
Bump platforms from 3.0.2 to 3.4.1 (#5865)
dependabot[bot] Oct 16, 2024
90c0a0c
[pallet-revive] ensure the return data is reset if no frame was insta…
xermicus Oct 16, 2024
4cd7e86
[ci] Small updates (#6085)
alvicsam Oct 16, 2024
504edb1
Fix for Issue 4762 (#4803)
gotnoshoeson Oct 16, 2024
d5b96e9
bump `zombienet` version and inc. memory request in k8s (#6091)
pepoviola Oct 16, 2024
d1425bb
[XCMv5] Better fee mechanism (#5420)
franciscoaguirre Oct 17, 2024
31dfc9f
Import vec to bridges/primitives/header-chain (#6031)
drewstone Oct 17, 2024
f481f8e
Merge branch 'master' of github.com:paritytech/polkadot-sdk into xcm-v5
acatangiu Oct 17, 2024
678a379
Merge branch 'master' into xcm-v5
acatangiu Oct 17, 2024
9714796
[AHs] Support registering assets on Asset Hubs over bridge (#5435)
acatangiu Oct 17, 2024
a2c7575
Refactor get_account_id_from_seed / get_from_seed to one common place…
programskillforverification Oct 17, 2024
4d9cc77
Merge branch 'master' of github.com:paritytech/polkadot-sdk into xcm-v5
acatangiu Oct 17, 2024
cdfecb7
fix merge dmg
acatangiu Oct 17, 2024
1cc760b
[Release/CI] Adjust release pipelines to support new tags and delete …
EgorPopelyaev Oct 17, 2024
d23a1bb
Fix generate-prdoc for single audiences (#6103)
seadanda Oct 17, 2024
7240b47
Added Trusted Query API calls (#6039)
x3c41a Oct 17, 2024
09155db
pallet-revive: EXTCODEHASH to match EIP-1052 (#6088)
ermalkaleci Oct 18, 2024
a0aefc6
rpc v2: backpressure `chainhead_v1_follow` (#6058)
pkhry Oct 18, 2024
b48a6fa
[CI] Fix branch-off pipeline (#6120)
EgorPopelyaev Oct 18, 2024
a83f0fe
Adding migration instruction from benchmarking v1 to v2 (#6093)
re-gius Oct 18, 2024
b76e91a
FRAME: Reintroduce `TransactionExtension` as a replacement for `Signe…
georgepisaltu Oct 18, 2024
e9238b3
Removed .scale files (#6124)
x3c41a Oct 18, 2024
c6b847a
Added .scale metadata-files to gitignore (#6130)
x3c41a Oct 18, 2024
5e0843e
sync: Remove checking of the extrinsics root (#5686)
bkchr Oct 18, 2024
21b3a46
Improve CheckMetadataHash: make it constant time and compile error on…
gui1117 Oct 20, 2024
73a51fd
bump zombienet version `v1.3.116` (#6155)
pepoviola Oct 21, 2024
d4409e3
Fix a reference name in a reusable workflow invocation (#6118)
pavelsupr Oct 21, 2024
a538ac1
Bump the known_good_semver group across 1 directory with 3 updates (#…
dependabot[bot] Oct 21, 2024
446465b
Added SetAssetClaimer Instruction to XCM v5 (#5585)
x3c41a Oct 21, 2024
4a6e85c
Merge branch 'master' into xcm-v5
acatangiu Oct 21, 2024
95483a8
Improved TrustedQueryAPI signatures (#6129)
x3c41a Oct 21, 2024
9f515e0
Fix and re-enable `zombienet-substrate-0002-validators-warp-sync` (#6…
serban300 Oct 21, 2024
69b929f
Bump thiserror from 1.0.61 to 1.0.64 (#6143)
dependabot[bot] Oct 21, 2024
4387d0f
include more external links and resources (#5758)
kianenigma Oct 21, 2024
dbaa428
fix js oom `js-scripts` (#6139)
pepoviola Oct 21, 2024
a3bca4b
[Coretime chain] Add high assignment count mitigation to testnets (#6…
seadanda Oct 21, 2024
13d3f58
Bump prost-build from 0.12.4 to 0.13.2 (#6144)
dependabot[bot] Oct 21, 2024
225536c
Bump the ci_dependencies group across 1 directory with 5 updates (#6035)
dependabot[bot] Oct 21, 2024
ee803b7
runtime: remove ttl (#5461)
alindima Oct 21, 2024
03f1d2d
[pallet-nfts, pallet_uniques] - Expose private structs (#6087)
dudo50 Oct 21, 2024
d1cf996
[Backport] Version bumps from stable2409-1 (#6153)
EgorPopelyaev Oct 22, 2024
356386b
Fix TrustedQueryApi Error (#6170)
serban300 Oct 22, 2024
21930ed
[pallet-revive] Eth RPC integration (#5866)
pgherveou Oct 22, 2024
aeebf2f
[pallet-revive] fix fixture build path (#6174)
pgherveou Oct 22, 2024
77836cf
`fatxpool`: `LocalTransactionPool` implemented (#6104)
michalkucharczyk Oct 22, 2024
6418131
Use bool::then instead of then_some with function calls (#6156)
tmpolaczyk Oct 22, 2024
b4732ad
Assets in pool with native can be used in `query_weight_to_asset_fee`…
franciscoaguirre Oct 22, 2024
ed23182
[pallet-revive] Add pallet to AH westend (#5502)
pgherveou Oct 23, 2024
fc486e5
Polkadot OmniNode Docs (#6094)
kianenigma Oct 23, 2024
8fe7700
[xcm-v5] implement RFC#100: add new InitiateTransfer instruction (#5876)
acatangiu Oct 23, 2024
10d6795
Merge branch 'master' into xcm-v5
franciscoaguirre Oct 23, 2024
2324bd7
Fix `zombienet-bridges-0001-asset-transfer-works` (#6175)
serban300 Oct 24, 2024
d4b01ad
[pallet-revive] fix hardcoded gas in tests (#6192)
pgherveou Oct 24, 2024
b9c3172
Added Trusted Query API implementation for Westend and Rococo relay c…
x3c41a Oct 24, 2024
5682f9a
Snowbridge: PNA Audit Better Documentation and minor Refactorings (#6…
alistair-singh Oct 24, 2024
c0df223
Enable approval-voting-parallel by default on kusama (#6218)
alexggh Oct 24, 2024
68af85e
pallet macro: Support instantiable pallets in tasks (#5194)
gui1117 Oct 24, 2024
0e9cca0
Rebase inbound queue
yrong Oct 24, 2024
860d93b
Disable tests reported in #6062 (#6064)
pepoviola Oct 24, 2024
0596928
Fix a tiny typo (#6229)
jasl Oct 24, 2024
5d7181c
pallet-message-queue: Fix max message size calculation (#6205)
bkchr Oct 24, 2024
7e99621
`RuntimeGenesiConfig`: json macro added (#5813)
michalkucharczyk Oct 25, 2024
5a14285
substrate-offchain: upgrade hyper to v1 (#5919)
ShoyuVanilla Oct 25, 2024
0796326
pallet-revive: Add stateful address mapping (#6096)
athei Oct 25, 2024
efd6603
Fix migrations for pallet-xcm (#6148)
bkontur Oct 25, 2024
a072ce8
asset-hubs: simplify xcm-config (#6222)
acatangiu Oct 25, 2024
4c618a8
Switch node side to v2 candidate receipts (#5679)
sandreim Oct 25, 2024
df66d76
Fix a flaky zombienet test - 0004-coretime-smoke-test (#6236)
tdimitrov Oct 28, 2024
935eeb5
fix experimental-ump-signals tests (#6214)
alindima Oct 28, 2024
8590122
remove parachains_assigner code (#6171)
alindima Oct 28, 2024
58fd5ae
[pallet-revive] Add Ethereum JSON-RPC server (#6147)
pgherveou Oct 28, 2024
c90bfed
Emit the entire message
yrong Oct 28, 2024
7e87654
[pallet-revive] Update typeInfo (#6263)
pgherveou Oct 28, 2024
54c19f5
pallet-revive: Trade code size for call stack depth (#6264)
athei Oct 28, 2024
3233c3f
Merge branch 'xcm-v5' into outbound-queue-v2
yrong Oct 29, 2024
d3b26bb
Update tests
yrong Oct 29, 2024
32ac7aa
Fix compile error
yrong Oct 29, 2024
8f59cc4
Merge branch 'outbound-queue-v2' into inbound-queue-v2
yrong Oct 29, 2024
3660624
Fix test
yrong Oct 29, 2024
ee92d41
Predict route table by content of xcm
yrong Oct 29, 2024
bd02251
Merge branch 'outbound-queue-v2' into inbound-queue-v2
yrong Oct 29, 2024
35535ef
[pallet-revive] implement tx origin API (#6105)
xermicus Oct 29, 2024
91b6405
Use XCM V5 instructions
yrong Oct 29, 2024
a1b8381
Transact without specifying weight (#6228)
franciscoaguirre Oct 29, 2024
9584dbd
Use frame umbrella crate in `pallet-proxy` and `pallet-multisig` (#5995)
kianenigma Oct 29, 2024
86542d6
[xcm-v5] implement RFC#122: InitiateTransfer can alias XCM original o…
acatangiu Oct 29, 2024
e8807a3
Merge branch 'master' into xcm-v5
acatangiu Oct 29, 2024
d9bb2c4
Transfer PNA with XCMV5
yrong Oct 29, 2024
67c6e79
Merge branch 'xcm-v5' into outbound-queue-v2
yrong Oct 29, 2024
f40656c
Preserve origin with AliasOrigin
yrong Oct 29, 2024
bbf1299
Improve commens
yrong Oct 30, 2024
593c182
Fix FeeManager runtime config & Refactoring to pull SendMessageFeePro…
yrong Oct 30, 2024
48f5e19
Fix tests
yrong Oct 30, 2024
d1e901d
Fix test
yrong Oct 30, 2024
9e39dca
Merge branch 'outbound-queue-v2' into inbound-queue-v2
yrong Oct 31, 2024
75d7891
Derive Origin with describeLocation
yrong Oct 31, 2024
90128f4
Cleanup
yrong Oct 31, 2024
0e27a22
Runtime api convert xcm to InboundMessage
yrong Oct 31, 2024
cf8f536
inbound v2
claravanstaden Nov 1, 2024
3e9b03d
send token unit test
claravanstaden Nov 4, 2024
5b92bd0
xcm decoding
claravanstaden Nov 4, 2024
41170b3
adds more tests
claravanstaden Nov 5, 2024
2250d9b
Merge remote-tracking branch 'ron/outbound-queue-v2' into inbound-que…
claravanstaden Nov 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
38 changes: 15 additions & 23 deletions .github/actions/set-up-gh/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'install gh'
description: 'Install the gh cli in a debian based distro and switches to the PR branch.'
name: "install gh"
description: "Install the gh cli in a debian based distro and switches to the PR branch."
inputs:
pr-number:
description: "Number of the PR"
Expand All @@ -9,28 +9,20 @@ inputs:
required: true
outputs:
branch:
description: 'Branch name for the PR'
description: "Branch name for the PR"
value: ${{ steps.branch.outputs.branch }}
runs:
using: "composite"
steps:
- name: Instal gh cli
shell: bash
# Here it would get the script from previous step
run: |
(type -p wget >/dev/null || (apt update && apt-get install wget -y))
mkdir -p -m 755 /etc/apt/keyrings
wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null
chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null
apt update
apt install gh -y
git config --global --add safe.directory '*'
- run: gh pr checkout ${{ inputs.pr-number }}
shell: bash
env:
GITHUB_TOKEN: ${{ inputs.GH_TOKEN }}
- name: Export branch name
shell: bash
run: echo "branch=$(git rev-parse --abbrev-ref HEAD)" >> "$GITHUB_OUTPUT"
id: branch
- name: Set up git
shell: bash
# Here it would get the script from previous step
run: git config --global --add safe.directory '*'
- run: gh pr checkout ${{ inputs.pr-number }}
shell: bash
env:
GITHUB_TOKEN: ${{ inputs.GH_TOKEN }}
- name: Export branch name
shell: bash
run: echo "branch=$(git rev-parse --abbrev-ref HEAD)" >> "$GITHUB_OUTPUT"
id: branch
79 changes: 52 additions & 27 deletions .github/scripts/cmd/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import argparse
import _help
import importlib.util
import re

_HelpAction = _help._HelpAction

Expand All @@ -15,34 +16,45 @@
runtimeNames = list(map(lambda x: x['name'], runtimesMatrix))

common_args = {
'--continue-on-fail': {"action": "store_true", "help": "Won't exit(1) on failed command and continue with next steps. "},
'--quiet': {"action": "store_true", "help": "Won't print start/end/failed messages in PR"},
'--clean': {"action": "store_true", "help": "Clean up the previous bot's & author's comments in PR"},
'--image': {"help": "Override docker image '--image docker.io/paritytech/ci-unified:latest'"},
}

def print_and_log(message, output_file='/tmp/cmd/command_output.log'):
print(message)
with open(output_file, 'a') as f:
f.write(message + '\n')

def setup_logging():
if not os.path.exists('/tmp/cmd'):
os.makedirs('/tmp/cmd')
open('/tmp/cmd/command_output.log', 'w')

parser = argparse.ArgumentParser(prog="/cmd ", description='A command runner for polkadot-sdk repo', add_help=False)
parser.add_argument('--help', action=_HelpAction, help='help for help if you need some help') # help for help
for arg, config in common_args.items():
parser.add_argument(arg, **config)

subparsers = parser.add_subparsers(help='a command to run', dest='command')

setup_logging()

"""
BENCH
BENCH
"""

bench_example = '''**Examples**:
Runs all benchmarks
Runs all benchmarks
%(prog)s

Runs benchmarks for pallet_balances and pallet_multisig for all runtimes which have these pallets. **--quiet** makes it to output nothing to PR but reactions
%(prog)s --pallet pallet_balances pallet_xcm_benchmarks::generic --quiet
Runs bench for all pallets for westend runtime and continues even if some benchmarks fail
%(prog)s --runtime westend --continue-on-fail
Does not output anything and cleans up the previous bot's & author command triggering comments in PR

Runs bench for all pallets for westend runtime and fails fast on first failed benchmark
%(prog)s --runtime westend --fail-fast

Does not output anything and cleans up the previous bot's & author command triggering comments in PR
%(prog)s --runtime westend rococo --pallet pallet_balances pallet_multisig --quiet --clean
'''

Expand All @@ -53,16 +65,17 @@

parser_bench.add_argument('--runtime', help='Runtime(s) space separated', choices=runtimeNames, nargs='*', default=runtimeNames)
parser_bench.add_argument('--pallet', help='Pallet(s) space separated', nargs='*', default=[])
parser_bench.add_argument('--fail-fast', help='Fail fast on first failed benchmark', action='store_true')

"""
FMT
FMT
"""
parser_fmt = subparsers.add_parser('fmt', help='Formats code (cargo +nightly-VERSION fmt) and configs (taplo format)')
for arg, config in common_args.items():
parser_fmt.add_argument(arg, **config)

"""
Update UI
Update UI
"""
parser_ui = subparsers.add_parser('update-ui', help='Updates UI tests')
for arg, config in common_args.items():
Expand All @@ -77,7 +90,7 @@
spec.loader.exec_module(generate_prdoc)

parser_prdoc = subparsers.add_parser('prdoc', help='Generates PR documentation')
generate_prdoc.setup_parser(parser_prdoc)
generate_prdoc.setup_parser(parser_prdoc, pr_required=False)

def main():
global args, unknown, runtimesMatrix
Expand All @@ -104,7 +117,7 @@ def main():
print(f'-- listing pallets for benchmark for {runtime["name"]}')
wasm_file = f"target/{profile}/wbuild/{runtime['package']}/{runtime['package'].replace('-', '_')}.wasm"
output = os.popen(
f"frame-omni-bencher v1 benchmark pallet --no-csv-header --no-storage-info --no-min-squares --no-median-slopes --all --list --runtime={wasm_file}").read()
f"frame-omni-bencher v1 benchmark pallet --no-csv-header --no-storage-info --no-min-squares --no-median-slopes --all --list --runtime={wasm_file} {runtime['bench_flags']}").read()
raw_pallets = output.strip().split('\n')

all_pallets = set()
Expand Down Expand Up @@ -156,12 +169,22 @@ def main():
manifest_path = os.popen(search_manifest_path).read()
if not manifest_path:
print(f'-- pallet {pallet} not found in dev runtime')
exit(1)
if args.fail_fast:
print_and_log(f'Error: {pallet} not found in dev runtime')
sys.exit(1)
package_dir = os.path.dirname(manifest_path)
print(f'-- package_dir: {package_dir}')
print(f'-- manifest_path: {manifest_path}')
output_path = os.path.join(package_dir, "src", "weights.rs")
# TODO: we can remove once all pallets in dev runtime are migrated to polkadot-sdk-frame
try:
uses_polkadot_sdk_frame = "true" in os.popen(f"cargo metadata --locked --format-version 1 --no-deps | jq -r '.packages[] | select(.name == \"{pallet.replace('_', '-')}\") | .dependencies | any(.name == \"polkadot-sdk-frame\")'").read()
# Empty output from the previous os.popen command
except StopIteration:
uses_polkadot_sdk_frame = False
template = config['template']
if uses_polkadot_sdk_frame and re.match(r"frame-(:?umbrella-)?weight-template\.hbs", os.path.normpath(template).split(os.path.sep)[-1]):
template = "substrate/.maintain/frame-umbrella-weight-template.hbs"
else:
default_path = f"./{config['path']}/src/weights"
xcm_path = f"./{config['path']}/src/weights/xcm"
Expand All @@ -182,11 +205,13 @@ def main():
f"--repeat=20 " \
f"--heap-pages=4096 " \
f"{f'--template={template} ' if template else ''}" \
f"--no-storage-info --no-min-squares --no-median-slopes"
f"--no-storage-info --no-min-squares --no-median-slopes " \
f"{config['bench_flags']}"
print(f'-- Running: {cmd} \n')
status = os.system(cmd)
if status != 0 and not args.continue_on_fail:
print(f'Failed to benchmark {pallet} in {runtime}')

if status != 0 and args.fail_fast:
print_and_log(f'❌ Failed to benchmark {pallet} in {runtime}')
sys.exit(1)

# Otherwise collect failed benchmarks and print them at the end
Expand All @@ -197,42 +222,42 @@ def main():
successful_benchmarks[f'{runtime}'] = successful_benchmarks.get(f'{runtime}', []) + [pallet]

if failed_benchmarks:
print('❌ Failed benchmarks of runtimes/pallets:')
print_and_log('❌ Failed benchmarks of runtimes/pallets:')
for runtime, pallets in failed_benchmarks.items():
print(f'-- {runtime}: {pallets}')
print_and_log(f'-- {runtime}: {pallets}')

if successful_benchmarks:
print('✅ Successful benchmarks of runtimes/pallets:')
print_and_log('✅ Successful benchmarks of runtimes/pallets:')
for runtime, pallets in successful_benchmarks.items():
print(f'-- {runtime}: {pallets}')
print_and_log(f'-- {runtime}: {pallets}')

elif args.command == 'fmt':
command = f"cargo +nightly fmt"
print(f'Formatting with `{command}`')
nightly_status = os.system(f'{command}')
taplo_status = os.system('taplo format --config .config/taplo.toml')

if (nightly_status != 0 or taplo_status != 0) and not args.continue_on_fail:
print('❌ Failed to format code')
if (nightly_status != 0 or taplo_status != 0):
print_and_log('❌ Failed to format code')
sys.exit(1)

elif args.command == 'update-ui':
command = 'sh ./scripts/update-ui-tests.sh'
print(f'Updating ui with `{command}`')
status = os.system(f'{command}')

if status != 0 and not args.continue_on_fail:
print('❌ Failed to format code')
if status != 0:
print_and_log('❌ Failed to update ui')
sys.exit(1)

elif args.command == 'prdoc':
# Call the main function from ./github/scripts/generate-prdoc.py module
exit_code = generate_prdoc.main(args)
if exit_code != 0 and not args.continue_on_fail:
print('❌ Failed to generate prdoc')
if exit_code != 0:
print_and_log('❌ Failed to generate prdoc')
sys.exit(exit_code)

print('🚀 Done')

if __name__ == '__main__':
main()
main()
Loading
Loading