Annoyance: Transaction extension tuple can't be more than 12 elements, and tuple of tuple changes order of inherited implication and is not discoverable with metadata #6569
Labels
I3-annoyance
The node behaves within expectations, however this “expected behaviour” itself is at issue.
T1-FRAME
This PR/Issue is related to core FRAME, the framework.
TLDR: Transaction extension tuple can't be more than 12 elements, and tuple of tuple changes order of inherited implication, and the order is not discoverable with metadata because it only contains a vector of transaction extension.
Description:
The transaction extensions are define with a tuple of transaction extension, and is part of the extrinsic that is part of a block.
The block requires among other traits:
Eq
,PartialEq
,Debug
.Those specific traits are implemented on tuple of at most 12 elements: https://doc.rust-lang.org/core/primitive.tuple.html#trait-implementations-1
To fit into 12 elements we may want to group some into tuples like:
But this changes the inherited implication passed to the grouped transaction extensions:
The code is here:
polkadot-sdk/substrate/primitives/runtime/src/traits/transaction_extension/mod.rs
Lines 510 to 533 in 25691b8
To be more precise:
(A, B), C, D)
the inherited implications of A isext_version, call, C_explicit, D_explicit, C_implicit, D_implicit, B_explicit, B_implicit
.(A, B, C, D)
the inherited implications of A isext_version, call, B_explicit, C_explicit, D_explicit, B_implicit, C_implicit, D_implicit
.and for both the metadata is simply
A, B, C
Solution:
TransactionExtensionPipeline
, and derive traits on it.EDIT: it doesn't work well when we need to give implicit or instanciate types. But with some
From
implementation it can be fine.(A_explicit, A_implicit, B_explicit, B_implicit)
for its implication. Or 2 inherited implications arguments: explicit and implicit. (call and extension version would be explicits at the end.)cc @georgepisaltu
The text was updated successfully, but these errors were encountered: