Skip to content

Commit 04fec02

Browse files
committed
fix: italics
1 parent 27886a1 commit 04fec02

File tree

2 files changed

+12
-68
lines changed

2 files changed

+12
-68
lines changed

develop/toolkit/parachains/light-clients.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ In the diagram above, the decentralized application queries on-chain account inf
3737

3838
Light clients can quickly verify the blockchain's state, including [GRANDPA finality](/polkadot-protocol/glossary#grandpa){target=\_blank} justifications.
3939

40-
!!!info "What does it mean to be 'trust-minimized'?"
40+
!!!info "What does it mean to be *trust-minimized*?"
4141
"Trust-minimized" means that the light client does not need to fully trust the full node from which it retrieves the state. This is achieved through the use of Merkle proofs, which allow the light client to verify the correctness of the state by checking the Merkle tree root.
4242

4343
## JSON-RPC and Light Client Comparison

llms.txt

Lines changed: 11 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -645,30 +645,7 @@ decl_test_relay_chains! {
645645
- [**`decl_test_parachains`**](https://github.com/paritytech/polkadot-sdk/blob/{{dependencies.repositories.polkadot_sdk.version}}/cumulus/xcm/xcm-emulator/src/lib.rs#L590){target=\_blank} - defines runtime and configuration for the parachains. Example:
646646

647647
```rust
648-
// AssetHubWestend Parachain declaration
649-
decl_test_parachains! {
650-
pub struct AssetHubWestend {
651-
genesis = genesis::genesis(),
652-
on_init = {
653-
asset_hub_westend_runtime::AuraExt::on_initialize(1);
654-
},
655-
runtime = asset_hub_westend_runtime,
656-
core = {
657-
XcmpMessageHandler: asset_hub_westend_runtime::XcmpQueue,
658-
LocationToAccountId: asset_hub_westend_runtime::xcm_config::LocationToAccountId,
659-
ParachainInfo: asset_hub_westend_runtime::ParachainInfo,
660-
MessageOrigin: cumulus_primitives_core::AggregateMessageOrigin,
661-
},
662-
pallets = {
663-
PolkadotXcm: asset_hub_westend_runtime::PolkadotXcm,
664-
Balances: asset_hub_westend_runtime::Balances,
665-
Assets: asset_hub_westend_runtime::Assets,
666-
ForeignAssets: asset_hub_westend_runtime::ForeignAssets,
667-
PoolAssets: asset_hub_westend_runtime::PoolAssets,
668-
AssetConversion: asset_hub_westend_runtime::AssetConversion,
669-
}
670-
},
671-
}
648+
Error fetching snippet from https://raw.githubusercontent.com/paritytech/polkadot-sdk/refs/tags/polkadot-stable2412/cumulus/parachains/integration-tests/emulated/chains/parachains/assets/asset-hub-westend/src/lib.rs
672649
```
673650

674651
- [**`decl_test_bridges`**](https://github.com/paritytech/polkadot-sdk/blob/{{dependencies.repositories.polkadot_sdk.version}}/cumulus/xcm/xcm-emulator/src/lib.rs#L1178){target=\_blank} - creates bridges between chains, specifying the source, target, and message handler. Example:
@@ -5724,40 +5701,7 @@ my-pallet/
57245701
With the directory structure set, you can use the [`polkadot-sdk-parachain-template`](https://github.com/paritytech/polkadot-sdk-parachain-template/tree/master/pallets){target=\_blank} to get started as follows:
57255702

57265703
```rust title="benchmarking.rs (starter template)"
5727-
//! Benchmarking setup for pallet-template
5728-
#![cfg(feature = "runtime-benchmarks")]
5729-
5730-
use super::*;
5731-
use frame_benchmarking::v2::*;
5732-
5733-
#[benchmarks]
5734-
mod benchmarks {
5735-
use super::*;
5736-
#[cfg(test)]
5737-
use crate::pallet::Pallet as Template;
5738-
use frame_system::RawOrigin;
5739-
5740-
#[benchmark]
5741-
fn do_something() {
5742-
let caller: T::AccountId = whitelisted_caller();
5743-
#[extrinsic_call]
5744-
do_something(RawOrigin::Signed(caller), 100);
5745-
5746-
assert_eq!(Something::<T>::get().map(|v| v.block_number), Some(100u32.into()));
5747-
}
5748-
5749-
#[benchmark]
5750-
fn cause_error() {
5751-
Something::<T>::put(CompositeStruct { block_number: 100u32.into() });
5752-
let caller: T::AccountId = whitelisted_caller();
5753-
#[extrinsic_call]
5754-
cause_error(RawOrigin::Signed(caller));
5755-
5756-
assert_eq!(Something::<T>::get().map(|v| v.block_number), Some(101u32.into()));
5757-
}
5758-
5759-
impl_benchmark_test_suite!(Template, crate::mock::new_test_ext(), crate::mock::Test);
5760-
}
5704+
Error fetching snippet from https://raw.githubusercontent.com/paritytech/polkadot-sdk-parachain-template/refs/tags/v0.0.2/pallets/template/src/benchmarking.rs
57615705
```
57625706

57635707
In your benchmarking tests, employ these best practices:
@@ -10697,7 +10641,7 @@ Doc-Content: https://docs.polkadot.com/develop/toolkit/parachains/light-clients/
1069710641
--- BEGIN CONTENT ---
1069810642
---
1069910643
title: Light Clients
10700-
description: Learn about Polkadot light clients, their importance, usage, and how they enable robust, cohesive, and secure application composition.
10644+
description:Light clients enable secure and efficient blockchain interaction without running a full node. Learn everything you need to know about light clients on Polkadot.
1070110645
---
1070210646

1070310647
# Light Clients
@@ -10720,7 +10664,7 @@ Light clients are particularly valuable for resource-constrained environments an
1072010664

1072110665
## Light Clients Workflow
1072210666

10723-
Unlike JSON-RPC interfaces, where an application must either maintain a list of providers or rely on a single node, light clients are not limited to nor dependent on a single node. They use cryptographic proofs to verify the blockchain's state, ensuring it is both up-to-date and accurate. By verifying only block headers, light clients avoid syncing the entire state, making them ideal for resource-constrained environments.
10667+
Unlike JSON-RPC interfaces, where an application must maintain a list of providers or rely on a single node, light clients are not limited to or dependent on a single node. They use cryptographic proofs to verify the blockchain's state, ensuring it is up-to-date and accurate. By verifying only block headers, light clients avoid syncing the entire state, making them ideal for resource-constrained environments.
1072410668

1072510669
```mermaid
1072610670
flowchart LR
@@ -10730,20 +10674,20 @@ LC -- Response --> DAPP
1073010674
FN -- Response (validated via Merkle proof) --> LC
1073110675
```
1073210676

10733-
In the diagram above, the decentralized application queries on-chain account information through the light client. The light client, which runs as part of the application, requires minimal memory and computational resources. It uses Merkle proofs to verify the state retrieved from a full node in a trust-minimized manner. Polkadot-compatible light clients utilize [warp syncing](https://spec.polkadot.network/sect-lightclient#sect-sync-warp-lightclient){target=\_blank}, which downloads only block headers.
10677+
In the diagram above, the decentralized application queries on-chain account information through the light client. The light client runs as part of the application and requires minimal memory and computational resources. It uses Merkle proofs to verify the state retrieved from a full node in a trust-minimized manner. Polkadot-compatible light clients utilize [warp syncing](https://spec.polkadot.network/sect-lightclient#sect-sync-warp-lightclient){target=\_blank}, which downloads only block headers.
1073410678

1073510679
Light clients can quickly verify the blockchain's state, including [GRANDPA finality](/polkadot-protocol/glossary#grandpa){target=\_blank} justifications.
1073610680

10737-
!!!info "What does it mean to be 'trust-minimized'?"
10738-
"Trust-minimized" means that the light client does not need to fully trust the full node from which it retrieves state. This is achieved through the use of Merkle proofs, which allow the light client to verify the correctness of the state by checking the Merkle tree root.
10681+
!!!info "What does it mean to be *trust-minimized*?"
10682+
"Trust-minimized" means that the light client does not need to fully trust the full node from which it retrieves the state. This is achieved through the use of Merkle proofs, which allow the light client to verify the correctness of the state by checking the Merkle tree root.
1073910683

1074010684
## JSON-RPC and Light Client Comparison
1074110685

1074210686
Another common method of communication between a user interface (UI) and a node is through the JSON-RPC protocol. Generally, the UI retrieves information from the node, fetches network or [pallet](/polkadot-protocol/glossary#pallet){target=\_blank} data, and interacts with the blockchain. This is typically done in one of two ways:
1074310687

10744-
- **User-Controlled Nodes** - the UI connects to a node client installed on the user's machine
10688+
- **User-controlled nodes** - the UI connects to a node client installed on the user's machine
1074510689
- These nodes are secure, but installation and maintenance can be inconvenient
10746-
- **Publicly Accessible Nodes** - the UI connects to a third-party-owned publicly accessible node client
10690+
- **Publicly accessible nodes** - the UI connects to a third-party-owned publicly accessible node client
1074710691
- These nodes are convenient but centralized and less secure. Applications must maintain a list of backup nodes in case the primary node becomes unavailable
1074810692

1074910693
While light clients still communicate with [full nodes](/polkadot-protocol/glossary#full-node), they offer significant advantages for applications requiring a secure alternative to running a full node:
@@ -10752,15 +10696,15 @@ While light clients still communicate with [full nodes](/polkadot-protocol/gloss
1075210696
| :---------------------------------------------------------------------------------------------: | :------------------------------------------------------------: |
1075310697
| Fully verifies all blocks of the chain | Verifies only the authenticity of blocks |
1075410698
| Stores previous block data and the chain's storage in a database | Does not require a database |
10755-
| Installation, maintenance, and execution are resource-intensive and require technical expertise | No installation; typically included as part of the application |
10699+
| Installation, maintenance, and execution are resource-intensive and require technical expertise | No installation is typically included as part of the application |
1075610700

1075710701
## Using Light Clients
1075810702

1075910703
The [`smoldot`](https://github.com/smol-dot/smoldot){target=\_blank} client is the cornerstone of light client implementation for Polkadot SDK-based chains. It provides the primitives needed to build light clients and is also integrated into libraries such as [PAPI](#papi-light-client-support).
1076010704

1076110705
### PAPI Light Client Support
1076210706

10763-
The [Polkadot API (PAPI)](/develop//toolkit/api-libraries/papi){target=\_blank} library natively supports light client configurations, powered by [`smoldot`](https://github.com/smol-dot/smoldot){target=\_blank}. This allows developers to connect to multiple chains simultaneously using a light client.
10707+
The [Polkadot API (PAPI)](/develop//toolkit/api-libraries/papi){target=\_blank} library natively supports light client configurations powered by [`smoldot`](https://github.com/smol-dot/smoldot){target=\_blank}. This allows developers to connect to multiple chains simultaneously using a light client.
1076410708

1076510709
### Substrate Connect - Browser Extension
1076610710

0 commit comments

Comments
 (0)