-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Subsystems memory tracking: 1. Transaction pool #4822
Conversation
1e3abb6
to
c7a2fae
Compare
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 txpool looks good, but I'm not sure about pulluting runtime stuff (frame
specifically, primitives
is probably fine).
|
||
/// The output of the `Hashing` function. | ||
type Hash: | ||
Parameter + Member + MaybeSerializeDeserialize + Debug + MaybeDisplay + SimpleBitOps + Ord | ||
+ Default + Copy + CheckEqual + sp_std::hash::Hash + AsRef<[u8]> + AsMut<[u8]>; | ||
+ Default + Copy + CheckEqual + sp_std::hash::Hash + AsRef<[u8]> + AsMut<[u8]> + MaybeMallocSizeOf; |
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.
Hmm, that's a pretty strong requirement to put into the runtime imho, requires bringing in a separate (parity-specific) lib to implement properly. Can't we add where
clauses instead?
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.
Unless some exotic Hash type is used, it is implemented by default within parity-util-mem
(all H*, integers, fixed arrays, Vec<u8>
etc. are covered)
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.
And we have MaybeSerializeDeserialize
there, so using exotic Hash will require some work anyway.
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.
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.
For me this is okay.
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.
Overall looks good.
Some minor issues that needs to be solved :)
d903d54
to
f9ee44c
Compare
851df48
to
cfcee1a
Compare
There will be extra some bounds on runtime primitives, as proposed in #4806
If some project uses exotic types for
OpaqueExtrinsic
/Hash
, they might need to implementMallocSizeOf
for it also