Skip to content

TryState checks workflow run on production runtimes#1499

Merged
ipapandinas merged 21 commits intomasterfrom
ci/try-state
Jul 17, 2025
Merged

TryState checks workflow run on production runtimes#1499
ipapandinas merged 21 commits intomasterfrom
ci/try-state

Conversation

@ipapandinas
Copy link
Contributor

Pull Request Summary

Complete #1498 to run try-state checks workflow on production runtimes.

@ipapandinas ipapandinas added the ci This PR/Issue is related to the topic "CI" label Jul 8, 2025
Copy link
Contributor

@ermalkaleci ermalkaleci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The checkout needs to happen before rust show to install correct version.
And all this script can be replaced with

curl -s -L 'https://rpc.astar.network' \
--header 'Content-Type: application/json' \
--data '{
    "jsonrpc": "2.0",
    "method": "state_getRuntimeVersion",
    "params": [],
    "id": 1
}' | jq .result.specVersion

@ermalkaleci
Copy link
Contributor

SPEC_VERSION=$(curl -s -L 'https://rpc.astar.network' \
--header 'Content-Type: application/json' \
--data '{
    "jsonrpc": "2.0",
    "method": "state_getRuntimeVersion",
    "params": [],
    "id": 1
}' | jq -r .result.specVersion)

@ipapandinas ipapandinas requested a review from ermalkaleci July 9, 2025 10:32
@ipapandinas
Copy link
Contributor Author

@ermalkaleci I am using websocat instead of curl because the endpoints are WebSockets

@ermalkaleci
Copy link
Contributor

It is http as well

- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe Ermal pointed this part as redundant, right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I mean the other git checkout is redundant. I will add more comments

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ehmmm ok.

Not sure how the other one can be redundant though since it's done after finding the tag.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run: sudo apt -y install protobuf-compiler
run: |
sudo apt -y install protobuf-compiler jq
curl -L https://github.com/vi/websocat/releases/latest/download/websocat.x86_64-unknown-linux-musl -o websocat
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mentioned it doesn't work for the secret WSS endpoint, but do you need to use that one?

In case of e.g. try-runtime tests we want to use something without limits.
But for a single RPC request, public endpoint should be just fine, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I hadn't considered this approach, but it makes much more sense

@@ -24,17 +24,47 @@ jobs:
steps:
Copy link
Contributor

@ermalkaleci ermalkaleci Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First extend matrix with

runtime:
          - { name: astar, endpoint: ASTAR_RUNTIME_ENDPOINT, http: 'https://rpc.astar.network' }
          - { name: shiden, endpoint: SHIDEN_RUNTIME_ENDPOINT, http: 'https://rpc.shiden.astar.network' }
          - { name: shibuya, endpoint: SHIBUYA_RUNTIME_ENDPOINT, http: 'https://rpc.shibuya.astar.network' }

and a step before checkout to find the tag:

Suggested change
steps:
steps:
- run: |
SPEC_VERSION=$(curl -s https://rpc.astar.network -H 'Content-Type: application/json' -d'{"jsonrpc":"2.0","method":"state_getRuntimeVersion","params":[],"id":1}' | jq -r .result.specVersion)
echo "RUNTIME_TAG=runtime-$SPEC_VERSION" >> $GITHUB_ENV

finally checkout at ref:

   uses: actions/checkout@v4
        with:
          ref: ${{ env.RUNTIME_TAG }}
          fetch-depth: 0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the additional guidance, it helped a lot. I now understand what was wrong and what you had in mind. I've pushed the updates, so hopefully everything is correct now

@github-actions
Copy link

Code Coverage

Package Line Rate Branch Rate Health
pallets/dynamic-evm-base-fee/src 84% 0%
pallets/ethereum-checked/src 76% 0%
pallets/dapp-staking/rpc/runtime-api/src 0% 0%
pallets/dapp-staking/src/test 0% 0%
precompiles/xcm/src 69% 0%
precompiles/substrate-ecdsa/src 67% 0%
pallets/astar-xcm-benchmarks/src/fungible 100% 0%
pallets/vesting-mbm/src 87% 0%
pallets/collective-proxy/src 94% 0%
chain-extensions/unified-accounts/src 0% 0%
pallets/dapp-staking/src/benchmarking 95% 0%
precompiles/assets-erc20/src 77% 0%
precompiles/dispatch-lockdrop/src 83% 0%
chain-extensions/types/assets/src 0% 0%
pallets/inflation/src 84% 0%
pallets/dapp-staking/src 80% 0%
pallets/democracy-mbm/src 30% 0%
pallets/collator-selection/src 87% 0%
pallets/astar-xcm-benchmarks/src 86% 0%
precompiles/dapp-staking/src 89% 0%
precompiles/dapp-staking/src/test 0% 0%
pallets/price-aggregator/src 75% 0%
chain-extensions/types/unified-accounts/src 0% 0%
chain-extensions/pallet-assets/src 54% 0%
pallets/xc-asset-config/src 62% 0%
primitives/src/xcm 62% 0%
pallets/static-price-provider/src 91% 0%
precompiles/sr25519/src 56% 0%
precompiles/unified-accounts/src 100% 0%
primitives/src 54% 0%
pallets/unified-accounts/src 79% 0%
pallets/astar-xcm-benchmarks/src/generic 100% 0%
Summary 74% (3744 / 5073) 0% (0 / 0)

Minimum allowed line rate is 50%

@ipapandinas ipapandinas merged commit 7b6a07d into master Jul 17, 2025
8 checks passed
@ipapandinas ipapandinas deleted the ci/try-state branch July 17, 2025 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci This PR/Issue is related to the topic "CI"

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants