-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Conversation
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
benchmark-overhead
commandbenchmark-overhead
command
bot rebase |
Rebasing |
node/client/src/lib.rs
Outdated
/// | ||
/// This is not done as a trait function since the return type depends on the runtime. | ||
/// This macro therefore uses the same approach as [`with_client!`]. | ||
macro_rules! with_raw_payload { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need a macro for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that every runtime has their own SignedExtra
and SignedPayload
.
These types do not share any trait, so I cannot use a trait instead.
The with_client
macro was done for a similar reason which did not work with a trait.
I personally don't like it but did not see an easier solution.
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
node/client/src/lib.rs
Outdated
let $extra: runtime::SignedExtra = ( | ||
frame_system::CheckNonZeroSender::<runtime::Runtime>::new(), | ||
frame_system::CheckSpecVersion::<runtime::Runtime>::new(), | ||
frame_system::CheckTxVersion::<runtime::Runtime>::new(), | ||
frame_system::CheckGenesis::<runtime::Runtime>::new(), | ||
frame_system::CheckMortality::<runtime::Runtime>::from(sp_runtime::generic::Era::mortal( | ||
$period, | ||
$current_block, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a lot of duplicate code that can continue to be macro-ized?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The SignedExtras
are slightly different for Polkadot, since they have one more entry. But I can sum up the other three ones, which would make the macro a bit more complicated though.
PS: Shortened it.
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
bot rebase |
Rebasing |
I will merge this as-is and then think about a better structure for the commands and how to use them from polkadot. |
bot merge |
PS: Integration note for para-chains
Please consider the following MRs when integrating this change: #5270 and paritytech/substrate#12147.
Integrate the
benchmark-overhead
command from paritytech/substrate#10977 to benchmark the per-block and per-extrinsic execution overhead.with_signed_payload!
macro which createsSignedPayload
for each relay-runtimebenchmark_inherent_data
which creates inherent data for all relay-runtimebenchmark-overhead
for each relay-runtimeThe only problem that I currently have here is that it prints
CurrentBlockRandomness did not provide entropy
for every extrinsic or block, I don't know.