Skip to content

Commit 95950b0

Browse files
brunopgalvaodawnkelly09eshabennhussein110xlukem
authored
Add benchmark your pallet (#1189)
* add benchmark your pallet * cleanup and grammarly * fresh llms * apply copilot feedback * update snippet title * Apply suggestions from code review Co-authored-by: Erin Shaben <eshaben@icloud.com> * apply feedback from review * Add Hardhat Get Started (new IA) (#1196) * add harthdat get started * fix: llms * fix and formating * fix --------- Co-authored-by: 0xlukem <lucas.malizia27@gmail.com> * Fix local dev node (#1226) * Remove outdated warning reference from local development node documentation * fix: llms * fix: llms --------- Co-authored-by: Erin Shaben <eshaben@icloud.com> * Add Remix IDE (new IA) (#1174) * fix: get started ready * fix: remix deploy * Update troubleshooting guide for Remix IDE and comment out 'Verify a Contract' section in navigation * fix: images and names * fix: remove verify contract file * fix: llms * Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: prerequisite * fix: llms * Grammarly things and reformat to FAQ style dropdowns for troubleshooting page * applies review feedback * Clean up formatting of titles and bullets * fix: feedback * fix: llms * fix: gifs lists wording * fix: llms * Remove outdated troubleshooting and verification guides for Remix IDE on Polkadot Hub. * fix errant merge conflict syntax, description length * applies review feedback * grammarly pass * minor fix and llms --------- Co-authored-by: Dawn Kelly <83190195+dawnkelly09@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: DAWN KELLY <dawnkelly09@gmail.com> Co-authored-by: Erin Shaben <eshaben@icloud.com> * Hide pages for MVP (#1251) * hide content for mvp launch * update llms config to skip chain interactions and reference sections * llms * FIX - wallets polkavm disclaimer removed (#1252) * fix: removing polkavm disclaimer * fix: llms * applies review feedback * fresh llms --------- Co-authored-by: DAWN KELLY <dawnkelly09@gmail.com> Co-authored-by: Dawn Kelly <83190195+dawnkelly09@users.noreply.github.com> Co-authored-by: Erin Shaben <eshaben@icloud.com> Co-authored-by: Nicolás Hussein <80422357+nhussein11@users.noreply.github.com> Co-authored-by: 0xlukem <lucas.malizia27@gmail.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 9f0dd59 commit 95950b0

11 files changed

+1402
-1419
lines changed

.ai/categories/parachains.md

Lines changed: 555 additions & 1001 deletions
Large diffs are not rendered by default.

.ai/pages/parachains-customize-runtime-pallet-development-benchmark-pallet.md

Lines changed: 355 additions & 206 deletions
Large diffs are not rendered by default.

.ai/pages/parachains-customize-runtime-pallet-development-create-a-pallet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ This command validates all pallet configurations and prepares the build for depl
671671
672672
## Run Your Chain Locally
673673
674-
Launch your parachain locally to test the new pallet functionality using the [Polkadot Omni Node](https://crates.io/crates/polkadot-omni-node){target=\_blank}.
674+
Launch your parachain locally to test the new pallet functionality using the [Polkadot Omni Node](https://crates.io/crates/polkadot-omni-node){target=\_blank}. For instructions on setting up the Polkadot Omni Node and [Polkadot Chain Spec Builder](https://crates.io/crates/staging-chain-spec-builder){target=\_blank}, refer to the [Set Up a Parachain Template](/parachains/launch-a-parachain/set-up-the-parachain-template/){target=\_blank} guide.
675675
676676
### Generate a Chain Specification
677677

.ai/pages/parachains-customize-runtime-pallet-development-pallet-testing.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
2-
title: Pallet Unit Testing
3-
description: Learn how to write comprehensive unit tests for your custom pallets using mock runtimes, ensuring reliability and correctness before deployment.
2+
title: Unit Test Pallets
3+
description: Learn how to efficiently test pallets in the Polkadot SDK, ensuring the reliability and security of your pallets operations.
44
categories: Parachains
55
url: https://docs.polkadot.com/parachains/customize-runtime/pallet-development/pallet-testing/
66
---
77

8-
# Pallet Unit Testing
8+
# Unit Test Pallets
99

1010
## Introduction
1111

.ai/site-index.json

Lines changed: 78 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1361,14 +1361,14 @@
13611361
},
13621362
{
13631363
"id": "parachains-customize-runtime-pallet-development-benchmark-pallet",
1364-
"title": "Benchmarking FRAME Pallets",
1364+
"title": "Benchmark Your Pallet",
13651365
"slug": "parachains-customize-runtime-pallet-development-benchmark-pallet",
13661366
"categories": [
13671367
"Parachains"
13681368
],
13691369
"raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/parachains-customize-runtime-pallet-development-benchmark-pallet.md",
13701370
"html_url": "https://docs.polkadot.com/parachains/customize-runtime/pallet-development/benchmark-pallet/",
1371-
"preview": "Benchmarking is a critical component of developing efficient and secure blockchain runtimes. In the Polkadot ecosystem, accurately benchmarking your custom pallets ensures that each extrinsic has a precise [weight](/reference/glossary/#weight){target=\\_blank}, representing its computational and storage demands. This process is vital for maintaining the blockchain's performance and preventing potential vulnerabilities, such as Denial of Service (DoS) attacks.",
1371+
"preview": "Benchmarking is the process of measuring the computational resources (execution time and storage) required by your pallet's extrinsics. Accurate [weight](https://paritytech.github.io/polkadot-sdk/master/frame_support/weights/index.html){target=\\_blank} calculations are essential for ensuring your blockchain can process transactions efficiently while protecting against denial-of-service attacks.",
13721372
"outline": [
13731373
{
13741374
"depth": 2,
@@ -1377,52 +1377,92 @@
13771377
},
13781378
{
13791379
"depth": 2,
1380-
"title": "The Case for Benchmarking",
1381-
"anchor": "the-case-for-benchmarking"
1380+
"title": "Prerequisites",
1381+
"anchor": "prerequisites"
13821382
},
13831383
{
1384-
"depth": 3,
1385-
"title": "Benchmarking and Weight",
1386-
"anchor": "benchmarking-and-weight"
1384+
"depth": 2,
1385+
"title": "Create the Benchmarking Module",
1386+
"anchor": "create-the-benchmarking-module"
13871387
},
13881388
{
13891389
"depth": 2,
1390-
"title": "Benchmarking Process",
1391-
"anchor": "benchmarking-process"
1390+
"title": "Define the Weight Trait",
1391+
"anchor": "define-the-weight-trait"
13921392
},
13931393
{
1394-
"depth": 3,
1395-
"title": "Prepare Your Environment",
1396-
"anchor": "prepare-your-environment"
1394+
"depth": 2,
1395+
"title": "Add WeightInfo to Config",
1396+
"anchor": "add-weightinfo-to-config"
13971397
},
13981398
{
1399-
"depth": 3,
1400-
"title": "Write Benchmark Tests",
1401-
"anchor": "write-benchmark-tests"
1399+
"depth": 2,
1400+
"title": "Update Extrinsic Weight Annotations",
1401+
"anchor": "update-extrinsic-weight-annotations"
14021402
},
14031403
{
1404-
"depth": 3,
1405-
"title": "Add Benchmarks to Runtime",
1406-
"anchor": "add-benchmarks-to-runtime"
1404+
"depth": 2,
1405+
"title": "Include the Benchmarking Module",
1406+
"anchor": "include-the-benchmarking-module"
14071407
},
14081408
{
1409-
"depth": 3,
1410-
"title": "Run Benchmarks",
1411-
"anchor": "run-benchmarks"
1409+
"depth": 2,
1410+
"title": "Configure Pallet Dependencies",
1411+
"anchor": "configure-pallet-dependencies"
14121412
},
14131413
{
14141414
"depth": 2,
1415-
"title": "Where to Go Next",
1416-
"anchor": "where-to-go-next"
1415+
"title": "Update Mock Runtime",
1416+
"anchor": "update-mock-runtime"
1417+
},
1418+
{
1419+
"depth": 2,
1420+
"title": "Configure Runtime Benchmarking",
1421+
"anchor": "configure-runtime-benchmarking"
1422+
},
1423+
{
1424+
"depth": 2,
1425+
"title": "Test Benchmark Compilation",
1426+
"anchor": "test-benchmark-compilation"
1427+
},
1428+
{
1429+
"depth": 2,
1430+
"title": "Build the Runtime with Benchmarks",
1431+
"anchor": "build-the-runtime-with-benchmarks"
1432+
},
1433+
{
1434+
"depth": 2,
1435+
"title": "Install the Benchmarking Tool",
1436+
"anchor": "install-the-benchmarking-tool"
1437+
},
1438+
{
1439+
"depth": 2,
1440+
"title": "Download the Weight Template",
1441+
"anchor": "download-the-weight-template"
1442+
},
1443+
{
1444+
"depth": 2,
1445+
"title": "Execute Benchmarks",
1446+
"anchor": "execute-benchmarks"
1447+
},
1448+
{
1449+
"depth": 2,
1450+
"title": "Use Generated Weights",
1451+
"anchor": "use-generated-weights"
1452+
},
1453+
{
1454+
"depth": 2,
1455+
"title": "Related Resources",
1456+
"anchor": "related-resources"
14171457
}
14181458
],
14191459
"stats": {
1420-
"chars": 14715,
1421-
"words": 1879,
1422-
"headings": 9,
1423-
"estimated_token_count_total": 3338
1460+
"chars": 19780,
1461+
"words": 2425,
1462+
"headings": 17,
1463+
"estimated_token_count_total": 4492
14241464
},
1425-
"hash": "sha256:915bc91edd56cdedd516e871dbe450d70c9f99fb467cc00ff231ea3a74f61d96",
1465+
"hash": "sha256:cee5050dcc0967da1f1ddaabc769376514223bd453966fb3b6f8322d78755160",
14261466
"token_estimator": "heuristic-v1"
14271467
},
14281468
{
@@ -1568,12 +1608,12 @@
15681608
}
15691609
],
15701610
"stats": {
1571-
"chars": 26671,
1572-
"words": 3041,
1611+
"chars": 26958,
1612+
"words": 3085,
15731613
"headings": 26,
1574-
"estimated_token_count_total": 6113
1614+
"estimated_token_count_total": 6194
15751615
},
1576-
"hash": "sha256:607e283aaa1295de0af191d97de7f6f87afb722c601a447821fde6a09b97f1af",
1616+
"hash": "sha256:dad68ea59fd05fd60dc8890c4cf5615243c7ea879830b0dcf3a5e5e53c3ccec7",
15771617
"token_estimator": "heuristic-v1"
15781618
},
15791619
{
@@ -1664,7 +1704,7 @@
16641704
},
16651705
{
16661706
"id": "parachains-customize-runtime-pallet-development-pallet-testing",
1667-
"title": "Pallet Unit Testing",
1707+
"title": "Unit Test Pallets",
16681708
"slug": "parachains-customize-runtime-pallet-development-pallet-testing",
16691709
"categories": [
16701710
"Parachains"
@@ -1780,12 +1820,12 @@
17801820
}
17811821
],
17821822
"stats": {
1783-
"chars": 25092,
1784-
"words": 2533,
1785-
"headings": 21,
1786-
"estimated_token_count_total": 5673
1823+
"chars": 6895,
1824+
"words": 912,
1825+
"headings": 7,
1826+
"estimated_token_count_total": 1563
17871827
},
1788-
"hash": "sha256:5b6975fc79037690c912a0644a0a438212248e984d7fdb35bd6aea820e637965",
1828+
"hash": "sha256:041ccd82f0c1ddfb93be05feb6cf9d7d4a7e37af6caa8fa8fdab5d5538017122",
17891829
"token_estimator": "heuristic-v1"
17901830
},
17911831
{

0 commit comments

Comments
 (0)