Skip to content

Commit

Permalink
MESH-1916 Monthly 2022 12 (#1387)
Browse files Browse the repository at this point in the history
* Substrate monthly update.

* Apply substrate monthly 2022-11 changes.

* Apply more monthly 2022-11 changes.

* cargo fmt and update `clap`

* Fix no_std build errors.

* Fix benchmarks.

* Fix compiling of tests.

* Fix staking & transaction-payment tests.

* Allow use of deprecated remove_prefix.

* Fix benchmarks.

* Cargo fmt

* Fixup.

* FIXUP: Settlement weights.

* Fix issue with schedule weight limit.

* Fix contracts GAS_LIMIT to include a proof_size.

* Fix expected bridge weights in tests.

* Add missing migrations.

* Fixup: transaction payment RPC endpoints.

* Apply commit
paritytech/substrate@419924c

To our fork.

* Add more changes from Substrate balances pallet.

* Update benchmark weights template.

* Update weights type name.

* Charge minimal fee if the caller is not authorized.

* Update weights.

* Update weights in bridge tests.

* Update Substrate crates.

* Code cleanup in transaction-payment.

Make the code closer to Substrate's transaction-payment code.

* Fix issue with events in transaction-payment.

* Update Substrate again.

* Add missing RuntimeEvent.

* Apply commit paritytech/substrate#12633

* Allow use of remove_prefix.

* Cargo fmt

* Fix event count in tests.

* Update to Substrate monthly 2022-12.

* Remove local parity-db patch

* Fix issue with curve25519-dalek-ng

* Update Substrate again.

* Re-run benchmarks with new template.

* Fix bridge wieghts in tests.

* Update substrate monthly.

* Apply Substrate changes to new NFT code.

* allow remove_prefix.

* Fix timestamp in NFT tests.

* Fixup NFT rpc endpoints.

* Bump sp-arithmetic to the correct version.

* Use published confidential identity crates.

* Update to 5.4

* Update version in Cargo.lock

---------

Co-authored-by: Adam Dossa <adam.dossa@gmail.com>
  • Loading branch information
Neopallium and adamdossa committed Mar 16, 2023
1 parent a52cc32 commit cbfe877
Show file tree
Hide file tree
Showing 206 changed files with 6,145 additions and 5,218 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ jobs:
at: .
- run:
name: Run benchmarks
command: ./polymesh-benchmarks benchmark pallet -p=* -e=* -r 1 -s 1 --execution native --db-cache 512 --heap-pages=2048
command: ./polymesh-benchmarks benchmark pallet -p=* -e=* -r 1 -s 2 --execution wasm --wasm-execution compiled --db-cache 512 --heap-pages=4096
no_output_timeout: 1h
migration-tests:
docker:
Expand Down
1 change: 1 addition & 0 deletions .maintain/benchmarks_1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#./target/release/polymesh benchmark pallet -s 100 -r 5 -p=pallet_babe -e=* --heap-pages 4096 --db-cache 512 --execution wasm --wasm-execution compiled --output ./pallets/weights/src/ --template ./.maintain/frame-weight-template.hbs >> data.txt 2>> log.txt
./target/release/polymesh benchmark pallet -s 100 -r 5 -p=pallet_timestamp -e=* --heap-pages 4096 --db-cache 512 --execution wasm --wasm-execution compiled --output ./pallets/weights/src/ --template ./.maintain/frame-weight-template.hbs >> data.txt 2>> log.txt
./target/release/polymesh benchmark pallet -s 100 -r 5 -p=pallet_scheduler -e=* --heap-pages 4096 --db-cache 512 --execution wasm --wasm-execution compiled --output ./pallets/weights/src/ --template ./.maintain/frame-weight-template.hbs >> data.txt 2>> log.txt
./target/release/polymesh benchmark pallet -s 100 -r 5 -p=pallet_preimage -e=* --heap-pages 4096 --db-cache 512 --execution wasm --wasm-execution compiled --output ./pallets/weights/src/ --template ./.maintain/frame-weight-template.hbs >> data.txt 2>> log.txt
./target/release/polymesh benchmark pallet -s 100 -r 5 -p=pallet_indices -e=* --heap-pages 4096 --db-cache 512 --execution wasm --wasm-execution compiled --output ./pallets/weights/src/ --template ./.maintain/frame-weight-template.hbs >> data.txt 2>> log.txt
./target/release/polymesh benchmark pallet -s 100 -r 5 -p=pallet_corporate_actions -e=* --heap-pages 4096 --db-cache 512 --execution wasm --wasm-execution compiled --output ./pallets/weights/src/ --template ./.maintain/frame-weight-template.hbs >> data.txt 2>> log.txt
./target/release/polymesh benchmark pallet -s 100 -r 5 -p=pallet_asset -e=* --heap-pages 4096 --db-cache 512 --execution wasm --wasm-execution compiled --output ./pallets/weights/src/ --template ./.maintain/frame-weight-template.hbs >> data.txt 2>> log.txt
Expand Down
21 changes: 13 additions & 8 deletions .maintain/frame-weight-template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION {{version}}
//! DATE: {{date}}, STEPS: `{{cmd.steps}}`, REPEAT: {{cmd.repeat}}, LOW RANGE: `{{cmd.lowest_range_values}}`, HIGH RANGE: `{{cmd.highest_range_values}}`
//! EXECUTION: {{cmd.execution}}, WASM-EXECUTION: {{cmd.wasm_execution}}, CHAIN: {{cmd.chain}}, DB CACHE: {{cmd.db_cache}}
//! HOSTNAME: `{{hostname}}`, CPU: `{{cpuname}}`

// Executed Command:
{{#each args as |arg|~}}
Expand All @@ -32,33 +33,37 @@
use polymesh_runtime_common::{RocksDbWeight as DbWeight, Weight};

/// Weights for {{pallet}} using the Substrate node and recommended hardware.
pub struct WeightInfo;
impl {{pallet}}::WeightInfo for WeightInfo {
pub struct SubstrateWeight;
impl {{pallet}}::WeightInfo for SubstrateWeight {
{{#each benchmarks as |benchmark|}}
{{#each benchmark.comments as |comment|}}
// {{comment}}
{{/each}}
{{#each benchmark.component_ranges as |range|}}
/// The range of component `{{range.name}}` is `[{{range.min}}, {{range.max}}]`.
{{/each}}
fn {{benchmark.name~}}
(
{{~#each benchmark.components as |c| ~}}
{{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}}
) -> Weight {
({{underscore benchmark.base_weight}} as Weight)
// Minimum execution time: {{underscore benchmark.min_execution_time}} nanoseconds.
Weight::from_ref_time({{underscore benchmark.base_weight}})
{{#each benchmark.component_weight as |cw|}}
// Standard Error: {{underscore cw.error}}
.saturating_add(({{underscore cw.slope}} as Weight).saturating_mul({{cw.name}} as Weight))
.saturating_add(Weight::from_ref_time({{underscore cw.slope}}).saturating_mul({{cw.name}}.into()))
{{/each}}
{{#if (ne benchmark.base_reads "0")}}
.saturating_add(DbWeight::get().reads({{benchmark.base_reads}} as Weight))
.saturating_add(DbWeight::get().reads({{benchmark.base_reads}}))
{{/if}}
{{#each benchmark.component_reads as |cr|}}
.saturating_add(DbWeight::get().reads(({{cr.slope}} as Weight).saturating_mul({{cr.name}} as Weight)))
.saturating_add(DbWeight::get().reads(({{cr.slope}}_u64).saturating_mul({{cr.name}}.into())))
{{/each}}
{{#if (ne benchmark.base_writes "0")}}
.saturating_add(DbWeight::get().writes({{benchmark.base_writes}} as Weight))
.saturating_add(DbWeight::get().writes({{benchmark.base_writes}}))
{{/if}}
{{#each benchmark.component_writes as |cw|}}
.saturating_add(DbWeight::get().writes(({{cw.slope}} as Weight).saturating_mul({{cw.name}} as Weight)))
.saturating_add(DbWeight::get().writes(({{cw.slope}}_u64).saturating_mul({{cw.name}}.into())))
{{/each}}
}
{{/each}}
Expand Down
Loading

0 comments on commit cbfe877

Please sign in to comment.