Skip to content

YAP NG FTW!#7220

Merged
ordian merged 46 commits into
masterfrom
s0me0ne/yap-ng
Apr 16, 2025
Merged

YAP NG FTW!#7220
ordian merged 46 commits into
masterfrom
s0me0ne/yap-ng

Conversation

@s0me0ne-unkn0wn
Copy link
Copy Markdown
Contributor

Yet Another Parachain ported onto the latest master branch.

@sandreim
Copy link
Copy Markdown
Contributor

Thanks @s0me0ne-unkn0wn

Comment thread cumulus/parachains/runtimes/testing/yet-another-parachain/Cargo.toml Outdated
@s0me0ne-unkn0wn
Copy link
Copy Markdown
Contributor Author

bot fmt

@command-bot
Copy link
Copy Markdown

command-bot Bot commented Jan 17, 2025

@s0me0ne-unkn0wn https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/8044841 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh". Check out https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment bot cancel 13-9f45d480-7e4c-4655-84bb-0e291255751e to cancel this command or bot cancel to cancel all commands in this pull request.

@command-bot
Copy link
Copy Markdown

command-bot Bot commented Jan 17, 2025

@s0me0ne-unkn0wn Command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh" has finished. Result: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/8044841 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/8044841/artifacts/download.

s0me0ne-unkn0wn and others added 4 commits January 17, 2025 12:46
Signed-off-by: georgepisaltu <george.pisaltu@parity.io>
Signed-off-by: georgepisaltu <george.pisaltu@parity.io>
@georgepisaltu
Copy link
Copy Markdown
Contributor

I replaced the use of ExtrinsicBaseWeight, which double counted the weight of all extensions in the transaction extension pipeline, with the weight of a signature check, the only thing not covered by transaction extensions in v4 extrinsics. This weight is approximated by the weight of the VerifySignature extension, which is usually useful only in v5 extrinsics. In this case, we use its benchmarked weight as the base extrinsic weight. I used the weight benchmarked within the substrate node, but you could benchmark this again or tweak it even further.

@s0me0ne-unkn0wn
Copy link
Copy Markdown
Contributor Author

@georgepisaltu Thanks a lot, very much appreciated!

@sandreim
Copy link
Copy Markdown
Contributor

We should review/finish/merge this PR and have this chain read for next spammening. I got 3k+ txs per block in my tests.

