-
Notifications
You must be signed in to change notification settings - Fork 825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement cumulus StorageWeightReclaim as wrapping transaction extension + frame system ReclaimWeight #6140
Conversation
I would say it depends. When you are required to put |
Going through the pipeline should be cheap anyway. It's just extensions which are pretty light and the "wasted" work for overweight transactions should be done off-chain when validators are building their blocks. Because the weight check isn't hardcoded and users can build whatever extension they like to handle it, we need to have some sort of convention when we introduce other weight related logic. I skimmed through the PR and I like the approach, but I won't formally approve because I didn't review thoroughly. |
Maybe it is time to split this transaction extension into EDIT: or we can do the EDIT: or we can use a storage to store the weight refunded by EDIT: I decided to with a new storage Later we can introduce another |
thanks @skunert , comments should addressed. |
…et_weight_reclaim
* master: (256 commits) fix chunk fetching network compatibility zombienet test (#6988) chore: delete repeat words (#7034) Print taplo version in CI (#7041) Implement cumulus StorageWeightReclaim as wrapping transaction extension + frame system ReclaimWeight (#6140) Make `TransactionExtension` tuple of tuple transparent for implication (#7028) Replace duplicated whitelist with whitelisted_storage_keys (#7024) [WIP] Fix networking-benchmarks (#7036) [docs] Fix release naming (#7032) migrate pallet-mixnet to umbrella crate (#6986) Improve remote externalities logging (#7021) Fix polkadot sdk doc. (#7022) Remove warning log from frame-omni-bencher CLI (#7020) [pallet-revive] fix file case (#6981) Add workflow for networking benchmarks (#7029) [CI] Skip SemVer on R0-silent and update docs (#6285) correct path in cumulus README (#7001) sync: Send already connected peers to new subscribers (#7011) Excluding chainlink domain for link checker CI (#6524) pallet-bounties: Fix benchmarks for 0 ED (#7013) Log peerset set ID -> protocol name mapping (#7005) ...
(rebasing of #5234)
Issues:
CheckWeight
.Done:
a new storage
ExtrinsicWeightReclaimed
in frame-system. Any logic which attempts to do some reclaim must use this storage to avoid double reclaim.a new function
reclaim_weight
in frame-system pallet: info and post info in arguments, read the already reclaimed weight, calculate the new unused weight from info and post info. do the more accurate reclaim if higher.CheckWeight
is unchanged and still reclaim the weight in post dispatchReclaimWeight
is a new transaction extension in frame system. For solo chains it must be used last in the transactino extension pipeline. It does the final most accurate reclaimStorageWeightReclaim
is moved from cumulus primitives into its own pallet (in order to define benchmark) and is changed into a wrapping transaction extension.It does the recording of proof size and does the reclaim using this recording and the info and post info. So parachains don't need to use
ReclaimWeight
. But also if they use it, there is no bug.