Skip to content
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 confirmed messages in the confirmation transaction #2210

Closed
svyatonik opened this issue Jun 15, 2023 · 0 comments · Fixed by #2211
Closed

Prune confirmed messages in the confirmation transaction #2210

svyatonik opened this issue Jun 15, 2023 · 0 comments · Fixed by #2211
Assignees

Comments

@svyatonik
Copy link
Contributor

svyatonik commented Jun 15, 2023

Related to #2451

Right now we are pruning delivered messages from on_idle callback. Why? Because in previous bridge version we didn't wanted relayer to pay additional for the pruning - because this can't be predicted when message is sent. So this has been done in fn send_message and now it is migrated to the on_idle.

This concern ^^^ is no longer valid, because we refund relayer the full transaction cost. And current implementation is an obstacle to dynamic lanes implementation - we need some way (better than round robin) to prune messages from (potentially) unlimited number of lanes.

@svyatonik svyatonik self-assigned this Jun 15, 2023
acatangiu pushed a commit to paritytech/polkadot-sdk that referenced this issue Jul 10, 2024
…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 <bkontur@gmail.com>
Co-authored-by: Svyatoslav Nikolsky <svyatonik@gmail.com>
Co-authored-by: command-bot <>
github-merge-queue bot pushed a commit to paritytech/polkadot-sdk that referenced this issue Aug 23, 2024
…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 <bkontur@gmail.com>
Co-authored-by: Serban Iorga <serban@parity.io>
Co-authored-by: Svyatoslav Nikolsky <svyatonik@gmail.com>
Co-authored-by: command-bot <>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant