You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I would like to know if there is a way to benchmark code executed in a precompile prior to the pallet dispatch call.
For example in this code it first:
ensure that the caller matches the public key
derive the accountId from this public key
to finally dispatch the call on behalf of this AccountId.
However only the Weight from the dispatched call will be charged, not the weight for this pre-execution.
As a DoS protection we are charging a overestimated ref_time amount.
Is there a way to properly benchmark this piece of code ?
The text was updated successfully, but these errors were encountered:
Hi @boundless-forest,
In try_dispatch only the weight of the RuntimeCall is recorded. See here.
Also in this test that the expect_cost charged is equal to the weight of the call (prior calling dispatch, the weight of the call calculated by benchmarking) and the const gas that is charged at the beginning of the precompile.
But all the execution in the precompile prior to dispatch the call is not automatically charged, hence will need proper benchmarking
Question
Hello,
I would like to know if there is a way to benchmark code executed in a precompile prior to the pallet dispatch call.
For example in this code it first:
to finally dispatch the call on behalf of this AccountId.
However only the Weight from the dispatched call will be charged, not the weight for this pre-execution.
As a DoS protection we are charging a overestimated ref_time amount.
Is there a way to properly benchmark this piece of code ?
The text was updated successfully, but these errors were encountered: