Skip to content

[tc-cli] add dump-state and load-state commands #1125

[tc-cli] add dump-state and load-state commands

[tc-cli] add dump-state and load-state commands #1125

# Triggered via !ci-frame-benchmark tag
name: Update runtime weights for frame pallets
on:
pull_request:
types: [labeled, unlabeled, opened, reopened, synchronize]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-benchmark:
runs-on: [self-hosted, benchmark]
if: ${{ contains(github.event.pull_request.labels.*.name,'!ci-frame-benchmark') }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build runtime benchmarks
uses: ./.github/actions/cargo-command
with:
package: timechain-node
feature: runtime-benchmarks
- name: Upload runtime benchmarks
uses: actions/upload-artifact@v4
with:
name: runtime-benchmarks
if-no-files-found: error
path: target/release/timechain-node
run-benchmark:
needs: [build-benchmark]
runs-on: [self-hosted, benchmark]
strategy:
fail-fast: false
matrix:
pallet: [frame_system, pallet_balances, pallet_timestamp, pallet_im_online, pallet_utility, pallet_bags_list, pallet_proxy, pallet_multisig]
steps:
- name: Download runtime benchmarks
uses: actions/download-artifact@v4
with:
name: runtime-benchmarks
- name: Prepare runtime benchmarks
run: chmod +x timechain-node && mkdir -p develop
- name: Run runtime benchmarks for pallets
run: ./timechain-node benchmark pallet --chain dev --pallet ${{ matrix.pallet }} --extrinsic '*' --output ./develop/${{ matrix.pallet }}.rs
- name: Upload weights
uses: actions/upload-artifact@v4
with:
name: weights-develop-${{ matrix.pallet }}
if-no-files-found: error
path: develop/${{ matrix.pallet }}.rs
update-weights:
needs: [run-benchmark]
runs-on: [self-hosted, benchmark]
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
submodules: recursive
- name: Download testnet weights
uses: actions/download-artifact@v4
with:
path: runtime/src/weights/develop
pattern: weights-develop-*
merge-multiple: true
- name: Commit updated weights
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.email "[email protected]"
git config user.name "Weights Update Bot"
git add .
git commit -am "runtimes: update pallet weights"
git push