Skip to content

Commit e2477a2

Browse files
author
Konstantin Astakhov
committed
try main process workflow with dump
1 parent fa004e3 commit e2477a2

File tree

5 files changed

+87
-10
lines changed

5 files changed

+87
-10
lines changed

.baedeker/main-process.jsonnet

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
local
2+
m = import 'baedeker-library/mixin/spec.libsonnet',
3+
rm = import 'baedeker-library/mixin/raw-spec.libsonnet',
4+
;
5+
6+
function(relay_spec, forked_spec, dump_spec)
7+
8+
local relay = {
9+
name: 'relay',
10+
bin: 'bin/polkadot',
11+
validatorIdAssignment: 'staking',
12+
spec: {Genesis:{
13+
chain: relay_spec,
14+
modify:: m.genericRelay($),
15+
}},
16+
nodes: {
17+
[name]: {
18+
bin: $.bin,
19+
wantedKeys: 'relay',
20+
expectedDataPath: '/parity',
21+
},
22+
for name in ['alice', 'bob', 'charlie', 'dave', 'eve']
23+
},
24+
};
25+
26+
local unique = {
27+
name: 'unique',
28+
bin: 'bin/unique',
29+
paraId: 1001,
30+
spec: {Raw:{
31+
local modifyRaw = bdk.mixer([
32+
rm.resetNetworking($),
33+
rm.decodeSpec(),
34+
rm.polkaLaunchPara($),
35+
rm.reencodeSpec(),
36+
]),
37+
raw_spec: modifyRaw({
38+
name: "Unused",
39+
id: "%s_local" % forked_spec,
40+
bootNodes: error "override me",
41+
chainType: error "override me",
42+
telemetryEndpoints: error "override me",
43+
codeSubstitutes: error "override me",
44+
para_id: error "override me",
45+
relay_chain: "unused",
46+
genesis: {
47+
raw: {
48+
top: cql.fullDump(dump_spec),
49+
childrenDefault: {},
50+
},
51+
},
52+
}),
53+
}},
54+
nodes: {
55+
[name]: {
56+
bin: $.bin,
57+
wantedKeys: 'para',
58+
extraArgs: [
59+
'--increase-future-pool',
60+
'--pool-type=fork-aware',
61+
],
62+
},
63+
for name in ['alice', 'bob', 'charlie']
64+
},
65+
};
66+
67+
relay + {
68+
parachains: {
69+
[para.name]: para,
70+
for para in [unique]
71+
},
72+
}

.docker/Dockerfile-unique

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ARG FEATURES
99

1010
RUN cd unique-chain && \
1111
echo "Using runtime features ${FEATURES}" && \
12-
CARGO_INCREMENTAL=0; WASM_BUILD_TYPE=integration-tests; cargo build --profile integration-tests --features=fast-inflation,"${FEATURES}" --locked && \
12+
CARGO_INCREMENTAL=0 WASM_BUILD_TYPE=integration-tests cargo build --profile integration-tests --features=fast-inflation,"${FEATURES}" --locked && \
1313
mv ./target/integration-tests/unique-collator /workdir/unique-chain/ && \
1414
cd target/integration-tests/wbuild && find . -name "*.wasm" -exec sh -c 'mkdir -p "../../../wasm/$(dirname {})"; cp {} "../../../wasm/{}"' \;
1515

.docker/Dockerfile-unique-release

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ARG FEATURES
99

1010
RUN git clone -b "${CODE_VERSION}" https://github.com/uniquenetwork/unique-chain.git && \
1111
cd unique-chain && git switch "${CODE_HASH}" --detach && \
12-
CARGO_INCREMENTAL=0; cargo build --release --features="${FEATURES}" --locked && \
12+
CARGO_INCREMENTAL=0 cargo build --release --features="${FEATURES}" --locked && \
1313
mv ./target/release/unique-collator /workdir/unique-chain/ && \
1414
cd target/release/wbuild && find . -name "*.wasm" -exec sh -c 'mkdir -p "../../../wasm/$(dirname {})"; cp {} "../../../wasm/{}"' \;
1515

.github/workflows/main-process-update.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ jobs:
151151
- name: Setup library
152152
run: mkdir -p .baedeker/vendor/ && git clone https://github.com/UniqueNetwork/baedeker-library .baedeker/vendor/baedeker-library
153153

154+
- name: Get state from production
155+
run: |
156+
chainql -e 'cql.chain("${{ matrix.fork_source }}").latest._preloadKeys._raw' > .baedeker/vendor/dump.json
157+
154158
- name: Start network
155159
uses: UniqueNetwork/baedeker-action@v1-no-debug-output
156160
if: success()
@@ -161,9 +165,10 @@ jobs:
161165
tla-str: |
162166
relay_spec=${{ env.RELAY_CHAIN_TYPE }}-local
163167
forked_spec=${{ matrix.network }}
164-
fork_source=${{ matrix.fork_source }}
168+
tla-code: |
169+
dump_spec=import 'dump.json'
165170
inputs: |
166-
.baedeker/forkless-data.jsonnet
171+
.baedeker/main-process.jsonnet
167172
snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadot':{dockerImage:'${{ steps.polkadot.outputs.image }}:${{ steps.polkadot.outputs.tag }}'}})
168173
# with data build uses old runtime, but new node, thus we use mainnet image for spec generation, and then target image for nodes.
169174
# snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.node.outputs.name }}'}}, extra_node_mixin={extraArgs: []}, for_chain = false)
@@ -179,7 +184,7 @@ jobs:
179184
env:
180185
RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}
181186

182-
- name: "Reconcile: all nodes are updated"
187+
- name: "Reconcile: nodes updating"
183188
if: ${{ !cancelled() && steps.alive1.outcome == 'success' }}
184189
id: reconcile1
185190
uses: UniqueNetwork/baedeker-action/reconcile@v1-no-debug-output
@@ -200,7 +205,7 @@ jobs:
200205
env:
201206
RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}
202207

203-
- name: "Reconcile: runtime is upgraded"
208+
- name: "Reconcile: runtime updating"
204209
working-directory: js-packages/tests
205210
id: reconcile2
206211
if: ${{ !cancelled() && steps.alive2.outcome == 'success' }}

.github/workflows/xcm.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ jobs:
259259
reporter: mochawesome-json
260260
fail-on-error: 'false'
261261

262-
# - name: Remove builder cache
263-
# if: always()
264-
# run: |
265-
# docker system prune -a -f
262+
- name: Remove builder cache
263+
if: always()
264+
run: |
265+
docker system prune -a -f

0 commit comments

Comments
 (0)