-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prune messages from confirmation tx body, not from the on_idle #2211
Conversation
@@ -150,41 +145,17 @@ impl<S: OutboundLaneStorage> OutboundLane<S> { | |||
|
|||
ensure_unrewarded_relayers_are_correct(confirmed_messages.end, relayers)?; | |||
|
|||
// prune all confirmed messages |
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.
Two things to note here:
- this removal is accounted by our benchmarks (see changes in weights db writes);
- we do weight refund in delivery confirmation transaction, but it doesn't need to be changed because it does refund based on
total_messages
from the call arguments andconfirmed_messages
range, returned by this function. So all should be fine here
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.
Looks good!
Forgot to add this warning: when we'll be upgrading existing pallets to this version, we shall not forget to prune old messages and update lane state accordingly |
Original PR with more context: paritytech/parity-bridges-common#2211
Original PR with more context: paritytech/parity-bridges-common#2211 Signed-off-by: Branislav Kontur <[email protected]> Co-authored-by: Svyatoslav Nikolsky <[email protected]>
Original PR with more context: paritytech/parity-bridges-common#2211 Signed-off-by: Branislav Kontur <[email protected]> Co-authored-by: Svyatoslav Nikolsky <[email protected]>
…dle (#4944) Original PR with more context: paritytech/parity-bridges-common#2211 Relates to: paritytech/parity-bridges-common#2210 ## TODO - [x] fresh weighs for `pallet_bridge_messages` - [x] add `try_state` for `pallet_bridge_messages` which checks for unpruned messages - relates to the [comment](paritytech/parity-bridges-common#2211 (comment)) - [x] ~prepare migration, that prunes leftovers, which would be pruned eventually from `on_idle` the [comment](paritytech/parity-bridges-common#2211 (comment) can be done also by `set_storage` / `kill_storage` or with `OnRuntimeUpgrade` implementatino when `do_try_state_for_outbound_lanes` detects problem. ## Open question - [ ] Do we really need `oldest_unpruned_nonce` afterwards? - after the runtime upgrade and when `do_try_state_for_outbound_lanes` pass, we won't need any migrations here - we won't even need `do_try_state_for_outbound_lanes` --------- Signed-off-by: Branislav Kontur <[email protected]> Co-authored-by: Svyatoslav Nikolsky <[email protected]> Co-authored-by: command-bot <>
Original PR with more context: paritytech/parity-bridges-common#2211 Signed-off-by: Branislav Kontur <[email protected]> Co-authored-by: Svyatoslav Nikolsky <[email protected]>
Original PR with more context: paritytech/parity-bridges-common#2211 Signed-off-by: Branislav Kontur <[email protected]> Co-authored-by: Svyatoslav Nikolsky <[email protected]>
Original PR with more context: paritytech/parity-bridges-common#2211 Signed-off-by: Branislav Kontur <[email protected]> Co-authored-by: Svyatoslav Nikolsky <[email protected]>
Original PR with more context: paritytech/parity-bridges-common#2211 Signed-off-by: Branislav Kontur <[email protected]> Co-authored-by: Svyatoslav Nikolsky <[email protected]>
Original PR with more context: paritytech/parity-bridges-common#2211 Signed-off-by: Branislav Kontur <[email protected]> Co-authored-by: Svyatoslav Nikolsky <[email protected]>
Original PR with more context: paritytech/parity-bridges-common#2211 Signed-off-by: Branislav Kontur <[email protected]> Co-authored-by: Svyatoslav Nikolsky <[email protected]>
Original PR with more context: paritytech/parity-bridges-common#2211 Signed-off-by: Branislav Kontur <[email protected]> Co-authored-by: Svyatoslav Nikolsky <[email protected]>
Original PR with more context: paritytech/parity-bridges-common#2211 Signed-off-by: Branislav Kontur <[email protected]> Co-authored-by: Svyatoslav Nikolsky <[email protected]>
Original PR with more context: paritytech/parity-bridges-common#2211 Signed-off-by: Branislav Kontur <[email protected]> Co-authored-by: Svyatoslav Nikolsky <[email protected]>
…dle (#5006) (Please, do not merge until SA, reverted and restored of #4944) Original PR with more context: paritytech/parity-bridges-common#2211 Relates to: paritytech/parity-bridges-common#2210 ## TODO - [x] fresh weighs for `pallet_bridge_messages` - [x] add `try_state` for `pallet_bridge_messages` which checks for unpruned messages - relates to the [comment](paritytech/parity-bridges-common#2211 (comment)) - [x] ~prepare migration, that prunes leftovers, which would be pruned eventually from `on_idle` the [comment](paritytech/parity-bridges-common#2211 (comment) can be done also by `set_storage` / `kill_storage` or with `OnRuntimeUpgrade` implementatino when `do_try_state_for_outbound_lanes` detects problem. ## Open question - [ ] Do we really need `oldest_unpruned_nonce` afterwards? - after the runtime upgrade and when `do_try_state_for_outbound_lanes` pass, we won't need any migrations here - we won't even need `do_try_state_for_outbound_lanes` - please check comments bellow: #4944 (comment) --------- Signed-off-by: Branislav Kontur <[email protected]> Co-authored-by: Serban Iorga <[email protected]> Co-authored-by: Svyatoslav Nikolsky <[email protected]> Co-authored-by: command-bot <>
closes #2210
See #2210 for rationale. I've also updated weights to see the effect don't look at the absolute numbers, only at db reads + writes.
I've left
audit-maybe
label - it'll probably need to be audited as a part of dynamic-lanes audit.IMPORTANT: runtime storage upgrade required: #2211 (comment)