Skip to content
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

chore: maintain reset chain spec scripts #605

Merged
merged 5 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .maintain/reset-spec/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def make_custom_spec(tmp_dir, docker_img, plain_file, out_file, update_spec, spe

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

Expand All @@ -82,7 +82,7 @@ def make_custom_spec(tmp_dir, docker_img, plain_file, out_file, update_spec, spe

logger.debug("writing updated intermediate plain spec to %s", plain_path)
with open(plain_path, "w") as f:
json.dump(in_json, f)
json.dump(in_json, f, indent=2)

cmd_raw_spec = base_docker_run_cmd() + ["-v", f"{tmp_dir}:/data/", docker_img, "build-spec",
"--chain", os.path.join("/data/", plain_custom_file), "--disable-default-bootnode", "--raw"]
Expand Down
40 changes: 16 additions & 24 deletions .maintain/reset-spec/peregrine_stg_kilt.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,49 +4,35 @@
def update_spec(input: typing.Dict):
acc_col_1 = "5HVf8YPXPzp4vTF9dRNh9yLQHemNc4wASoyvFCc2pPz1pbWq"
acc_col_2 = "5FxhtaNtvGWTUQzmqq8NbKVVvz8AiXvaXxnSs8WbfBXYs79M"
# not an initial collator
acc_col_3 = "5CvmyN8kLcPKNg98A6nMmrPDqoNN8hJrmFfoYyCesCmfd3se"
acc_col_4 = "5ERtZS91N73sQoHkNkuVcmhCK2jSys3cDhh6U4uUUGMGksCr"
para_id = 2000

input.update({
"bootNodes": [
"/dns4/eyrie-1.kilt.io/tcp/30340/p2p/12D3KooWDRzUz3SenRC737aFrY1aPAVbiioqVMUL7otbupWtuk3B",
"/dns4/eyrie-2.kilt.io/tcp/30341/p2p/12D3KooWLSzt9LjJwvQrZmM3AW6cR5ypVFHpmYJCRKs4HWFmTj5a",
],
"bootNodes": [],
"chainType": "Live",
"name": "KILT Peregrine Stagenet",
"id": "peregrine_stg_kilt",
"protocolId": "pkilt4",
"para_id": para_id,
"telemetryEndpoints": [
[
"/dns/telemetry-backend.kilt.io/tcp/8080/x-parity-wss/%2Fsubmit",
0
]
]
"telemetryEndpoints": None
})
input["properties"]["tokenSymbol"] = "PILT"
input["genesis"]["runtime"]["parachainInfo"]["parachainId"] = para_id
input["genesis"]["runtime"]["sudo"]["key"] = acc_col_1
input["genesis"]["runtime"]["parachainStaking"]["stakers"] = [
input["genesis"]["runtime"]["parachainStaking"]["stakers"] = [
[
acc_col_1,
acc_col_2,
None,
100000000000000000000
], [
acc_col_2,
],
[
acc_col_3,
None,
100000000000000000000
]
],
]
input["genesis"]["runtime"]["session"]["keys"] = [
[
acc_col_1,
acc_col_1,
{
"aura": "5DSMMuNSVxc6Jz3n8AK4PLEBQQjKSAtRcQXq9MTrAEHpdGDL"
}
],
[
acc_col_2,
acc_col_2,
Expand All @@ -62,7 +48,8 @@ def update_spec(input: typing.Dict):
}
]
]
input["genesis"]["runtime"]["balances"]["balances"] += [
input["genesis"]["runtime"]["vesting"]["vesting"]= []
input["genesis"]["runtime"]["balances"]["balances"] = [
[
acc_col_1,
10000000000000000000000000000
Expand All @@ -74,7 +61,12 @@ def update_spec(input: typing.Dict):
[
acc_col_3,
10000000000000000000000000000
],
[
acc_col_4,
10000000000000000000000000000
]

]


Expand Down
186 changes: 95 additions & 91 deletions .maintain/reset-spec/peregrine_stg_relay.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,14 @@ def update_spec(input: typing.Dict):
acc_ferdie = "5G6ThxmfSbHVt2u8WmZmTH3xeKBckFFDGA69E6cSXtYPaiwT"

input.update({
"bootNodes": [
"/dns4/eyrie-1.kilt.io/tcp/30380/p2p/12D3KooWMJvZTCSNc2t8DKPSJH1LBqLrAWK5yxENfSJ3WPj1UMnP",
"/dns4/eyrie-1.kilt.io/tcp/30381/p2p/12D3KooWPkTuR4PFgYAXA5UPRkXJRLrE7t45AXM3obwrweNUUfuR",
"/dns4/eyrie-2.kilt.io/tcp/30382/p2p/12D3KooWEPScFexvmgxesjbwqzsVEuYYYf8t9wUnFK2U6SnPNWMY",
"/dns4/eyrie-2.kilt.io/tcp/30383/p2p/12D3KooWFYzkpamEy3M415hd93W7iNLt81kuqzhLKMdvTGmq9zuV",
"/dns4/eyrie-3.kilt.io/tcp/30384/p2p/12D3KooWSa1TqsrBuB32fMcGWfS3aZDT1NicsSVs7egPNXtsD5Am",
"/dns4/eyrie-3.kilt.io/tcp/30385/p2p/12D3KooWQNXPgLttsQLKA1PAEWNHzJBLQShPx1tUaMoJew4d3yke",
],
"bootNodes": [],
"chainType": "Live",
"name": "Peregrine-stg Westend-Relay",
"id": "westend_peregrine_stg_relay",
"protocolId": "Rkilt4",
"telemetryEndpoints": [
[
"/dns/telemetry-backend.kilt.io/tcp/8080/x-parity-wss/%2Fsubmit",
0
]
]
"telemetryEndpoints": None
})
input["genesis"]["runtime"]["balances"]["balances"] = [
input["genesis"]["runtimeGenesis"]["patch"]["balances"]["balances"] = [
[
acc_alice,
1000000000000000000
Expand All @@ -55,83 +43,84 @@ def update_spec(input: typing.Dict):
1000000000000000000
],
]
input["genesis"]["runtime"]["session"]["keys"] = [
input["genesis"]["runtimeGenesis"]["patch"]["session"]["keys"] = [
[
acc_alice,
acc_alice,
{
"grandpa": "5H7KYuAdFtXTjdSeWjEKidoHGLCDuRe3vWpVK5pxEux1ysrU",
"babe": "5F7iGThj9n28FdQUzBfrWRALMqLvELEndVbXQ1e9DatM23Rz",
"im_online": "5F7iGThj9n28FdQUzBfrWRALMqLvELEndVbXQ1e9DatM23Rz",
"para_validator": "5F7iGThj9n28FdQUzBfrWRALMqLvELEndVbXQ1e9DatM23Rz",
"para_assignment": "5F7iGThj9n28FdQUzBfrWRALMqLvELEndVbXQ1e9DatM23Rz",
"authority_discovery": "5F7iGThj9n28FdQUzBfrWRALMqLvELEndVbXQ1e9DatM23Rz"
"beefy": "KW4eVXdGVk5uK8GeucUxXmyHyUbLJu7Uoge7qHryUud3UzTRk",
"grandpa": "5CivBtb51w9YRUFosRuriWCJDxke7ePPzHfVsQv4xCFWB3cW",
"babe": "5DLN2JrTfFw3gz6fowJwNzVZ6eqY17Y4cRa3McZHRPtcbbGp",
"para_validator": "5DLN2JrTfFw3gz6fowJwNzVZ6eqY17Y4cRa3McZHRPtcbbGp",
"para_assignment": "5DLN2JrTfFw3gz6fowJwNzVZ6eqY17Y4cRa3McZHRPtcbbGp",
"authority_discovery": "5DLN2JrTfFw3gz6fowJwNzVZ6eqY17Y4cRa3McZHRPtcbbGp"
}
],
[
acc_bob,
acc_bob,
{
"grandpa": "5H25SYu7RHgvNrJbcpHKdRv5gjeKYxfn4wvAD3hpu2cbhRyW",
"babe": "5CGQvLkqjGb1v5ptKoeQdtXJXQkEXmfhB9CFDLSS8MUYkDg2",
"im_online": "5CGQvLkqjGb1v5ptKoeQdtXJXQkEXmfhB9CFDLSS8MUYkDg2",
"para_validator": "5CGQvLkqjGb1v5ptKoeQdtXJXQkEXmfhB9CFDLSS8MUYkDg2",
"para_assignment": "5CGQvLkqjGb1v5ptKoeQdtXJXQkEXmfhB9CFDLSS8MUYkDg2",
"authority_discovery": "5CGQvLkqjGb1v5ptKoeQdtXJXQkEXmfhB9CFDLSS8MUYkDg2"
"beefy": "KW3zUEVDPjM9xc1DMbVNe2GbSFWZN35x264VrnUFJk5KLKRs8",
"grandpa": "5HG2xP1NVfDnYFpzZghNWp19zmrFdmcidS8ijW3eHyVgDarW",
"babe": "5Fbhgb2YW52EjYn5eyUa22dTLFPv3rhmzujrkcfGxXZieSnD",
"para_validator": "5Fbhgb2YW52EjYn5eyUa22dTLFPv3rhmzujrkcfGxXZieSnD",
"para_assignment": "5Fbhgb2YW52EjYn5eyUa22dTLFPv3rhmzujrkcfGxXZieSnD",
"authority_discovery": "5Fbhgb2YW52EjYn5eyUa22dTLFPv3rhmzujrkcfGxXZieSnD"
}
],
[
acc_charlie,
acc_charlie,
{
"grandpa": "5FBpVyAAB4E9woWhgg19LWiKDqUdMMkCZ41b6wTFVLR3qfxS",
"babe": "5Cz484xJRDU1MzbdC853TomhfPbuwVftTefAraaqReWZhaMu",
"im_online": "5Cz484xJRDU1MzbdC853TomhfPbuwVftTefAraaqReWZhaMu",
"para_validator": "5Cz484xJRDU1MzbdC853TomhfPbuwVftTefAraaqReWZhaMu",
"para_assignment": "5Cz484xJRDU1MzbdC853TomhfPbuwVftTefAraaqReWZhaMu",
"authority_discovery": "5Cz484xJRDU1MzbdC853TomhfPbuwVftTefAraaqReWZhaMu"
"beefy": "KW87Cp6e4x17zyBJ9dxmet3EJMYNZLtTUFxgKDDsiEJCaPKht",
"grandpa": "5FKEiJd9D8CEDdmMNWTuxqQUxQGdXoFdLUpnZwjiRxUM8Q2J",
"babe": "5EZikizy2cNFQPioevi2JxL2VsqWJMWfL4BtnDPK7mds8v7T",
"para_validator": "5EZikizy2cNFQPioevi2JxL2VsqWJMWfL4BtnDPK7mds8v7T",
"para_assignment": "5EZikizy2cNFQPioevi2JxL2VsqWJMWfL4BtnDPK7mds8v7T",
"authority_discovery": "5EZikizy2cNFQPioevi2JxL2VsqWJMWfL4BtnDPK7mds8v7T"
}
],
[
acc_dave,
acc_dave,
{
"grandpa": "5CEDZib61ec64jfRpZUe7Q78Yh4oAmzMwkr519rYWBkH8hGZ",
"babe": "5FxM6yYBFvMeX3C2QrQDXJ8LhhzG5sPjgUtX77cX1wihHhVq",
"im_online": "5FxM6yYBFvMeX3C2QrQDXJ8LhhzG5sPjgUtX77cX1wihHhVq",
"para_validator": "5FxM6yYBFvMeX3C2QrQDXJ8LhhzG5sPjgUtX77cX1wihHhVq",
"para_assignment": "5FxM6yYBFvMeX3C2QrQDXJ8LhhzG5sPjgUtX77cX1wihHhVq",
"authority_discovery": "5FxM6yYBFvMeX3C2QrQDXJ8LhhzG5sPjgUtX77cX1wihHhVq"
"beefy": "KWBtBmKhK629mhDtTVhZwRXgVVEyFqzSkUEdVzyW5vrBWE1H9",
"grandpa": "5HMx5YbAjzv715hkCQwpcqedvWFU82ytsWj9n4sobhBQv8Dc",
"babe": "5Hj5gZH93HZZyj7Lo8zPvBWLFufwtP6qXy2NUKepsXjYKgMR",
"para_validator": "5Hj5gZH93HZZyj7Lo8zPvBWLFufwtP6qXy2NUKepsXjYKgMR",
"para_assignment": "5Hj5gZH93HZZyj7Lo8zPvBWLFufwtP6qXy2NUKepsXjYKgMR",
"authority_discovery": "5Hj5gZH93HZZyj7Lo8zPvBWLFufwtP6qXy2NUKepsXjYKgMR"
}
],
[
acc_eve,
acc_eve,
{
"grandpa": "5GKaEkaA8NVdpsruRcnpeLBNGzMcFsEfwEY3Jq7Vmw9brztR",
"babe": "5GnPNFKvLRy9FF8N1G9YjGmjJA4cUsUC7WgEx3rDeMFnZsXk",
"im_online": "5GnPNFKvLRy9FF8N1G9YjGmjJA4cUsUC7WgEx3rDeMFnZsXk",
"para_validator": "5GnPNFKvLRy9FF8N1G9YjGmjJA4cUsUC7WgEx3rDeMFnZsXk",
"para_assignment": "5GnPNFKvLRy9FF8N1G9YjGmjJA4cUsUC7WgEx3rDeMFnZsXk",
"authority_discovery": "5GnPNFKvLRy9FF8N1G9YjGmjJA4cUsUC7WgEx3rDeMFnZsXk"
"authority_discovery": "5H6Vwmomuc9mProwMz1uj64rwqcwAReC3guXTJdWutjATZ5o",
"babe": "5H6Vwmomuc9mProwMz1uj64rwqcwAReC3guXTJdWutjATZ5o",
"beefy": "KW4zpcJ1b1op86FtyKXuomJzzHrMaeMFhLtZHTGnao2HdgoXr",
"grandpa": "5HZQiPE7pN7BWv94vPbBmMeuTL5maxp2op4VeftBSaGVuqRA",
"para_assignment": "5H6Vwmomuc9mProwMz1uj64rwqcwAReC3guXTJdWutjATZ5o",
"para_validator": "5H6Vwmomuc9mProwMz1uj64rwqcwAReC3guXTJdWutjATZ5o"
}
],
[
acc_ferdie,
acc_ferdie,
{
"grandpa": "5CSYQMyi7iGVuHLgLNDXcpPXZgvWWrP7mqd1sHdBUSeafXf5",
"babe": "5CPW6uFwdjoHTj14C1VWiK96Cj2sJBALbC964zHaGAni3J2S",
"im_online": "5CPW6uFwdjoHTj14C1VWiK96Cj2sJBALbC964zHaGAni3J2S",
"para_validator": "5CPW6uFwdjoHTj14C1VWiK96Cj2sJBALbC964zHaGAni3J2S",
"para_assignment": "5CPW6uFwdjoHTj14C1VWiK96Cj2sJBALbC964zHaGAni3J2S",
"authority_discovery": "5CPW6uFwdjoHTj14C1VWiK96Cj2sJBALbC964zHaGAni3J2S"
"authority_discovery": "5DcY86VRU8V68theAJwCVubsBbbz5fGDyq9XuCfkexzN5FEi",
"babe": "5DcY86VRU8V68theAJwCVubsBbbz5fGDyq9XuCfkexzN5FEi",
"beefy": "KW4gMUL2VVYejMyhJQTjPVHveWfNf3NznvWCLLGzVDDR3qpee",
"grandpa": "5EXkVwaWd4bKKLVyW2G5K6ZfhvFyJUpf5qoFvyJvEYrxchsF",
"para_assignment": "5DcY86VRU8V68theAJwCVubsBbbz5fGDyq9XuCfkexzN5FEi",
"para_validator": "5DcY86VRU8V68theAJwCVubsBbbz5fGDyq9XuCfkexzN5FEi"
}
]
]
input["genesis"]["runtime"]["sudo"]["key"] = acc_alice
input["genesis"]["runtime"]["staking"].update({
input["genesis"]["runtimeGenesis"]["patch"]["sudo"]["key"] = acc_alice
input["genesis"]["runtimeGenesis"]["patch"]["staking"].update({
"validatorCount": 6,
"invulnerables":[acc_alice, acc_bob],
"stakers": [
[
acc_alice,
Expand Down Expand Up @@ -171,51 +160,66 @@ def update_spec(input: typing.Dict):
]
]
})
input["genesis"]["runtime"]["configuration"]["config"].update(
input["genesis"]["runtimeGenesis"]["patch"]["configuration"]["config"].update(
{
"approval_voting_params": {
"max_approval_coalesce_count": 1
},
"async_backing_params": {
"allowed_ancestry_len": 0,
"max_candidate_depth": 0
},
"code_retention_period": 1200,
"coretime_cores": 0,
"dispute_period": 6,
"dispute_post_conclusion_acceptance_period": 100,
"executor_params": [],
"group_rotation_frequency": 20,
"hrmp_channel_max_capacity": 8,
"hrmp_channel_max_message_size": 1048576,
"hrmp_channel_max_total_size": 8192,
"hrmp_max_message_num_per_candidate": 5,
"hrmp_max_parachain_inbound_channels": 4,
"hrmp_max_parachain_outbound_channels": 4,
"hrmp_recipient_deposit": 0,
"hrmp_sender_deposit": 0,
"max_code_size": 3145728,
"max_downward_message_size": 1048576,
"max_head_data_size": 32768,
"max_pov_size": 5242880,
"max_upward_message_num_per_candidate": 5,
"max_upward_message_size": 51200,
"max_upward_queue_count": 8,
"max_upward_queue_size": 1048576,
"max_upward_message_size": 1048576,
"max_upward_message_num_per_candidate": 5,
"hrmp_max_message_num_per_candidate": 5,
"validation_upgrade_cooldown": 20,
"validation_upgrade_delay": 10,
"max_pov_size": 5242880,
"max_downward_message_size": 1048576,
"ump_service_total_weight": 100000000000,
"hrmp_max_parachain_outbound_channels": 4,
"hrmp_max_parathread_outbound_channels": 4,
"hrmp_sender_deposit": 0,
"hrmp_recipient_deposit": 0,
"hrmp_channel_max_capacity": 8,
"hrmp_channel_max_total_size": 8192,
"hrmp_max_parachain_inbound_channels": 4,
"hrmp_max_parathread_inbound_channels": 4,
"hrmp_channel_max_message_size": 1048576,
"code_retention_period": 1200,
"parathread_cores": 0,
"parathread_retries": 0,
"group_rotation_frequency": 20,
"chain_availability_period": 4,
"thread_availability_period": 4,
"scheduling_lookahead": 0,
"max_validators_per_core": None,
"max_validators": None,
"dispute_period": 6,
"dispute_post_conclusion_acceptance_period": 100,
"dispute_max_spam_slots": 2,
"dispute_conclusion_by_time_out_period": 200,
"no_show_slots": 2,
"max_validators": 200,
"max_validators_per_core": 5,
"minimum_backing_votes": 2,
"minimum_validation_upgrade_delay": 5,
"n_delay_tranches": 25,
"zeroth_delay_tranche_width": 0,
"needed_approvals": 2,
"relay_vrf_modulo_samples": 2,
"ump_max_individual_weight": 20000000000,
"pvf_checking_enabled": False,
"no_show_slots": 2,
"node_features": {
"bits": 0,
"data": [],
"head": {
"index": 0,
"width": 8
},
"order": "bitvec::order::Lsb0"
},
"on_demand_base_fee": 10000000,
"on_demand_fee_variability": 30000000,
"on_demand_queue_max_size": 10000,
"on_demand_retries": 0,
"on_demand_target_queue_utilization": 250000000,
"on_demand_ttl": 5,
"paras_availability_period": 4,
"pvf_voting_ttl": 2,
"minimum_validation_upgrade_delay": 5
"relay_vrf_modulo_samples": 2,
"scheduling_lookahead": 1,
"validation_upgrade_cooldown": 2,
"validation_upgrade_delay": 2,
"zeroth_delay_tranche_width": 0
}
)

Expand Down
Loading
Loading