mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-18 11:51:01 +00:00
Limit transaction pool size (#1676)
* Avoid excessive hashing. Store extrinsic len. * Implement pool limits. * Fix issues. * Make sure we return error in case it doesn't make into the pool. * Pass parameters from CLI. * Remove redundant todo. * Fix tests.
This commit is contained in:
@@ -68,8 +68,9 @@ impl txpool::ChainApi for TestApi {
|
||||
})
|
||||
}
|
||||
|
||||
fn hash(&self, ex: &txpool::ExtrinsicFor<Self>) -> Self::Hash {
|
||||
BlakeTwo256::hash(&ex.encode())
|
||||
fn hash_and_length(&self, ex: &txpool::ExtrinsicFor<Self>) -> (Self::Hash, usize) {
|
||||
let encoded = ex.encode();
|
||||
(BlakeTwo256::hash(&encoded), encoded.len())
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user