This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Add PoV Tracking to Benchmarking Pipeline #8559
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shawntabrizi
force-pushed
the
shawntabrizi-pov-benchmark
branch
from
April 7, 2021 19:37
7105633
to
667e6c6
Compare
bkchr
approved these changes
Apr 7, 2021
bkchr
reviewed
Apr 7, 2021
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
shawntabrizi
added
B5-clientnoteworthy
C1-low
PR touches the given topic and has a low impact on builders.
D2-notlive 💤
PR contains changes in a runtime directory that is not deployed to a chain that requires an audit.
labels
Apr 7, 2021
kianenigma
reviewed
Apr 8, 2021
kianenigma
approved these changes
Apr 8, 2021
apopiak
reviewed
Apr 8, 2021
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
bot merge |
Error: Missing process info; check that the PR belongs to a project column. Merge cannot succeed as it is. Check out the criteria for merge. |
hirschenberger
pushed a commit
to hirschenberger/substrate
that referenced
this pull request
Apr 14, 2021
* Added a function to estimate proof size for benchmarking * integrate proof_size into benchmarking pipeline * Update client/db/src/bench.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Update client/db/src/bench.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * fix tests * one more test * Update bench.rs * Update utils/frame/benchmarking-cli/src/writer.rs Co-authored-by: Alexander Popiak <alexander.popiak@parity.io> * Update utils/frame/benchmarking-cli/src/command.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: arkpar <arkady.paronyan@gmail.com> Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: Alexander Popiak <alexander.popiak@parity.io> Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
9 tasks
So we can benchmark PoV impact but we don't have any way to track and limit it within FRAME like for weight, right? |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
C1-low
PR touches the given topic and has a low impact on builders.
D2-notlive 💤
PR contains changes in a runtime directory that is not deployed to a chain that requires an audit.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces the PoV Tracking / Proof Recorder into the Runtime Benchmarking Pipeline.
In summary, when a parachain presents a new block for the relay chain to validate, it must also provide a minimal PoV block which contains all the necessary storage items which can be used to prove the validity of the state transition.
This means if you are trying to transfer a balance between two accounts on a parachain, you need to provide some subsection of the full state trie to the relay chain which contains those two account balances.
Due to the base-16 Patricia-Merkle trie used in Substrate, this can end up being a lot of extra data. We need to not only confirm that a block of extrinsics would execute in time, but also that the PoV block needed for all those extrinsics would fit within the limits of the relay chain.
When benchmarking for PoV block size, you need to ensure to follow the path of any extrinsic logic which touches the most storage items, especially those that are large, as this is likely to create the largest PoV block. Furthermore, you must populate the storage to have all of those storage items as full as they can be. Always benchmark the worst case scenario.
Initial tests from this PR show:
So a balance transfer on an empty chain is around 1.6 - 1.8 kB.
Another benchmark which populates more data into the state:
Here we see the PoV size of a
closed_approve
where we change the number of:b
: bytes in the proposalm
: members in the collectivep
: number of proposals in the systemHere we can see the proof size increases as the values of these things increases. Up to nearly 14 kB.
More analysis will be done to verify all of this benchmarking process is sane, and we will introduce processes in future PRs that will fill up the state for worst case PoV benchmarking.