feat: Rebrand Polkadot/Substrate references to PezkuwiChain
This commit systematically rebrands various references from Parity Technologies' Polkadot/Substrate ecosystem to PezkuwiChain within the kurdistan-sdk. Key changes include: - Updated external repository URLs (zombienet-sdk, parity-db, parity-scale-codec, wasm-instrument) to point to pezkuwichain forks. - Modified internal documentation and code comments to reflect PezkuwiChain naming and structure. - Replaced direct references to with or specific paths within the for XCM, Pezkuwi, and other modules. - Cleaned up deprecated issue and PR references in various and files, particularly in and modules. - Adjusted image and logo URLs in documentation to point to PezkuwiChain assets. - Removed or rephrased comments related to external Polkadot/Substrate PRs and issues. This is a significant step towards fully customizing the SDK for the PezkuwiChain ecosystem.
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
[settings]
|
||||
enable_tracing = false
|
||||
|
||||
[relaychain]
|
||||
default_image = "{{ZOMBIENET_INTEGRATION_TEST_IMAGE}}"
|
||||
default_command = "bizinikiwi"
|
||||
chain = "local"
|
||||
|
||||
[[relaychain.nodes]]
|
||||
name = "alice"
|
||||
validator = true
|
||||
|
||||
[[relaychain.nodes]]
|
||||
name = "bob"
|
||||
validator = true
|
||||
@@ -0,0 +1,17 @@
|
||||
Description: Block building
|
||||
Network: ./block-building.toml
|
||||
Creds: config
|
||||
|
||||
alice: reports node_roles is 4
|
||||
bob: reports node_roles is 4
|
||||
|
||||
alice: reports peers count is at least 1
|
||||
bob: reports peers count is at least 1
|
||||
|
||||
alice: reports block height is at least 5 within 20 seconds
|
||||
bob: reports block height is at least 5 within 20 seconds
|
||||
|
||||
alice: count of log lines containing "error" is 0 within 2 seconds
|
||||
bob: count of log lines containing "error" is 0 within 2 seconds
|
||||
|
||||
alice: js-script ./transaction-gets-finalized.js within 30 seconds
|
||||
@@ -0,0 +1,59 @@
|
||||
//based on: https://polkadot.js.org/docs/api/examples/promise/transfer-events
|
||||
|
||||
const assert = require("assert");
|
||||
|
||||
async function run(nodeName, networkInfo, args) {
|
||||
const {wsUri, userDefinedTypes} = networkInfo.nodesByName[nodeName];
|
||||
const api = await zombie.connect(wsUri, userDefinedTypes);
|
||||
|
||||
// Construct the keyring after the API (crypto has an async init)
|
||||
const keyring = new zombie.Keyring({ type: "sr25519" });
|
||||
|
||||
// Add Alice to our keyring with a hard-derivation path (empty phrase, so uses dev)
|
||||
const alice = keyring.addFromUri('//Alice');
|
||||
const bob = '5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty';
|
||||
|
||||
// Create a extrinsic, transferring 10^20 units to Bob
|
||||
const transfer = api.tx.balances.transferAllowDeath(bob, 10n**20n);
|
||||
|
||||
let transaction_success_event = false;
|
||||
try {
|
||||
await new Promise( async (resolve, reject) => {
|
||||
const unsubscribe = await transfer
|
||||
.signAndSend(alice, { nonce: -1 }, ({ events = [], status }) => {
|
||||
console.log('Transaction status:', status.type);
|
||||
|
||||
if (status.isInBlock) {
|
||||
console.log('Included at block hash', status.asInBlock.toHex());
|
||||
console.log('Events:');
|
||||
|
||||
events.forEach(({ event: { data, method, section }, phase }) => {
|
||||
console.log('\t', phase.toString(), `: ${section}.${method}`, data.toString());
|
||||
|
||||
if (section=="system" && method =="ExtrinsicSuccess") {
|
||||
transaction_success_event = true;
|
||||
}
|
||||
});
|
||||
} else if (status.isFinalized) {
|
||||
console.log('Finalized block hash', status.asFinalized.toHex());
|
||||
unsubscribe();
|
||||
if (transaction_success_event) {
|
||||
resolve();
|
||||
} else {
|
||||
reject("ExtrinsicSuccess has not been seen");
|
||||
}
|
||||
} else if (status.isError) {
|
||||
unsubscribe();
|
||||
reject("Transaction status.isError");
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
} catch (error) {
|
||||
assert.fail("Transfer promise failed, error: " + error);
|
||||
}
|
||||
|
||||
assert.ok("test passed");
|
||||
}
|
||||
|
||||
module.exports = { run }
|
||||
@@ -0,0 +1,99 @@
|
||||
# Test design
|
||||
The `warp-sync` test works on predefined database which is stored in the cloud and
|
||||
fetched by the test. `alice` and `bob` nodes are spun up using this database snapshot in full node mode.
|
||||
|
||||
As `warp-sync` requires at least 3 peers, the test spawns the `charlie` full node which uses the same database snapshot.
|
||||
|
||||
The `dave` node executed with `--sync warp` syncs database with the rest of the network.
|
||||
|
||||
# How to prepare database
|
||||
Database was prepared using the following zombienet file (`generate-warp-sync-database.toml`):
|
||||
```
|
||||
[relaychain]
|
||||
default_image = "docker.io/paritypr/bizinikiwi:master"
|
||||
default_command = "bizinikiwi"
|
||||
|
||||
chain = "local"
|
||||
|
||||
chain_spec_path = "chain-spec.json"
|
||||
|
||||
[[relaychain.nodes]]
|
||||
name = "alice"
|
||||
validator = true
|
||||
|
||||
[[relaychain.nodes]]
|
||||
name = "bob"
|
||||
validator = true
|
||||
```
|
||||
|
||||
The zombienet shall be executed with the following command, and run for some period of time to allow for few grandpa eras.
|
||||
```
|
||||
./zombienet-linux spawn --dir ./db-test-gen --provider native generate-warp-sync-database.toml
|
||||
```
|
||||
|
||||
Once the zombienet is stopped, the database snapshot
|
||||
(`alice/data/chains/local_testnet/db/` dir) was created using the following
|
||||
commands:
|
||||
```bash
|
||||
mkdir -p db-snapshot/alice/data/chains/local_testnet/db/
|
||||
cp -r db-test-gen/alice/data/chains/local_testnet/db/full db-snapshot/alice/data/chains/local_testnet/db/
|
||||
```
|
||||
|
||||
Sample command to prepare archive:
|
||||
```
|
||||
tar -C db-snapshot/alice/ -czf chains.tgz ./
|
||||
```
|
||||
|
||||
The file format should be `tar.gz`. File shall contain `local_testnet` folder and its subfolders, e.g.:
|
||||
```
|
||||
$ tar tzf chains.tgz | head
|
||||
data/chains/local_testnet/
|
||||
data/chains/local_testnet/db/
|
||||
data/chains/local_testnet/db/full/
|
||||
...
|
||||
data/chains/local_testnet/db/full/000469.log
|
||||
```
|
||||
|
||||
Also refer to: [zombienet#578](https://github.com/pezkuwichain/kurdistan-sdk/issues/191)
|
||||
|
||||
The `raw` chain-spec shall also be saved: `db-test-gen/local.json`.
|
||||
|
||||
# Where to upload database
|
||||
The access to this [bucket](https://console.cloud.google.com/storage/browser/zombienet-db-snaps/) is required.
|
||||
|
||||
Sample public path is: `https://storage.googleapis.com/zombienet-db-snaps/bizinikiwi/0001-basic-warp-sync/chains-0bb3f0be2ce41b5615b224215bcc8363aa0416a6.tgz`.
|
||||
|
||||
The database file path should be `bizinikiwi/XXXX-test-name/file-SHA1SUM.tgz`, where `SHA1SUM` is a `sha1sum` of the file.
|
||||
|
||||
# Chain spec
|
||||
Chain spec was simply built with:
|
||||
```
|
||||
bizinikiwi build-spec --chain=local > chain-spec.json
|
||||
```
|
||||
|
||||
Please note that `chain-spec.json` committed into repository is `raw` version produced by `zombienet` during database
|
||||
snapshot generation. Zombienet applies some modifications to plain versions of chain-spec.
|
||||
|
||||
# Run the test
|
||||
Test can be run with the following command:
|
||||
```
|
||||
zombienet-linux test --dir db-snapshot --provider native test-warp-sync.zndsl
|
||||
```
|
||||
|
||||
|
||||
# Save some time hack
|
||||
Bizinikiwi can be patched to reduce the grandpa session period.
|
||||
```
|
||||
diff --git a/bin/node/runtime/src/constants.rs b/bin/node/runtime/src/constants.rs
|
||||
index 23fb13cfb0..89f8646291 100644
|
||||
--- a/bin/node/runtime/src/constants.rs
|
||||
+++ b/bin/node/runtime/src/constants.rs
|
||||
@@ -63,7 +63,7 @@ pub mod time {
|
||||
|
||||
// NOTE: Currently it is not possible to change the epoch duration after the chain has started.
|
||||
// Attempting to do so will brick block production.
|
||||
- pub const EPOCH_DURATION_IN_BLOCKS: BlockNumber = 10 * MINUTES;
|
||||
+ pub const EPOCH_DURATION_IN_BLOCKS: BlockNumber = 1 * MINUTES / 2;
|
||||
pub const EPOCH_DURATION_IN_SLOTS: u64 = {
|
||||
const SLOT_FILL_RATE: f64 = MILLISECS_PER_BLOCK as f64 / SLOT_DURATION as f64
|
||||
```
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,20 @@
|
||||
# this file is not intended to be executed in CI stage
|
||||
[relaychain]
|
||||
default_image = "docker.io/paritypr/bizinikiwi:latest"
|
||||
default_command = "bizinikiwi"
|
||||
|
||||
# refer to ./README.md for more details on how to create snapshot and spec
|
||||
chain = "local"
|
||||
chain_spec_path = "chain-spec.json"
|
||||
|
||||
|
||||
[[relaychain.nodes]]
|
||||
name = "alice"
|
||||
validator = true
|
||||
# TODO: Workaround for https://github.com/pezkuwichain/pezkuwi-sdk/issues/2568
|
||||
# After the issue is fixed, we can remove this.
|
||||
args = ["--state-pruning archive --blocks-pruning archive"]
|
||||
|
||||
[[relaychain.nodes]]
|
||||
name = "bob"
|
||||
validator = true
|
||||
@@ -0,0 +1,30 @@
|
||||
[settings]
|
||||
enable_tracing = false
|
||||
|
||||
[relaychain]
|
||||
default_image = "{{ZOMBIENET_INTEGRATION_TEST_IMAGE}}"
|
||||
default_command = "bizinikiwi"
|
||||
|
||||
chain = "local"
|
||||
chain_spec_path = "chain-spec.json"
|
||||
|
||||
[[relaychain.nodes]]
|
||||
name = "alice"
|
||||
validator = false
|
||||
db_snapshot = "{{DB_SNAPSHOT}}"
|
||||
|
||||
[[relaychain.nodes]]
|
||||
name = "bob"
|
||||
validator = false
|
||||
db_snapshot = "{{DB_SNAPSHOT}}"
|
||||
|
||||
#we need at least 3 nodes for warp sync
|
||||
[[relaychain.nodes]]
|
||||
name = "charlie"
|
||||
validator = false
|
||||
db_snapshot = "{{DB_SNAPSHOT}}"
|
||||
|
||||
[[relaychain.nodes]]
|
||||
name = "dave"
|
||||
validator = false
|
||||
args = ["--sync warp -ldb::blockchain"]
|
||||
@@ -0,0 +1,31 @@
|
||||
Description: Warp sync
|
||||
Network: ./test-warp-sync.toml
|
||||
Creds: config
|
||||
|
||||
alice: reports node_roles is 1
|
||||
bob: reports node_roles is 1
|
||||
charlie: reports node_roles is 1
|
||||
dave: reports node_roles is 1
|
||||
|
||||
alice: reports peers count is at least 3 within 60 seconds
|
||||
bob: reports peers count is at least 3 within 60 seconds
|
||||
charlie: reports peers count is at least 3 within 60 seconds
|
||||
dave: reports peers count is at least 3 within 60 seconds
|
||||
|
||||
|
||||
# db snapshot has {{DB_BLOCK_HEIGHT}} blocks
|
||||
alice: reports block height is at least {{DB_BLOCK_HEIGHT}} within 60 seconds
|
||||
bob: reports block height is at least {{DB_BLOCK_HEIGHT}} within 60 seconds
|
||||
charlie: reports block height is at least {{DB_BLOCK_HEIGHT}} within 60 seconds
|
||||
|
||||
dave: reports block height is at least 1 within 60 seconds
|
||||
dave: reports block height is at least {{DB_BLOCK_HEIGHT}} within 60 seconds
|
||||
|
||||
dave: log line matches "Warp sync is complete" within 60 seconds
|
||||
dave: log line matches "Checking for displaced leaves after finalization\. leaves\=\[0xc5e7b4cfd23932bb930e859865430a35f6741b4732d677822d492ca64cc8d059\]" within 10 seconds
|
||||
# State sync is logically part of warp sync
|
||||
dave: log line matches "State sync is complete" within 60 seconds
|
||||
dave: log line matches "Block history download is complete" within 10 seconds
|
||||
|
||||
dave: count of log lines containing "error" is 0 within 10 seconds
|
||||
dave: count of log lines containing "verification failed" is 0 within 10 seconds
|
||||
@@ -0,0 +1,3 @@
|
||||
Refer to ../0001-basic-warp-sync/README.md for more details. This test is nearly a clone. We want to warp-sync
|
||||
validators and make sure they can build blocks. 0001-basic-warp-sync chainspec (copied) and database are reused in this
|
||||
test.
|
||||
@@ -0,0 +1 @@
|
||||
../0001-basic-warp-sync/chain-spec.json
|
||||
@@ -0,0 +1,40 @@
|
||||
[settings]
|
||||
enable_tracing = false
|
||||
|
||||
[relaychain]
|
||||
default_image = "{{ZOMBIENET_INTEGRATION_TEST_IMAGE}}"
|
||||
default_command = "bizinikiwi"
|
||||
|
||||
chain = "local"
|
||||
chain_spec_path = "chain-spec.json"
|
||||
|
||||
[[relaychain.nodes]]
|
||||
name = "alice"
|
||||
validator = true
|
||||
args = ["--log=beefy=debug", "--sync warp"]
|
||||
|
||||
[[relaychain.nodes]]
|
||||
name = "bob"
|
||||
validator = true
|
||||
args = ["--log=beefy=debug", "--sync warp"]
|
||||
|
||||
[[relaychain.nodes]]
|
||||
name = "other-validator"
|
||||
validator = true
|
||||
args = ["--log=beefy=debug", "--sync warp"]
|
||||
|
||||
# we need at least 3 nodes for warp sync
|
||||
[[relaychain.nodes]]
|
||||
name = "charlie"
|
||||
validator = false
|
||||
db_snapshot = "{{DB_SNAPSHOT}}"
|
||||
|
||||
[[relaychain.nodes]]
|
||||
name = "dave"
|
||||
validator = false
|
||||
db_snapshot = "{{DB_SNAPSHOT}}"
|
||||
|
||||
[[relaychain.nodes]]
|
||||
name = "eve"
|
||||
validator = false
|
||||
db_snapshot = "{{DB_SNAPSHOT}}"
|
||||
@@ -0,0 +1,55 @@
|
||||
Description: Warp sync
|
||||
Network: ./test-validators-warp-sync.toml
|
||||
Creds: config
|
||||
|
||||
alice: reports node_roles is 4
|
||||
bob: reports node_roles is 4
|
||||
charlie: reports node_roles is 1
|
||||
dave: reports node_roles is 1
|
||||
eve: reports node_roles is 1
|
||||
|
||||
alice: reports peers count is at least 4 within 60 seconds
|
||||
bob: reports peers count is at least 4 within 60 seconds
|
||||
charlie: reports peers count is at least 4 within 60 seconds
|
||||
dave: reports peers count is at least 4 within 60 seconds
|
||||
eve: reports peers count is at least 4 within 60 seconds
|
||||
|
||||
# db snapshot has {{DB_BLOCK_HEIGHT}} blocks
|
||||
charlie: reports block height is at least {{DB_BLOCK_HEIGHT}} within 60 seconds
|
||||
dave: reports block height is at least {{DB_BLOCK_HEIGHT}} within 60 seconds
|
||||
eve: reports block height is at least {{DB_BLOCK_HEIGHT}} within 60 seconds
|
||||
|
||||
alice: log line matches "Warp sync is complete" within 60 seconds
|
||||
bob: log line matches "Warp sync is complete" within 60 seconds
|
||||
# State sync is logically part of warp sync
|
||||
alice: log line matches "State sync is complete" within 60 seconds
|
||||
bob: log line matches "State sync is complete" within 60 seconds
|
||||
|
||||
alice: log line matches "Block history download is complete" within 120 seconds
|
||||
bob: log line matches "Block history download is complete" within 120 seconds
|
||||
|
||||
alice: reports block height is at least {{DB_BLOCK_HEIGHT}} within 10 seconds
|
||||
bob: reports block height is at least {{DB_BLOCK_HEIGHT}} within 10 seconds
|
||||
|
||||
# We can be in a case where finality is lagging. For example:
|
||||
# Let's wait until finality works correctly.
|
||||
alice: reports substrate_block_height{status="finalized"} is at least {{DB_BLOCK_HEIGHT}} within 120 seconds
|
||||
bob: reports substrate_block_height{status="finalized"} is at least {{DB_BLOCK_HEIGHT}} within 120 seconds
|
||||
|
||||
# Make sure that BEEFY voting started.
|
||||
alice: reports substrate_beefy_best_block is at least 1 within 60 seconds
|
||||
bob: reports substrate_beefy_best_block is at least 1 within 60 seconds
|
||||
# Make sure that BEEFY voting is advancing
|
||||
# In the worst case scenario, the validators should vote on 1 mandatory block each 6 seconds. And 1 era = 200 blocks.
|
||||
alice: reports substrate_beefy_best_block is at least {{200*180/6}} within 180 seconds
|
||||
bob: reports substrate_beefy_best_block is at least {{200*180/6}} within 180 seconds
|
||||
|
||||
# Validators started without public addresses must emit an error.
|
||||
# Double check the error is the expected one.
|
||||
alice: log line matches "No public addresses configured and no global listen addresses found" within 60 seconds
|
||||
alice: count of log lines containing "error" is 1 within 10 seconds
|
||||
bob: count of log lines containing "verification failed" is 0 within 10 seconds
|
||||
|
||||
# new blocks were built
|
||||
alice: reports block height is greater than {{DB_BLOCK_HEIGHT}} within 90 seconds
|
||||
bob: reports block height is greater than {{DB_BLOCK_HEIGHT}} within 90 seconds
|
||||
@@ -0,0 +1,3 @@
|
||||
Refer to ../0001-basic-warp-sync/README.md for more details. This test is nearly a clone. We want to warp-sync full nodes
|
||||
in the presence of validators.
|
||||
0001-basic-warp-sync chainspec (copied) and database are reused in this test.
|
||||
@@ -0,0 +1 @@
|
||||
../0001-basic-warp-sync/chain-spec.json
|
||||
@@ -0,0 +1,30 @@
|
||||
[settings]
|
||||
enable_tracing = false
|
||||
|
||||
[relaychain]
|
||||
default_image = "{{ZOMBIENET_INTEGRATION_TEST_IMAGE}}"
|
||||
default_command = "bizinikiwi"
|
||||
|
||||
chain = "local"
|
||||
chain_spec_path = "chain-spec.json"
|
||||
|
||||
#we need at least 3 nodes for warp sync
|
||||
[[relaychain.nodes]]
|
||||
name = "alice"
|
||||
validator = true
|
||||
db_snapshot = "{{DB_SNAPSHOT}}"
|
||||
|
||||
[[relaychain.nodes]]
|
||||
name = "bob"
|
||||
validator = true
|
||||
db_snapshot = "{{DB_SNAPSHOT}}"
|
||||
|
||||
[[relaychain.nodes]]
|
||||
name = "charlie"
|
||||
validator = false
|
||||
db_snapshot = "{{DB_SNAPSHOT}}"
|
||||
|
||||
[[relaychain.nodes]]
|
||||
name = "dave"
|
||||
validator = false
|
||||
args = ["--sync warp"]
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
Description: Warp sync
|
||||
Network: ./test-block-building-warp-sync.toml
|
||||
Creds: config
|
||||
|
||||
alice: reports node_roles is 4
|
||||
bob: reports node_roles is 4
|
||||
charlie: reports node_roles is 1
|
||||
dave: reports node_roles is 1
|
||||
|
||||
# In theory we should have 3 peers. But for some reason dave is requesting the
|
||||
# block twice and gets banned by Alice. The request is done during the
|
||||
# warp-sync. It is a bug, so here we work around it.
|
||||
alice: reports peers count is at least 2 within 60 seconds
|
||||
bob: reports peers count is at least 2 within 60 seconds
|
||||
charlie: reports peers count is at least 2 within 60 seconds
|
||||
dave: reports peers count is at least 2 within 60 seconds
|
||||
|
||||
|
||||
# db snapshot has {{DB_BLOCK_HEIGHT}} blocks
|
||||
alice: reports block height is at least {{DB_BLOCK_HEIGHT}} within 60 seconds
|
||||
bob: reports block height is at least {{DB_BLOCK_HEIGHT}} within 60 seconds
|
||||
charlie: reports block height is at least {{DB_BLOCK_HEIGHT}} within 60 seconds
|
||||
|
||||
alice: reports block height is greater than {{DB_BLOCK_HEIGHT}} within 75 seconds
|
||||
bob: reports block height is greater than {{DB_BLOCK_HEIGHT}} within 75 seconds
|
||||
charlie: reports block height is greater than {{DB_BLOCK_HEIGHT}} within 75 seconds
|
||||
|
||||
dave: reports block height is at least 1 within 60 seconds
|
||||
dave: reports block height is at least {{DB_BLOCK_HEIGHT}} within 60 seconds
|
||||
dave: reports block height is greater than {{DB_BLOCK_HEIGHT}} within 60 seconds
|
||||
|
||||
dave: log line matches "Warp sync is complete" within 60 seconds
|
||||
# State sync is logically part of warp sync
|
||||
dave: log line matches "State sync is complete" within 60 seconds
|
||||
dave: log line matches "Block history download is complete" within 10 seconds
|
||||
|
||||
dave: reports substrate_beefy_best_block is at least {{DB_BLOCK_HEIGHT}} within 180 seconds
|
||||
dave: reports substrate_beefy_best_block is greater than {{DB_BLOCK_HEIGHT}} within 60 seconds
|
||||
|
||||
# The block history download runs in the background while the fresh blocks are imported. This error can pop out in the log and is acceptable: the freshly announced block may not have the parent imported yet.
|
||||
dave: count of log lines containing "error(?! importing block .*: block has an unknown parent)" is 0 within 10 seconds
|
||||
dave: count of log lines containing "verification failed" is 0 within 10 seconds
|
||||
Reference in New Issue
Block a user