Skip to content

Commit

Permalink
chore: 1.6.0 runtime (#344)
Browse files Browse the repository at this point in the history
* Adds two more relaychain bootnodes for staging environment  (#334)

* Adds two more bootnodes for staging environment closes #1864

* Fixes staging parachain bootNodes

(cherry picked from commit 73097ff)

* ci: use caching

(cherry picked from commit aafb1a9)

* chore: reset peregrine stg (#335)

* reset peregrine stg

* delete tmp files

(cherry picked from commit f27917c)

* chore: minor peregrine-stg fix

(cherry picked from commit c2819c9)

* fix: swapped ed & sr keys

(cherry picked from commit dcb7afa)

* fix: peregrine-stg bootnodes

(cherry picked from commit 30b1cfa)

* fix: peregrine-stg parachain nodes

(cherry picked from commit 896f01a)

* fix: peregrine-stg node identity

(cherry picked from commit b84dbda)

* ci: use custom ci image (#336)

* switch to own ci image

skipping one step should speed up the build

* add ci dockerfile

* add tag

(cherry picked from commit e999bfb)

* Optimizes docker layer (#337)

* Adds copy all files in a sigle layer command

* Removes unused docker layer

* Changes debian image to ubuntu

Co-authored-by: Albrecht <[email protected]>
(cherry picked from commit 76025b1)

* chore: update toolchain version to nightly 1.59 (#339)

* chore: bump up toolchain to nightly 1.59

* chore: address Clippy warnings

(cherry picked from commit 80182c5)

* fix: add did lookup pallet to DID authorization logic + reverse lookup index (#343)

* fix: add did lookup pallet to DID authorization logic

* test: add unit tests for spiritnet and peregrine runtimes for correct DID verification key derivation

* chore: clippy

* feat: add additional map for reverse index

* test: add unit tests

* chore: update benchmarks checks

* wip: runtime upgrade scripts

* wip: lookup pallet migration

* chore: update toolchain version to nightly 1.59 (#339)

* chore: bump up toolchain to nightly 1.59

* chore: address Clippy warnings

* wip: benchmarks

* bench: benchmark compiling

* chore: try-runtime complete

* chore: update deps

* chore: add migrations to Spiritnet runtime

* chore: add comment in lookup migration

* chore: move migration into lookup pallet

* fix: add try-runtime feature to did lookup crate

* chore: fixes after rebase

* chore: fmt

* chore: ConnectedAccounts map comment

* cargo run --quiet --release -p kilt-parachain --features=runtime-benchmarks -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet-did-lookup --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=pallets/pallet-did-lookup/src/default_weights.rs --template=.maintain/weight-template.hbs

* cargo run --quiet --release -p kilt-parachain --features=runtime-benchmarks -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet-did-lookup --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./runtimes/peregrine/src/weights/pallet_did-lookup.rs --template=.maintain/runtime-weight-template.hbs

* cargo run --quiet --release -p kilt-parachain --features=runtime-benchmarks -- benchmark --chain=spiritnet-dev --steps=50 --repeat=20 --pallet=pallet-did-lookup --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./runtimes/spiritnet/src/weights/pallet_did-lookup.rs --template=.maintain/runtime-weight-template.hbs

* bench: update benchmarks to include account replacement as worst case

* bench: fix InsufficientFunds error in benchmarks

* chore: fmt

* cargo run --quiet --release -p kilt-parachain --features=runtime-benchmarks -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet-did-lookup --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=pallets/pallet-did-lookup/src/default_weights.rs --template=.maintain/weight-template.hbs

* chore: update comments

* cargo run --quiet --release -p kilt-parachain --features=runtime-benchmarks -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet-did-lookup --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./runtimes/peregrine/src/weights/pallet_did-lookup.rs --template=.maintain/runtime-weight-template.hbs

* cargo run --quiet --release -p kilt-parachain --features=runtime-benchmarks -- benchmark --chain=spiritnet-dev --steps=50 --repeat=20 --pallet=pallet-did-lookup --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./runtimes/spiritnet/src/weights/pallet_did-lookup.rs --template=.maintain/runtime-weight-template.hbs

Co-authored-by: kiltbot <>
(cherry picked from commit ff34f86)

* feat: proxy type for disableling deposit claiming (#341)

* proxy type for disableling deposit claiming

* fix

* fix: explicit proxy pallet logic for peregrine runtime

* fix: finalise proxy definition for spiritnet

* chore: add explicit encoding value for proxy types

* chore: update mashnet-node with similar proxy structure as peregrine

* chore: clippy

* cargo run --quiet --release -p kilt-parachain --features=runtime-benchmarks -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet-proxy --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./runtimes/peregrine/src/weights/pallet_proxy.rs --template=.maintain/runtime-weight-template.hbs

* cargo run --quiet --release -p kilt-parachain --features=runtime-benchmarks -- benchmark --chain=spiritnet-dev --steps=50 --repeat=20 --pallet=pallet-proxy --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./runtimes/spiritnet/src/weights/pallet_proxy.rs --template=.maintain/runtime-weight-template.hbs

Co-authored-by: Antonio Antonino <[email protected]>
Co-authored-by: kiltbot <>
(cherry picked from commit a402710)

* fix: pallet_did_lookup weights filename

* chore: bump pallet and runtime versions

Co-authored-by: Gerawork Aynekulu <[email protected]>
Co-authored-by: weichweich <[email protected]>
  • Loading branch information
3 people authored Mar 25, 2022
1 parent 8ab23e3 commit d23a1bc
Show file tree
Hide file tree
Showing 46 changed files with 2,106 additions and 1,560 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
.github
.gitignore
.gitlab-ci.yml
.rustfmt.toml
**/.maintain*
**/target*
**/*.rs.bk
*.iml
Expand Down
3 changes: 1 addition & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test-features:

build:
image:
name: amazon/aws-cli:2.2.38
name: kiltprotocol/kilt-ci:2.2.38
entrypoint: [""]
stage: build
only:
Expand All @@ -46,7 +46,6 @@ build:
DOCKER_HUB_PARACHAIN: "kiltprotocol/kilt-node"
DOCKER_HUB_STANDALONE: "kiltprotocol/mashnet-node"
before_script:
- amazon-linux-extras install docker
- aws --version
- docker --version
script:
Expand Down
21 changes: 19 additions & 2 deletions .maintain/build-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@

target_tag=$1

docker build \
--target builder \
--cache-from $AWS_REGISTRY/kilt-parachain/collator:builder \
-t $AWS_REGISTRY/kilt-parachain/collator:builder \
.
docker push $AWS_REGISTRY/kilt-parachain/collator:builder

# build parachain image and standalone image
docker build --cache-from $AWS_REGISTRY/kilt-parachain/collator:$target_tag --build-arg NODE_TYPE=kilt-parachain -t local/kilt-node:$target_tag .
docker build --cache-from $AWS_REGISTRY/kilt/prototype-chain:$target_tag --build-arg NODE_TYPE=mashnet-node -t local/mashnet-node:$target_tag .
docker build \
--cache-from $AWS_REGISTRY/kilt-parachain/collator:builder \
--cache-from $AWS_REGISTRY/kilt-parachain/collator:$target_tag \
--build-arg NODE_TYPE=kilt-parachain \
-t local/kilt-node:$target_tag \
.
docker build \
--cache-from $AWS_REGISTRY/kilt-parachain/collator:builder \
--cache-from $AWS_REGISTRY/kilt/prototype-chain:$target_tag \
--build-arg NODE_TYPE=mashnet-node \
-t local/mashnet-node:$target_tag \
.
3 changes: 3 additions & 0 deletions .maintain/ci.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM amazon/aws-cli:2.2.38

RUN amazon-linux-extras install docker
82 changes: 47 additions & 35 deletions .maintain/reset-spec/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import typing
import logging
import tempfile
import shutil

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -45,6 +46,8 @@ def run_check_process(cmd: typing.List[str]):
def make_custom_spec(tmp_dir, docker_img, plain_file, out_file, update_spec, spec, runtime=None):
"""Build a custom spec by exporting a chain spec and customize it using a python script.
"""
logger.debug("using directory '%s'", tmp_dir)

cmd_plain_spec = base_docker_run_cmd() + [docker_img, "build-spec",
"--chain", spec, "--disable-default-bootnode"]

Expand All @@ -55,6 +58,12 @@ def make_custom_spec(tmp_dir, docker_img, plain_file, out_file, update_spec, spe

in_json = json.loads(process.stdout)

if args.debug:
with tempfile.NamedTemporaryFile(mode="w", encoding="utf-8", suffix=".json", delete=False) as tf:
json.dump(in_json, tf, indent=" ")
tf_name = tf.name
logger.debug("Writing unmodified spec to '%s'", tf_name)

try:
update_spec(in_json)
except KeyError as e:
Expand Down Expand Up @@ -117,17 +126,17 @@ def make_native(docker_img, out_file, chain, runtime):
import peregrine_stg_kilt
import peregrine_stg_relay

logging.basicConfig(format='%(asctime)s:%(levelname)s: %(message)s',
datefmt='%m-%d-%Y %H:%M:%S', level=logging.DEBUG)
logging.basicConfig(format="%(asctime)s:%(levelname)s: %(message)s",
datefmt="%m-%d-%Y %H:%M:%S", level=logging.DEBUG)

parser = argparse.ArgumentParser(
description=("Reset the chainspec for our networks."
"VERIFY THAT THE SPEC IS CORRECT AFTER USE!!"
"Make sure that the current directory is the project root."),
epilog="")
parser.add_argument('-v', '--verbose', action='count', default=0)
# parser.add_argument('-d', '--debug', action='store_true',
# default=False, help="enable debug mode, don't delete tmp files.")
parser.add_argument("-v", "--verbose", action="count", default=0)
parser.add_argument("-d", "--debug", action="store_true", dest="debug",
default=False, help="enable debug mode, don't delete tmp files.")

parser.add_argument("--image", "-i", dest="image", required=True,
help="docker image to use for building chain spec")
Expand Down Expand Up @@ -167,43 +176,46 @@ def make_native(docker_img, out_file, chain, runtime):
make_native(args.image, SPIRITNET_KILT, "spiritnet-new", "spiritnet")

if args.peregrine:
with tempfile.TemporaryDirectory() as tmpdirname:
make_custom_spec(
tmpdirname, args.image, "peregrine_kilt.plain.json",
PERE_KILT, peregrine_kilt.update_spec, "peregrine-new", "peregrine"
)
tmpdirname = tempfile.mkdtemp(suffix="peregrine")
make_custom_spec(
tmpdirname, args.image, "peregrine_kilt.plain.json",
PERE_KILT, peregrine_kilt.update_spec, "peregrine-new", "peregrine"
)

if args.peregrine_relay:
with tempfile.TemporaryDirectory() as tmpdirname:
make_custom_spec(
tmpdirname, args.image, "peregrine_relay.plain.json",
PERE_RELAY, peregrine_relay.update_spec, "westend-local"
)
tmpdirname = tempfile.mkdtemp(suffix="peregrine_relay")
make_custom_spec(
tmpdirname, args.image, "peregrine_relay.plain.json",
PERE_RELAY, peregrine_relay.update_spec, "westend-local"
)

if args.peregrine_dev:
with tempfile.TemporaryDirectory() as tmpdirname:
make_custom_spec(
tmpdirname, args.image, "peregrine_dev_kilt.plain.json",
PERE_DEV_KILT, peregrine_dev_kilt.update_spec, "peregrine-new", "peregrine"
)
tmpdirname = tempfile.mkdtemp(suffix="peregrine_dev")
make_custom_spec(
tmpdirname, args.image, "peregrine_dev_kilt.plain.json",
PERE_DEV_KILT, peregrine_dev_kilt.update_spec, "peregrine-new", "peregrine"
)

if args.peregrine_relay_dev:
with tempfile.TemporaryDirectory() as tmpdirname:
make_custom_spec(
tmpdirname, args.image, "peregrine_dev_relay.plain.json",
PERE_DEV_RELAY, peregrine_dev_relay.update_spec, "westend-local"
)
tmpdirname = tempfile.mkdtemp(suffix="peregrine_relay_dev")
make_custom_spec(
tmpdirname, args.image, "peregrine_dev_relay.plain.json",
PERE_DEV_RELAY, peregrine_dev_relay.update_spec, "westend-local"
)

if args.peregrine_stg:
with tempfile.TemporaryDirectory() as tmpdirname:
make_custom_spec(
tmpdirname, args.image, "peregrine_stg.plain.json",
PERE_STG_KILT, peregrine_stg_kilt.update_spec, "peregrine-new", "peregrine"
)
tmpdirname = tempfile.mkdtemp(suffix="peregrine_stg")
make_custom_spec(
tmpdirname, args.image, "peregrine_stg.plain.json",
PERE_STG_KILT, peregrine_stg_kilt.update_spec, "peregrine-new", "peregrine"
)

if args.peregrine_relay_stg:
with tempfile.TemporaryDirectory() as tmpdirname:
make_custom_spec(
tmpdirname, args.image, "peregrine_stg_relay.plain.json",
PERE_STG_RELAY, peregrine_stg_relay.update_spec, "westend-local"
)
tmpdirname = tempfile.mkdtemp(suffix="peregrine_relay_stg")
make_custom_spec(
tmpdirname, args.image, "peregrine_stg_relay.plain.json",
PERE_STG_RELAY, peregrine_stg_relay.update_spec, "westend-local"
)

if tmpdirname is not None and not args.debug:
shutil.rmtree(tmpdirname)
2 changes: 1 addition & 1 deletion .maintain/reset-spec/peregrine_dev_relay.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def update_spec(input: typing.Dict):
"max_upward_message_size": 51200,
"max_upward_message_num_per_candidate": 10,
"hrmp_max_message_num_per_candidate": 10,
"validation_upgrade_frequency": 240,
"validation_upgrade_cooldown": 240,
"validation_upgrade_delay": 120,
"max_pov_size": 5242880,
"max_downward_message_size": 51200,
Expand Down
9 changes: 4 additions & 5 deletions .maintain/reset-spec/peregrine_stg_kilt.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,17 @@ def update_spec(input: typing.Dict):
acc_col_2 = "5FxhtaNtvGWTUQzmqq8NbKVVvz8AiXvaXxnSs8WbfBXYs79M"
# not an initial collator
acc_col_3 = "5CvmyN8kLcPKNg98A6nMmrPDqoNN8hJrmFfoYyCesCmfd3se"
para_id = 2001
para_id = 2000

input.update({
"bootNodes": [
"/dns4/bootnodes.kilt.io/tcp/30370/p2p/12D3KooWCAK9CjW1abcSx1UwVRSoyAYTR3AzS6qHnG9pddeU2Sra",
"/dns4/bootnodes.kilt.io/tcp/30371/p2p/12D3KooWLSzt9LjJwvQrZmM3AW6cR5ypVFHpmYJCRKs4HWFmTj5a",
"/dns4/bootnodes.kilt.io/tcp/30372/p2p/12D3KooWPo4pdXrg6E5vWzjRD4dFAWHz3YEsJZj3CDPcMa2iCPkX",
"/dns4/eyrie-1.kilt.io/tcp/30340/p2p/12D3KooWDRzUz3SenRC737aFrY1aPAVbiioqVMUL7otbupWtuk3B",
"/dns4/eyrie-2.kilt.io/tcp/30341/p2p/12D3KooWLSzt9LjJwvQrZmM3AW6cR5ypVFHpmYJCRKs4HWFmTj5a",
],
"chainType": "Live",
"name": "KILT Peregrine Stagenet",
"id": "peregrine_stg_kilt",
"protocolId": "pkilt2",
"protocolId": "pkilt4",
"para_id": para_id,
"telemetryEndpoints": [
[
Expand Down
Loading

0 comments on commit d23a1bc

Please sign in to comment.