diff --git a/.github/ISSUE_TEMPLATE/release.md b/.github/ISSUE_TEMPLATE/release.md index 4254103f9..4c1b44ba2 100644 --- a/.github/ISSUE_TEMPLATE/release.md +++ b/.github/ISSUE_TEMPLATE/release.md @@ -35,6 +35,7 @@ These checks should be performed on the codebase prior to freezing our release c - [ ] Check that build artifacts have been added to the draft-release - [ ] Promote the draft to a Pre-Release on github - [ ] If there's any new extrinsic or pallet introduced, please add it to [runtime/calamari/src/diff_tx_fees.rs](../../runtime/calamari/src/diff_tx_fees.rs), then follow [tx-fees-data/README](../../runtime/calamari/tx-fees-data/README.md) to generate a new tx fees sheet. + - [ ] Do runtime upgrade by [chopstick](../../chop/). # Deploy to internal testnets ( fast runtime ) diff --git a/chop/.env b/chop/.env new file mode 100644 index 000000000..269c2561f --- /dev/null +++ b/chop/.env @@ -0,0 +1,4 @@ +POLKADOT_BLOCK_NUMBER= +MANTA_BLOCK_NUMBER= +# LOG_LEVEL="debug" +# VERBOSE_LOG=true \ No newline at end of file diff --git a/chop/README.md b/chop/README.md new file mode 100644 index 000000000..e51113e3b --- /dev/null +++ b/chop/README.md @@ -0,0 +1,30 @@ +## Do runtime upgrade by chopsticks + +- chopsticks: https://github.com/AcalaNetwork/chopsticks +- manta config: [manta](./manta.yml), which configure Alice as sudo account. +- polkadot config: [polkadot](./polkadot.yml) + +1. Update the recent block number for polkadot and manta. +``` +POLKADOT_BLOCK_NUMBER= +MANTA_BLOCK_NUMBER= +``` + +2. Start both forked chains with chopsticks +``` +npx @acala-network/chopsticks@latest xcm --r=polkadot.yml --p=manta.yml +``` +manta will take port `8000`, and ``8001` for polkadot by default. + +3. Please authorize runtime upgrade first on manta chain. +![authorize](./pics/authorize.png) + +4. Then enact runtime upgrade +![enact](./pics/enact.png) + +5. Advance some blocks on manta and polkadot chain by this scripts +``` +cd tests +yarn advance-blocks +``` +Ideally, you will see runtime upgraded event, that means the upgrade will have been finished. diff --git a/chop/manta.yml b/chop/manta.yml new file mode 100644 index 000000000..b862ee2dd --- /dev/null +++ b/chop/manta.yml @@ -0,0 +1,21 @@ +endpoint: wss://ws.manta.systems +mock-signature-host: true +block: ${env.MANTA_BLOCK_NUMBER} +db: ./db.sqlite + +import-storage: + Sudo: + Key: dfbMFtQXqiKHH4d2y4CFcVQCpopqKcaEiYv2DCUpVCphoz8kB # Alice + System: + Account: + - + - + - dfbMFtQXqiKHH4d2y4CFcVQCpopqKcaEiYv2DCUpVCphoz8kB # Alice + - data: + free: "100000000000000000000000" + ParachainStaking: + # NOTE: MANTA_BLOCK_NUMBER should set to 2170792 in .env file. + # If you change the block number, you need to also change here. + # The value should be `authorInherent.author` storage \ + # correspond to your block number. + SelectedCandidates: [dfbE3LfJAvdnNWBQmNv9bBUW3ieAjwijWZYRXx26uK3o2gTJZ] diff --git a/chop/pics/authorize.png b/chop/pics/authorize.png new file mode 100644 index 000000000..37c24aae0 Binary files /dev/null and b/chop/pics/authorize.png differ diff --git a/chop/pics/enact.png b/chop/pics/enact.png new file mode 100644 index 000000000..20c5ea970 Binary files /dev/null and b/chop/pics/enact.png differ diff --git a/chop/polkadot.yml b/chop/polkadot.yml new file mode 100644 index 000000000..0b329c0ee --- /dev/null +++ b/chop/polkadot.yml @@ -0,0 +1,19 @@ +endpoint: + - wss://rpc.ibp.network/polkadot + - wss://polkadot-rpc.dwellir.com +mock-signature-host: true +block: ${env.POLKADOT_BLOCK_NUMBER} +db: ./db.sqlite +# wasm-override: polkadot_runtime.compact.compressed.wasm + +import-storage: + System: + Account: + - + - + - 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY + - providers: 1 + data: + free: '10000000000000000000' + ParasDisputes: + $removePrefix: ['disputes'] # those can makes block building super slow diff --git a/tests/advance-blocks.ts b/tests/advance-blocks.ts new file mode 100644 index 000000000..eba37b648 --- /dev/null +++ b/tests/advance-blocks.ts @@ -0,0 +1,35 @@ +import { ApiPromise, WsProvider } from '@polkadot/api'; +import '@polkadot/api-augment'; + +async function createPromiseApi(nodeAddress: string) { + const wsProvider = new WsProvider(nodeAddress); + + const api = new ApiPromise({ + provider: wsProvider, + }); + await api.isReady; + console.log(`${nodeAddress} has been started`); + return api; +} + +async function delay(ms: number) { + return new Promise((resolve) => setTimeout(resolve, ms)); +} + +async function advance() { + const mantaEndpoint = 'ws://127.0.0.1:8000'; + const dotEndpoint = 'ws://127.0.0.1:8001'; + const mantaApi = await createPromiseApi(mantaEndpoint); + const dotApi = await createPromiseApi(dotEndpoint); + await mantaApi.rpc('dev_newBlock', { count: 30 }); + await dotApi.rpc('dev_newBlock', { count: 60 }); + await mantaApi.disconnect(); + await dotApi.disconnect(); +} + +async function main() { + await advance(); + } + + main().catch(console.error); + \ No newline at end of file