-
Notifications
You must be signed in to change notification settings - Fork 10
Bump substrate to commit 7c63420 #110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
b8ffcd5
bump rust toolchain
haerdib 574fae3
cargo update -p pallet-teerex
haerdib 4208d69
update substrate & make node compile
haerdib c3b78d1
update hardcoded specs
haerdib 3803c71
revert .json changes
haerdib 23055c1
add scripts and regenerate hardcoded specs
haerdib 6578d30
bump spec_version to 7 and crate versions to 1.0.7
brenzi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| [toolchain] | ||
| channel = "nightly-2021-12-10" | ||
| channel = "nightly-2022-02-02" | ||
| targets = ["wasm32-unknown-unknown"] | ||
| profile = "default" # include rustfmt, clippy | ||
| profile = "default" # include rustfmt, clippy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Helper script to generate the wasm, state and chain-spec/ -raw.json for a given chain-spec. | ||
| # | ||
| # Usage: ./scripts/dump_wasm_state_and_spec.sh <chain-spec> <para-id> <collator-binary> <dump-dir> | ||
| # | ||
| # Example: ./scripts/dump_wasm_state_and_spec.sh shell-kusama-local-dev 2000 collator ./dump_dir | ||
| # | ||
| # chain-spec is mandatory, the rest is optional. | ||
|
|
||
|
|
||
| CHAIN_SPEC=$1 | ||
| COLLATOR=${2:-./target/release/encointer-collator} | ||
| DUMP_DIR=${3:-./chain_dumps} | ||
|
|
||
| mkdir -p ${DUMP_DIR} | ||
|
|
||
| echo "dumping spec for: $CHAIN_SPEC" | ||
| echo "collator: ${COLLATOR}" | ||
| echo "dump_dir: ${DUMP_DIR}" | ||
| echo "" | ||
|
|
||
| $COLLATOR build-spec --chain ${CHAIN_SPEC} >$DUMP_DIR/${CHAIN_SPEC}.json | ||
| $COLLATOR build-spec --chain ${CHAIN_SPEC} --raw >$DUMP_DIR/${CHAIN_SPEC}-raw-unsorted.json | ||
| jq --sort-keys . $DUMP_DIR/${CHAIN_SPEC}-raw-unsorted.json > $DUMP_DIR/${CHAIN_SPEC}-raw.json | ||
|
|
||
| $COLLATOR export-state --chain $DUMP_DIR/${CHAIN_SPEC}-raw.json >$DUMP_DIR/${CHAIN_SPEC}.state |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| #!/usr/bin/env python3 | ||
|
|
||
| """ | ||
| Simple script to upgrade the hardcoded chain-spec.json files. | ||
| This the main purpose is that to automate migration of values from the old files to the new files that can not | ||
| be inserted by the rust code, e.g., the `bootNodes`. | ||
| Usage: ./scripts/update_hardcoded_specs.py <--migrate-genesis> | ||
| Optionally define if the `genesis` field of the chain-spec should also be migrated. This field should be set as follows: | ||
| * True, if a completely new chain-spec shall be created. This will create a new genesis state, which is not compatible | ||
| with chains running on the old chain-spec. | ||
| * False, if we only want to change other fields that are relevant to the node (i.e., the client) only, but not | ||
| the runtime. For instance if we update the substrate/polkadot. | ||
| """ | ||
|
|
||
| import argparse | ||
| import json | ||
| import os | ||
| import subprocess | ||
|
|
||
| SPECS = [ | ||
| { | ||
| "chain_id": "cranny", | ||
| }, | ||
| { | ||
| "chain_id": "integritee-solo", | ||
| } | ||
| ] | ||
| COLLATOR = "target/release/integritee-node" | ||
| RES_DIR = "node/res" | ||
|
|
||
|
|
||
| def main(regenesis: bool): | ||
| for s in SPECS: | ||
| chain_spec = s["chain_id"] | ||
|
|
||
| ret = subprocess.call( | ||
| f'scripts/dump_wasm_state_and_spec.sh {chain_spec}-fresh {COLLATOR} {RES_DIR}', | ||
| stdout=subprocess.PIPE, | ||
| shell=True | ||
| ) | ||
|
|
||
| print(ret) | ||
|
|
||
| orig_file = f'{RES_DIR}/{chain_spec}.json' | ||
| new_file_base = f'{RES_DIR}/{chain_spec}-fresh' | ||
|
|
||
| with open(orig_file, 'r+') as spec_orig_file: | ||
| orig_json = json.load(spec_orig_file) | ||
|
|
||
| # migrate old values to new spec | ||
| with open(f'{new_file_base}.json', 'r+') as spec_new_file: | ||
| new_json = json.load(spec_new_file) | ||
|
|
||
| new_json["bootNodes"] = orig_json["bootNodes"] | ||
|
|
||
| if not regenesis: | ||
| new_json["genesis"] = orig_json["genesis"] | ||
|
|
||
| # go to beginning of the file to overwrite | ||
| spec_orig_file.seek(0) | ||
| json.dump(new_json, spec_orig_file, indent=2) | ||
| spec_orig_file.truncate() | ||
|
|
||
| # remove side-products | ||
| os.remove(f'{new_file_base}.json') | ||
| os.remove(f'{new_file_base}-raw.json') | ||
| os.remove(f'{new_file_base}-raw-unsorted.json') | ||
| os.remove(f'{new_file_base}.state') | ||
|
|
||
| if __name__ == '__main__': | ||
| parser = argparse.ArgumentParser() | ||
| parser.add_argument('--regenesis', help='Overwrite genesis state in chain spec. Use this for resetting chains entirely', action='store_true') | ||
|
|
||
| args = parser.parse_args() | ||
| print(f'Updating chain specs. Preserving bootnodes. (re-genesis == {args.regenesis})') | ||
|
|
||
| main(args.regenesis) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.