polkadot-sdk
polkadot-sdk copied to clipboard
[After Transaction Extension PR] CheckMetadataHash transaction extension benchmark.
After https://github.com/paritytech/polkadot-sdk/pull/3685
The transaction extensions cost is:
- 3 match. each match is a 2 variant match.
- 1 call to
array_bytes::hex2array_uncheckedto convert a hexadecimal string into a 32 bytes array. - (a debug log which converts a 32 bytes array to hex string, but I think it shouldn't be part of benchmark no?
So I feel introducing a new pallet to have it benchmarked is overkill.
In this PR:
- I removed the
array_bytes::hex2array_uncheckedcall and changed to a const implementation. - I set the weight of the transaction extension to 0: it is basically 3 boolean condition.
Alternative 1:
- put this transaction extension into frame-system and have its benchmark part of system extension benchmarks.
Alternative 2:
- do the new pallet and benchmark stuff.
cc @georgepisaltu