Skip to content

Conversation

@Dinonard
Copy link
Contributor

Pull Request Summary

Parachain runtimes now use benchmarked block & extrinsic overhead.

Also updated benchmark script not to try & generate weights in case of an error.

@Dinonard Dinonard added runtime This PR/Issue is related to the topic “runtime”. ci This PR/Issue is related to the topic "CI" labels Jul 21, 2025
ermalkaleci
ermalkaleci previously approved these changes Jul 21, 2025
Copy link
Contributor

@ipapandinas ipapandinas left a comment

Choose a reason for hiding this comment

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

Can the following TODO be addressed now?

// Adjusting the base extrinsic weight to account for the additional database
// read introduced by the `tx-pause` pallet during extrinsic filtering.
//
// TODO: This hardcoded addition is a temporary fix. Replace it with a proper
// benchmark in the future.
weights.base_extrinsic = ExtrinsicBaseWeight::get().saturating_add(<Runtime as frame_system::Config>::DbWeight::get().reads(1));

@Dinonard
Copy link
Contributor Author

Can the following TODO be addressed now?

// Adjusting the base extrinsic weight to account for the additional database
// read introduced by the `tx-pause` pallet during extrinsic filtering.
//
// TODO: This hardcoded addition is a temporary fix. Replace it with a proper
// benchmark in the future.
weights.base_extrinsic = ExtrinsicBaseWeight::get().saturating_add(<Runtime as frame_system::Config>::DbWeight::get().reads(1));

Sure, I forgot it's present in Shibuya too, and wanted to handle it in the tx-pause/safe-mode PR for Astar.

Copy link
Contributor

@ipapandinas ipapandinas left a comment

Choose a reason for hiding this comment

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

Sure, I forgot it's present in Shibuya too, and wanted to handle it in the tx-pause/safe-mode PR for Astar.

Thanks for handling it here, it could have been done in the Astar PR, I didn't want to slow down your tests.

@github-actions
Copy link

Code Coverage

Package Line Rate Branch Rate Health
pallets/price-aggregator/src 75% 0%
pallets/static-price-provider/src 91% 0%
pallets/collator-selection/src 89% 0%
chain-extensions/types/unified-accounts/src 0% 0%
precompiles/dapp-staking/src/test 0% 0%
precompiles/sr25519/src 56% 0%
precompiles/assets-erc20/src 77% 0%
chain-extensions/unified-accounts/src 0% 0%
precompiles/unified-accounts/src 100% 0%
chain-extensions/pallet-assets/src 54% 0%
pallets/astar-xcm-benchmarks/src/fungible 100% 0%
pallets/dapp-staking/src/benchmarking 95% 0%
pallets/inflation/src 84% 0%
pallets/unified-accounts/src 80% 0%
pallets/xc-asset-config/src 62% 0%
pallets/collective-proxy/src 94% 0%
primitives/src 54% 0%
pallets/dapp-staking/rpc/runtime-api/src 0% 0%
pallets/dapp-staking/src/test 0% 0%
pallets/astar-xcm-benchmarks/src/generic 100% 0%
pallets/dynamic-evm-base-fee/src 84% 0%
pallets/ethereum-checked/src 76% 0%
pallets/democracy-mbm/src 30% 0%
precompiles/dapp-staking/src 89% 0%
primitives/src/xcm 64% 0%
precompiles/xcm/src 69% 0%
precompiles/dispatch-lockdrop/src 83% 0%
pallets/astar-xcm-benchmarks/src 86% 0%
pallets/vesting-mbm/src 87% 0%
pallets/dapp-staking/src 80% 0%
chain-extensions/types/assets/src 0% 0%
precompiles/substrate-ecdsa/src 67% 0%
Summary 74% (3792 / 5116) 0% (0 / 0)

Minimum allowed line rate is 50%

@Dinonard Dinonard merged commit 48737b1 into master Jul 22, 2025
8 checks passed
@Dinonard Dinonard deleted the feat/block-and-extrinsic-weight-update branch July 22, 2025 05:24
// TODO: This hardcoded addition is a temporary fix. Replace it with a proper
// benchmark in the future.
weights.base_extrinsic = ExtrinsicBaseWeight::get().saturating_add(<Runtime as frame_system::Config>::DbWeight::get().reads(1));
weights.base_extrinsic = ExtrinsicBaseWeight::get();
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if BaseExtrinicWeight includes reads

Copy link
Contributor

Choose a reason for hiding this comment

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

Although this read will happen only once, maybe it's ok not to measure it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does measure it since filter is part of extrinsic execution.
I'll confirm this in the other PR after re-running the benchmarks for Astar.

For measurement, it doesn't happen once per block but once per extrinsic.
Tx-pause is implemented in such a way that key is (pallet name, extrinsic name).

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, I was thinking of safe-mode :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I assumed that safe-mode read is whitelisted...seems it's not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci This PR/Issue is related to the topic "CI" runtime This PR/Issue is related to the topic “runtime”.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants