Skip to content

asset-hubs: wire benchmarked weights for assets/vesting precompiles#1192

Merged
ggwpez merged 1 commit into
oty-prepare-release-2604from
bko-nits
May 28, 2026
Merged

asset-hubs: wire benchmarked weights for assets/vesting precompiles#1192
ggwpez merged 1 commit into
oty-prepare-release-2604from
bko-nits

Conversation

@bkontur

@bkontur bkontur commented May 28, 2026

Copy link
Copy Markdown
Contributor

Use weights::pallet_*_precompiles::WeightInfo<Runtime> instead of the crate-default SubstrateWeight for pallet_assets_precompiles and pallet_vesting_precompiles on both Asset Hub Polkadot and Kusama.

  • AHP: copy benchmarked weight files from Weights for release 2.3 #1163 and register them in weights/mod.rs.
  • AHK: register the existing (orphan) pallet_assets_precompiles weights, fix its trait path, and add a stop-gap pallet_vesting_precompiles (AHP-measured values) until a Kusama benchmark run is available.
  • Does not require a CHANGELOG entry

Use `weights::pallet_*_precompiles::WeightInfo<Runtime>` instead of the
crate-default `SubstrateWeight` for `pallet_assets_precompiles` and
`pallet_vesting_precompiles` on both Asset Hub Polkadot and Kusama.

- AHP: copy benchmarked weight files from #1163 and register them in
  `weights/mod.rs`.
- AHK: register the existing (orphan) `pallet_assets_precompiles`
  weights, fix its trait path, and add a stop-gap
  `pallet_vesting_precompiles` (AHP-measured values) until a Kusama
  benchmark run is available.
@bkontur bkontur requested a review from ggwpez May 28, 2026 12:55
@bkontur bkontur mentioned this pull request May 28, 2026
13 tasks

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found.

Comment on lines 95 to +103
fn use_permit() -> Weight {
// Proof Size summary in bytes:
// Measured: `2474`
// Estimated: `6044`
// Minimum execution time: 89_122_000 picoseconds.
Weight::from_parts(91_496_000, 0)
.saturating_add(Weight::from_parts(0, 6044))
.saturating_add(T::DbWeight::get().reads(8))
.saturating_add(T::DbWeight::get().writes(4))
// Measured: `188`
// Estimated: `3569`
// Minimum execution time: 41_815_000 picoseconds.
Weight::from_parts(42_526_000, 0)
.saturating_add(Weight::from_parts(0, 3569))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Line 95] The new use_permit() weight only accounts for Timestamp::Now and the nonce storage, dropping the reads/writes to Revive::OriginalAccount, ForeignAssets::{Asset,Approvals}, System::Account, and ForeignAssets::Metadata that were present before. Wiring this file into asset-hub-polkadot/src/lib.rs makes the runtime undercharge the use_permit precompile by roughly 2x+ if the implementation still performs the approval path. That can let callers consume more execution/storage I/O than the charged gas/weight covers. Re-benchmark pallet_assets_precompiles::use_permit against the current runtime implementation, or restore the previous higher weight until the benchmark is confirmed to match the code path.

@ggwpez ggwpez merged commit 706622a into oty-prepare-release-2604 May 28, 2026
69 of 71 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants