Skip to content

Commit 5ea7112

Browse files
committed
Add initial support for smoldot
1 parent a1a0042 commit 5ea7112

File tree

14 files changed

+534
-7
lines changed

14 files changed

+534
-7
lines changed

.github/workflows/nightly.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,47 @@ jobs:
2020
- id: set_image
2121
run: echo "IMAGE=${{ env.IMAGE }}" >> $GITHUB_OUTPUT
2222

23+
smoldot-connectivity-test:
24+
name: Smoldot connectivity test (Westend Asset Hub)
25+
runs-on: parity-large
26+
needs: [set-image]
27+
container: ${{ needs.set-image.outputs.IMAGE }}
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v6
31+
32+
- name: Cache Rust dependencies
33+
uses: swatinem/rust-cache@v2
34+
with:
35+
key: ${{ runner.os }}-rust-staking-miner-${{ hashFiles('**/Cargo.lock') }}
36+
cache-on-failure: true
37+
38+
- name: Build staking-miner
39+
run: |
40+
echo "🔧 Building staking-miner..."
41+
cargo build --release
42+
43+
- name: Test smoldot connectivity to Westend Asset Hub
44+
run: |
45+
echo "🔗 Testing smoldot connectivity to Westend Asset Hub..."
46+
echo "Note: Initial sync may take a few minutes..."
47+
48+
# Run the info command with smoldot to verify connectivity
49+
# Use timeout to prevent hanging indefinitely (10 minutes should be enough for initial sync)
50+
timeout 600 ./target/release/polkadot-staking-miner --smoldot westend info
51+
52+
echo "✅ Smoldot connectivity test passed!"
53+
54+
- name: Notify smoldot test failure
55+
if: failure()
56+
uses: s3krit/matrix-message-action@70ad3fb812ee0e45ff8999d6af11cafad11a6ecf # v0.0.3
57+
with:
58+
room_id: "!tXyUlsDAYvDfRKbzKx:parity.io"
59+
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
60+
server: m.parity.io
61+
message: |
62+
@room Smoldot connectivity test failed https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks/${{ github.run_id }}
63+
2364
nightly-test:
2465
runs-on: parity-large
2566
needs: [set-image]

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ pin-project-lite = "0.2"
3131

3232
# subxt
3333
scale-value = "0.18"
34-
subxt = { version = "0.44.0", features = ["reconnecting-rpc-client"] }
34+
subxt = { version = "0.44.0", features = ["reconnecting-rpc-client", "unstable-light-client"] }
35+
subxt-lightclient = { version = "0.44.0", features = ["native"] }
3536
subxt-rpcs = "0.44.0"
3637

