mirror of
https://github.com/pezkuwichain/pezkuwi-runtime-templates.git
synced 2026-06-19 20:21:06 +00:00
Update documentation and templates for Pezkuwi branding
This commit is contained in:
@@ -6,11 +6,11 @@
|
||||
|
||||
Weight is a metric to estimate the time it takes to execute code.
|
||||
|
||||
In Substrate, every transaction has a weight. The block production algorithm selects the set of transactions from the transaction pool that achieve block saturation without exceeding `MaximumBlockWeight`. The `AvailableBlockRatio` ensures only a fraction of `MaximumBlockWeight` is used for regular transactions while system-critical operations (operational transactions) may use all remaining block weight.
|
||||
In Bizinikiwi, every transaction has a weight. The block production algorithm selects the set of transactions from the transaction pool that achieve block saturation without exceeding `MaximumBlockWeight`. The `AvailableBlockRatio` ensures only a fraction of `MaximumBlockWeight` is used for regular transactions while system-critical operations (operational transactions) may use all remaining block weight.
|
||||
|
||||
Substrate charges every transaction's caller with fees in proportion to the cost of execution. It does so by converting each transaction's weight to fees via `WeightToFee`.
|
||||
Bizinikiwi charges every transaction's caller with fees in proportion to the cost of execution. It does so by converting each transaction's weight to fees via `WeightToFee`.
|
||||
|
||||
Weights which underestimate cost of execution expose a DDOS vulnerability. If a transaction takes up less space than it should, too many transactions may be included in the block and the block's execution time may exceed expected block time. For parachains, this DDOS vulnerability can be critical; it may prevent future block production by bricking the chain until the parachain state is reset on the relay chain.
|
||||
Weights which underestimate cost of execution expose a DDOS vulnerability. If a transaction takes up less space than it should, too many transactions may be included in the block and the block's execution time may exceed expected block time. For teyrchains, this DDOS vulnerability can be critical; it may prevent future block production by bricking the chain until the teyrchain state is reset on the relay chain.
|
||||
|
||||
It is imperative for runtime developers to be conservative when approximating weight. Moreover, runtime complexity that is non-linear must be limited and bounded.
|
||||
|
||||
@@ -31,7 +31,7 @@ cargo build --features runtime-benchmarks
|
||||
cargo build --release --features=runtime-benchmarks
|
||||
|
||||
# Collect all pezpallets needed for benchmarking
|
||||
# Makes the assumption all pezpallets are present at: /pezpallets/$PALLET_NAME
|
||||
# Makes the assumption all pezpallets are present at: /pezpallets/$PEZPALLET_NAME
|
||||
pezpallets=$(ls pezpallets/)
|
||||
|
||||
# Generate weights
|
||||
@@ -45,7 +45,7 @@ for pezpallet_name in $pezpallets; do
|
||||
done
|
||||
```
|
||||
[start=3]
|
||||
. Automate the benchmarking pipeline. The first step may be automated by enforcing the command in the CI. The second step may be automated by integrating a benchmarking github bot. For an example, see https://github.com/paritytech/command-bot[Parity's Command Bot].
|
||||
. Automate the benchmarking pipeline. The first step may be automated by enforcing the command in the CI. The second step may be automated by integrating a benchmarking github bot. For an example, see https://github.com/pezkuwichain/command-bot[Parity's Command Bot].
|
||||
|
||||
== More Reading
|
||||
|
||||
@@ -55,8 +55,8 @@ Technically, *Weight* represents the time it takes to execute code on *productio
|
||||
1 unit of weight = 1 picosecond of execution time on target reference hardware
|
||||
```
|
||||
|
||||
It is important to ONLY generate weights on *production hardware*. https://wiki.polkadot.network/docs/maintain-guides-how-to-validate-polkadot#:~:text=Reference%20Hardware%E2%80%8B,instance%20on%20GCP%20and%20c6i[Polkadot Reference Hardware Docs] provides more information on Polkadot validator hardware requirements.
|
||||
It is important to ONLY generate weights on *production hardware*. https://wiki.pezkuwi.network/docs/maintain-guides-how-to-validate-pezkuwi#:~:text=Reference%20Hardware%E2%80%8B,instance%20on%20GCP%20and%20c6i[Pezkuwi Reference Hardware Docs] provides more information on Pezkuwi validator hardware requirements.
|
||||
|
||||
=== References
|
||||
|
||||
https://www.shawntabrizi.com/blog/substrate/substrate-weight-and-fees/[Substrate Weight & Fees] by https://github.com/shawntabrizi/[Shawn Tabrizi]
|
||||
https://www.shawntabrizi.com/blog/bizinikiwi/bizinikiwi-weight-and-fees/[Bizinikiwi Weight & Fees] by https://github.com/shawntabrizi/[Shawn Tabrizi]
|
||||
|
||||
Reference in New Issue
Block a user