Comment thread substrate/client/basic-authorship/src/basic_authorship.rs Outdated
Comment thread substrate/client/transaction-pool/src/graph/validated_pool.rs Outdated
s0me0ne-unkn0wn and others added 13 commits March 6, 2025 13:44
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
`do_propagate_transactions`

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
* master: (58 commits)
  Upgrade link-checker cache to v4 (#7874)
  Updating readmes (#7950)
  Cumulus: Remove some old scripts (#7946)
  pallet-bounties: allow bounties to never expire (#7723)
  run frame-omni-bencher overhead command in CI for all runtimes in the runtime matrix (#7459)
  Update README.md for Cumulus (#7930)
  FRAME: Meta Transaction (#6428)
  Follow up for: Use the umbrella crate for the parachain template #5993 (#7464)
  Add an extra_constant to pallet-treasury (#7918)
  Bump the ci_dependencies group across 1 directory with 4 updates (#7855)
  remove compromised action (#7934)
  Fixing token-economics dead link (#5302)
  [pallet-revive] Fix pallet-revive-fixtures build.rs (#7928)
  cumulus: fix pov exporter format (#7923)
  sp-api: Support `mut` in `impl_runtime_apis!` (#7924)
  Remove clones from block seal function (#7917)
  [pallet-revive] precompiles 2->9 (#7810)
  Use non-native token to benchmark xcm on asset hub (#7893)
  [CI] bump timeout wait for build in zombienet workflows. (#7871)
  taplo: split long array line to multiline array (#7905)
  ...
…0me0ne/yap-ng

* origin/lexnv/transaction-rework:
  net/transactions: Trace number of batched txes from controller
  net/transactions: Batch multiple tx into a single notification
  net/transactions: Propagate batched transactions to `do_propagate_transactions`
  net/transactions: Refactor tx controller methods to batch notifications
@ordian ordian enabled auto-merge April 15, 2025 02:02
@paritytech-workflow-stopper
Copy link
Copy Markdown

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/14459636959
Failed job name: check-runtime-migration

@ordian ordian disabled auto-merge April 16, 2025 06:46
@ordian ordian enabled auto-merge April 16, 2025 06:46
Co-authored-by: ordian <write@reusable.software>
@ordian ordian added this pull request to the merge queue Apr 16, 2025
@michalkucharczyk
Copy link
Copy Markdown
Contributor

Is it supposed to demo elastic-scaling and work with 2s blocks?
If so, would be great to see some zombienet configuration enabling this setup (I guess you already have something to test it).
I could then check where are we with the pool performance.

@ordian
Copy link
Copy Markdown
Contributor

ordian commented Apr 16, 2025

Is it supposed to demo elastic-scaling and work with 2s blocks? If so, would be great to see some zombienet configuration enabling this setup (I guess you already have something to test it). I could then check where are we with the pool performance.

We already have a zombienet-sdk test with elastic scaling in master. You'd need to modify para setup to use yap runtime and then can use stps script or your own tool to stress test the parachain.

@michalkucharczyk
Copy link
Copy Markdown
Contributor

We already have a zombienet-sdk test with elastic scaling in master. You'd need to modify para setup to use yap runtime and then can use stps script or your own tool to stress test the parachain.

Thank you for this info! Would you mind sharing a small snippet of how the modified para setup should look like when using the yap runtime? That would be super helpful and probably will save some time on my side.

@ordian
Copy link
Copy Markdown
Contributor

ordian commented Apr 16, 2025

diff --git a/polkadot/zombienet-sdk-tests/tests/elastic_scaling/slot_based_3cores.rs b/polkadot/zombienet-sdk-tests/tests/elastic_scaling/slot_based_3cores.rs
index 422feb4d20c..dfdc3d5ddc5 100644
--- a/polkadot/zombienet-sdk-tests/tests/elastic_scaling/slot_based_3cores.rs
+++ b/polkadot/zombienet-sdk-tests/tests/elastic_scaling/slot_based_3cores.rs
@@ -34,9 +34,9 @@ async fn slot_based_3cores_test() -> Result<(), anyhow::Error> {
 					"configuration": {
 						"config": {
 							"scheduler_params": {
-								// Num cores is 4, because 2 extra will be added automatically when registering the paras.
-								"num_cores": 4,
-								"max_validators_per_core": 2
+								// Num cores is 2, because 1 extra will be added automatically when registering the para.
+								"num_cores": 2,
+								"max_validators_per_core": 1
 							}
 						}
 					}
@@ -45,31 +45,23 @@ async fn slot_based_3cores_test() -> Result<(), anyhow::Error> {
 				// type.
 				.with_node(|node| node.with_name("validator-0"));
 
-			(1..12)
+			(1..3)
 				.fold(r, |acc, i| acc.with_node(|node| node.with_name(&format!("validator-{i}"))))
 		})
-		.with_parachain(|p| {
-			// Para 2100 uses the old elastic scaling mvp, which doesn't send the new UMP signal
-			// commitment for selecting the core index.
-			p.with_id(2100)
-				.with_default_command("test-parachain")
-				.with_default_image(images.cumulus.as_str())
-				.with_chain("elastic-scaling-mvp")
-				.with_default_args(vec![
-					"--authoring=slot-based".into(),
-					("-lparachain=debug,aura=debug").into(),
-				])
-				.with_collator(|n| n.with_name("collator-elastic-mvp"))
-		})
 		.with_parachain(|p| {
 			// Para 2200 uses the new RFC103-enabled collator which sends the UMP signal commitment
 			// for selecting the core index
 			p.with_id(2200)
-				.with_default_command("test-parachain")
+				.with_default_command("polkadot-parachain")
 				.with_default_image(images.cumulus.as_str())
-				.with_chain("elastic-scaling")
+				.with_chain("yap-rococo-local-2200")
 				.with_default_args(vec![
 					"--authoring=slot-based".into(),
+					"--rpc-max-subscriptions-per-connection=128000".into(),
+					"--rpc-max-connections=128000".into(),
+					"--pool-limit=500000".into(),
+					"--pool-kbytes=2048000".into(),
+					"--pool-type=fork-aware".into(),
 					("-lparachain=debug,aura=debug").into(),
 				])
 				.with_collator(|n| n.with_name("collator-elastic"))
@@ -85,12 +77,11 @@ async fn slot_based_3cores_test() -> Result<(), anyhow::Error> {
 
 	let relay_node = network.get_node("validator-0")?;
 	let para_node_elastic = network.get_node("collator-elastic")?;
-	let para_node_elastic_mvp = network.get_node("collator-elastic-mvp")?;
 
 	let relay_client: OnlineClient<PolkadotConfig> = relay_node.wait_client().await?;
 	let alice = dev::alice();
 
-	let assign_cores_call = create_assign_core_call(&[(0, 2100), (1, 2100), (2, 2200), (3, 2200)]);
+	let assign_cores_call = create_assign_core_call(&[(0, 2200), (1, 2200)]);
 	// Assign two extra cores to each parachain.
 	relay_client
 		.tx()
@@ -99,27 +90,10 @@ async fn slot_based_3cores_test() -> Result<(), anyhow::Error> {
 		.wait_for_finalized_success()
 		.await?;
 
-	log::info!("2 more cores assigned to each parachain");
-
-	// Expect a backed candidate count of at least 39 for each parachain in 15 relay chain blocks
-	// (2.6 candidates per para per relay chain block).
-	// Note that only blocks after the first session change and blocks that don't contain a session
-	// change will be counted.
-	assert_para_throughput(
-		&relay_client,
-		15,
-		[(ParaId::from(2100), 39..46), (ParaId::from(2200), 39..46)]
-			.into_iter()
-			.collect(),
-	)
-	.await?;
-
-	// Assert the parachain finalized block height is also on par with the number of backed
-	// candidates.
-	assert_finality_lag(&para_node_elastic.wait_client().await?, 15).await?;
-	assert_finality_lag(&para_node_elastic_mvp.wait_client().await?, 15).await?;
+	log::info!("2 more cores assigned to the parachain");
 
-	log::info!("Test finished successfully");
+	// run the test forever
+	loop {}
 
 	Ok(())
 }

I haven't tested this, but this should work. If you encountered an issue, feel free to DM me :)

@ordian
Copy link
Copy Markdown
Contributor

ordian commented Apr 16, 2025

Run with ZOMBIE_PROVIDER=native cargo test -r -p polkadot-zombienet-sdk-tests --features zombie-metadata slot_based_3cores. And you'll need to recompile polkadot-parachain from this branch for chainspec generation.

@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 16, 2025
@ordian ordian added this pull request to the merge queue Apr 16, 2025
Merged via the queue into master with commit def2273 Apr 16, 2025
@ordian ordian deleted the s0me0ne/yap-ng branch April 16, 2025 09:46
Krayt78 pushed a commit to Krayt78/polkadot-sdk that referenced this pull request Apr 18, 2025
Yet Another Parachain ported onto the latest master branch.

---------

Signed-off-by: georgepisaltu <george.pisaltu@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: command-bot <>
Co-authored-by: georgepisaltu <george.pisaltu@parity.io>
Co-authored-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: ordian <noreply@reusable.software>
Co-authored-by: Michal Kucharczyk <1728078+michalkucharczyk@users.noreply.github.com>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: ordian <write@reusable.software>
Co-authored-by: Bastian Köcher <git@kchr.de>
castillax pushed a commit that referenced this pull request May 12, 2025
Yet Another Parachain ported onto the latest master branch.

---------

Signed-off-by: georgepisaltu <george.pisaltu@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: command-bot <>
Co-authored-by: georgepisaltu <george.pisaltu@parity.io>
Co-authored-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: ordian <noreply@reusable.software>
Co-authored-by: Michal Kucharczyk <1728078+michalkucharczyk@users.noreply.github.com>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: ordian <write@reusable.software>
Co-authored-by: Bastian Köcher <git@kchr.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T9-cumulus This PR/Issue is related to cumulus.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

9 participants