3738

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,37 @@ You can check the help with:
124124
polkadot-staking-miner --help
125125
```
126126

127+
### Connection Options
128+
129+
The staking miner supports two ways to connect to the network:
130+
131+
#### WebSocket RPC (default)
132+
133+
Connect to a specific RPC node using `--uri`:
134+
135+
```bash
136+
polkadot-staking-miner --uri wss://asset-hub-polkadot-rpc.polkadot.io monitor --seed-or-path //Alice
137+
```
138+
139+
#### Smoldot Light Client
140+
141+
Connect using the embedded smoldot light client with `--smoldot`:
142+
143+
```bash
144+
polkadot-staking-miner --smoldot polkadot monitor --seed-or-path //Alice
145+
```
146+
147+
Available networks: `polkadot`, `kusama`, `westend`
148+
149+
**Benefits of smoldot:**
150+
151+
- **Trustless operation**: Verifies proofs directly instead of trusting an RPC node
152+
- **Self-healing**: Automatically handles peer disconnections and reconnections
153+
- **No RPC dependency**: Works without relying on any specific RPC endpoint
154+
155+
**Note:** Initial sync may take a few minutes as smoldot needs to sync with the relay chain before
156+
it can validate parachain blocks. The `--uri` and `--smoldot` options are mutually exclusive.
157+
127158
### Info command
128159

129160
Check remote node's metadata.

chainspecs/kusama.json

Lines changed: 58 additions & 0 deletions
Large diffs are not rendered by default.

chainspecs/kusama_asset_hub.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "Statemine",
3+
"id": "statemine",
4+
"chainType": "Live",
5+
"bootNodes": [
6+
"/dns/kusama-asset-hub-connect-0.polkadot.io/tcp/30334/p2p/12D3KooWMzvdGcUXxacLdMQzRVrsP1mJrZHcrz8LtGbhLzve84Qx",
7+
"/dns/kusama-asset-hub-connect-0.polkadot.io/tcp/443/wss/p2p/12D3KooWMzvdGcUXxacLdMQzRVrsP1mJrZHcrz8LtGbhLzve84Qx",
8+
"/dns/kusama-asset-hub-connect-1.polkadot.io/tcp/30334/p2p/12D3KooWQmGf5z3DU1kKcZoLzMNgdbP31ybjuwxS1VGLKMUjq5ez",
9+
"/dns/kusama-asset-hub-connect-1.polkadot.io/tcp/443/wss/p2p/12D3KooWQmGf5z3DU1kKcZoLzMNgdbP31ybjuwxS1VGLKMUjq5ez",
10+
"/dns/boot.stake.plus/tcp/34333/p2p/12D3KooWAzSSZ7jLqMw1WPomYEKCYANQaKemXQ8BKoFvNEvfmdqR",
11+
"/dns/boot.stake.plus/tcp/34334/wss/p2p/12D3KooWAzSSZ7jLqMw1WPomYEKCYANQaKemXQ8BKoFvNEvfmdqR",
12+
"/dns/boot.metaspan.io/tcp/26052/p2p/12D3KooW9z9hKqe3mqYAp5UJMhZiCqhkTHyiR43fegnGmTJ3JAba",
13+
"/dns/boot.metaspan.io/tcp/26056/wss/p2p/12D3KooW9z9hKqe3mqYAp5UJMhZiCqhkTHyiR43fegnGmTJ3JAba",
14+
"/dns/boot-cr.gatotech.network/tcp/33210/p2p/12D3KooWRMUYeWMPkadDG8baX9j1e95fspfp8MhPGym5BQza7Fm5",
15+
"/dns/boot-cr.gatotech.network/tcp/35210/wss/p2p/12D3KooWRMUYeWMPkadDG8baX9j1e95fspfp8MhPGym5BQza7Fm5",
16+
"/dns/statemine-bootnode.turboflakes.io/tcp/30320/p2p/12D3KooWN2Qqvp5wWgjbBMpbqhKgvSibSHfomP5VWVD9VCn3VrV4",
17+
"/dns/statemine-bootnode.turboflakes.io/tcp/30420/wss/p2p/12D3KooWN2Qqvp5wWgjbBMpbqhKgvSibSHfomP5VWVD9VCn3VrV4",
18+
"/dns/boot-node.helikon.io/tcp/10210/p2p/12D3KooWFXRQce3aMgZMn5SxvHtYH4PsR63TZLf8LrnBsEVTyzdr",
19+
"/dns/boot-node.helikon.io/tcp/10212/wss/p2p/12D3KooWFXRQce3aMgZMn5SxvHtYH4PsR63TZLf8LrnBsEVTyzdr",
20+
"/dns/statemine.bootnode.amforc.com/tcp/30336/p2p/12D3KooWHmSyrBWsc6fdpq8HtCFWasmLVLYGKWA2a78m4xAHKyBq",
21+
"/dns/statemine.bootnode.amforc.com/tcp/30333/wss/p2p/12D3KooWHmSyrBWsc6fdpq8HtCFWasmLVLYGKWA2a78m4xAHKyBq",
22+
"/dns/statemine-boot-ng.dwellir.com/tcp/30343/p2p/12D3KooWQNJKBaNfW6Nn7HZDi5pSSEFmHL2Qz7chr9RksQUDR1Wk",
23+
"/dns/statemine-boot-ng.dwellir.com/tcp/443/wss/p2p/12D3KooWQNJKBaNfW6Nn7HZDi5pSSEFmHL2Qz7chr9RksQUDR1Wk",
24+
"/dns/statemine-bootnode.radiumblock.com/tcp/30333/p2p/12D3KooWCKUrE5uaXQ288ko3Ex3zCyozyJLG47KEYTopinnXNtYL",
25+
"/dns/statemine-bootnode.radiumblock.com/tcp/30336/wss/p2p/12D3KooWCKUrE5uaXQ288ko3Ex3zCyozyJLG47KEYTopinnXNtYL"
26+
],
27+
"protocolId": null,
28+
"properties": {
29+
"tokenDecimals": 12,
30+
"tokenSymbol": "KSM"
31+
},
32+
"relay_chain": "ksmcc3",
33+
"para_id": 1000,
34+
"consensusEngine": null,
35+
"lightSyncState": null,
36+
"genesis": {
37+
"stateRootHash": "0x299ac939ea4722d1fcf7f4873675040ebc83d144620c76206dbeb7468cf30cdf"
38+
}
39+
}

chainspecs/polkadot.json

Lines changed: 57 additions & 0 deletions
Large diffs are not rendered by default.

chainspecs/polkadot_asset_hub.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "Polkadot Asset Hub",
3+
"id": "asset-hub-polkadot",
4+
"chainType": "Live",
5+
"bootNodes": [
6+
"/dns/polkadot-asset-hub-connect-0.polkadot.io/tcp/30334/p2p/12D3KooWLHqbcQtoBygf7GJgVjVa3TaeLuf7VbicNdooaCmQM2JZ",
7+
"/dns/polkadot-asset-hub-connect-0.polkadot.io/tcp/443/wss/p2p/12D3KooWLHqbcQtoBygf7GJgVjVa3TaeLuf7VbicNdooaCmQM2JZ",
8+
"/dns/polkadot-asset-hub-connect-1.polkadot.io/tcp/30334/p2p/12D3KooWNDrKSayoZXGGE2dRSFW2g1iGPq3fTZE2U39ma9yZGKd3",
9+
"/dns/polkadot-asset-hub-connect-1.polkadot.io/tcp/443/wss/p2p/12D3KooWNDrKSayoZXGGE2dRSFW2g1iGPq3fTZE2U39ma9yZGKd3",
10+
"/dns/boot.stake.plus/tcp/35333/p2p/12D3KooWFrQjYaPZSSLLxEVmoaHFcrF6VoY4awG4KRSLaqy3JCdQ",
11+
"/dns/boot.stake.plus/tcp/35334/wss/p2p/12D3KooWFrQjYaPZSSLLxEVmoaHFcrF6VoY4awG4KRSLaqy3JCdQ",
12+
"/dns/boot.metaspan.io/tcp/16052/p2p/12D3KooWLwiJuvqQUB4kYaSjLenFKH9dWZhGZ4qi7pSb3sUYU651",
13+
"/dns/boot.metaspan.io/tcp/16056/wss/p2p/12D3KooWLwiJuvqQUB4kYaSjLenFKH9dWZhGZ4qi7pSb3sUYU651",
14+
"/dns/boot-cr.gatotech.network/tcp/33110/p2p/12D3KooWKgwQfAeDoJARdtxFNNWfbYmcu6s4yUuSifnNoDgzHZgm",
15+
"/dns/boot-cr.gatotech.network/tcp/35110/wss/p2p/12D3KooWKgwQfAeDoJARdtxFNNWfbYmcu6s4yUuSifnNoDgzHZgm",
16+
"/dns/statemint-bootnode.turboflakes.io/tcp/30315/p2p/12D3KooWL8CyLww3m3pRySQGGYGNJhWDMqko3j5xi67ckP7hDUvo",
17+
"/dns/statemint-bootnode.turboflakes.io/tcp/30415/wss/p2p/12D3KooWL8CyLww3m3pRySQGGYGNJhWDMqko3j5xi67ckP7hDUvo",
18+
"/dns/boot-node.helikon.io/tcp/10220/p2p/12D3KooW9uybhguhDjVJc3U3kgZC3i8rWmAnSpbnJkmuR7C6ZsRW",
19+
"/dns/boot-node.helikon.io/tcp/10222/wss/p2p/12D3KooW9uybhguhDjVJc3U3kgZC3i8rWmAnSpbnJkmuR7C6ZsRW",
20+
"/dns/statemint.bootnode.amforc.com/tcp/30341/p2p/12D3KooWByohP9FXn7ao8syS167qJsbFdpa7fY2Y24xbKtt3r7Ls",
21+
"/dns/statemint.bootnode.amforc.com/tcp/30333/wss/p2p/12D3KooWByohP9FXn7ao8syS167qJsbFdpa7fY2Y24xbKtt3r7Ls",
22+
"/dns/statemint-boot-ng.dwellir.com/tcp/30344/p2p/12D3KooWEFrNuNk8fPdQS2hf34Gmqi6dGSvrETshGJUrqrvfRDZr",
23+
"/dns/statemint-boot-ng.dwellir.com/tcp/443/wss/p2p/12D3KooWEFrNuNk8fPdQS2hf34Gmqi6dGSvrETshGJUrqrvfRDZr",
24+
"/dns/statemint-bootnode.radiumblock.com/tcp/30336/wss/p2p/12D3KooWLKxHom7f3XawRJqrF8RwiKK5Sj3qZqz5c7hF6eJeXhTx",
25+
"/dns/statemint-bootnode.radiumblock.com/tcp/30333/p2p/12D3KooWLKxHom7f3XawRJqrF8RwiKK5Sj3qZqz5c7hF6eJeXhTx"
26+
],
27+
"protocolId": null,
28+
"properties": {
29+
"ss58Format": 0,
30+
"tokenDecimals": 10,
31+
"tokenSymbol": "DOT"
32+
},
33+
"relay_chain": "polkadot",
34+
"para_id": 1000,
35+
"consensusEngine": null,
36+
"codeSubstitutes": {},
37+
"genesis": {
38+
"stateRootHash": "0xc1ef26b567de07159e4ecd415fbbb0340c56a09c4d72c82516d0f3bc2b782c80"
39+
}
40+
}

chainspecs/westend.json

Lines changed: 54 additions & 0 deletions
Large diffs are not rendered by default.

chainspecs/westend_asset_hub.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "Westmint",
3+
"id": "westmint",
4+
"chainType": "Live",
5+
"bootNodes": [
6+
"/ip4/35.204.21.205/tcp/30334/p2p/12D3KooWLjaXWhNTSiRVFbTJCKLRWt9XXHLGVnAFtxvnExKkVPqn",
7+
"/ip4/35.204.21.205/tcp/30344/ws/p2p/12D3KooWLjaXWhNTSiRVFbTJCKLRWt9XXHLGVnAFtxvnExKkVPqn",
8+
"/ip4/34.141.171.170/tcp/30334/p2p/12D3KooWBNy2Jdrjv2P7sdfb1mzH1AGzwjip5rW4N2Ft1T3Hdq5c",
9+
"/ip4/34.141.171.170/tcp/30344/ws/p2p/12D3KooWBNy2Jdrjv2P7sdfb1mzH1AGzwjip5rW4N2Ft1T3Hdq5c",
10+
"/ip4/34.141.221.252/tcp/30334/p2p/12D3KooWC9YYdjQLwxTNVda6t4nmjAZG37gaRZLNi4Zuhr9xUveW",
11+
"/ip4/34.141.221.252/tcp/30344/ws/p2p/12D3KooWC9YYdjQLwxTNVda6t4nmjAZG37gaRZLNi4Zuhr9xUveW",
12+
"/ip4/34.90.92.174/tcp/30334/p2p/12D3KooWQcXpUyVqwC2zJkwECCC7ttLCUCLTjnbGxTVfhSgmH2sD",
13+
"/ip4/34.90.92.174/tcp/30344/ws/p2p/12D3KooWQcXpUyVqwC2zJkwECCC7ttLCUCLTjnbGxTVfhSgmH2sD"
14+
],
15+
"protocolId": null,
16+
"relay_chain": "westend2",
17+
"properties": {
18+
"tokenDecimals": 12,
19+
"tokenSymbol": "WND"
20+
},
21+
"para_id": 1000,
22+
"consensusEngine": null,
23+
"lightSyncState": null,
24+
"genesis": {
25+
"stateRootHash": "0x1d0ce8ef6a9eef1685c4715925cf91ed1af635a752eac4f9945b1a1a4e2b6e51"
26+
}
27+
}

0 commit comments

Comments
 (0)