asset-hubs: wire benchmarked weights for assets/vesting precompiles#1192
Conversation
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.
| 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)) |
There was a problem hiding this comment.
[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.
Use
weights::pallet_*_precompiles::WeightInfo<Runtime>instead of the crate-defaultSubstrateWeightforpallet_assets_precompilesandpallet_vesting_precompileson both Asset Hub Polkadot and Kusama.weights/mod.rs.pallet_assets_precompilesweights, fix its trait path, and add a stop-gappallet_vesting_precompiles(AHP-measured values) until a Kusama benchmark run is available.