mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 01:38:04 +00:00
MessageQueue: unknit permanently overweight books (#13528)
* Unknit permanently overweight books A book with only permanently overweight messages should be unkit from the ready ring. This does currently not happen since perm. overweight messages are not counted as "processed" and therefore not increase the "total_processed" counter. This is only a problem when the next and only message that is processed is overweight. Eventually this should resolve itself when another non-overweight message is enqueued and processed. But for correctness it should be unknitted. Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add tests Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * fmt Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * One more tests Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet-message-queue --------- Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: command-bot <>
This commit is contained in:
committed by
GitHub
parent
13b0f24abd
commit
e16f15119f
@@ -320,3 +320,12 @@ pub fn knit(queue: &MessageOrigin) {
|
||||
pub fn unknit(queue: &MessageOrigin) {
|
||||
super::mock_helpers::unknit::<Test>(queue);
|
||||
}
|
||||
|
||||
pub fn num_overweight_enqueued_events() -> u32 {
|
||||
frame_system::Pallet::<Test>::events()
|
||||
.into_iter()
|
||||
.filter(|e| {
|
||||
matches!(e.event, RuntimeEvent::MessageQueue(crate::Event::OverweightEnqueued { .. }))
|
||||
})
|
||||
.count() as u32
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user