Select header that will be fully refunded in on-demand batch finality relay#2729
Merged
svyatonik merged 5 commits intopolkadot-stagingfrom Dec 6, 2023
Merged
Conversation
… **batch** finality relay
3 tasks
bkontur
approved these changes
Dec 6, 2023
Collaborator
|
Do you want to update subtree? I could do it also maybe with #2727 |
Contributor
Author
Main thing I want to do here is to deploy relay once this PR is merged. Constants are not that important - tests in fellowship repo are "manual" atm until we'll do another round of upgrade dependencies. But yes - if you'll be doing update in #2727, let's bring those changes too |
bkontur
added a commit
to paritytech/polkadot-sdk
that referenced
this pull request
Dec 6, 2023
## Summary This PR aligns Rococo/Westend bridge with latest Bridges repo development: - paritytech/parity-bridges-common#2727 - paritytech/parity-bridges-common#2728 - paritytech/parity-bridges-common#2729 Part of: paritytech/parity-bridges-common#2452
svyatonik
added a commit
that referenced
this pull request
Dec 8, 2023
… relay (#2729) * select header that will be fully refunded for submission in on-demand **batch** finality relay * added the only possible test * spelling * nl * updated comment
svyatonik
added a commit
that referenced
this pull request
Dec 8, 2023
* separate constants for average and worst case relay headers (#2728) * separate constants for average and worst case relay headers * fix compilation * Select header that will be fully refunded in on-demand batch finality relay (#2729) * select header that will be fully refunded for submission in on-demand **batch** finality relay * added the only possible test * spelling * nl * updated comment * backport some nits from #2727 * NotApplicable instead of Unroutable * Grafana update stuff (#2733) --------- Co-authored-by: Branislav Kontur <bkontur@gmail.com>
serban300
pushed a commit
to serban300/parity-bridges-common
that referenced
this pull request
Mar 27, 2024
… relay (paritytech#2729) * select header that will be fully refunded for submission in on-demand **batch** finality relay * added the only possible test * spelling * nl * updated comment
serban300
pushed a commit
to serban300/parity-bridges-common
that referenced
this pull request
Apr 8, 2024
… relay (paritytech#2729) * select header that will be fully refunded for submission in on-demand **batch** finality relay * added the only possible test * spelling * nl * updated comment
bkontur
added a commit
that referenced
this pull request
May 7, 2024
* separate constants for average and worst case relay headers (#2728) * separate constants for average and worst case relay headers * fix compilation * Select header that will be fully refunded in on-demand batch finality relay (#2729) * select header that will be fully refunded for submission in on-demand **batch** finality relay * added the only possible test * spelling * nl * updated comment * backport some nits from #2727 * NotApplicable instead of Unroutable * Grafana update stuff (#2733) --------- Co-authored-by: Branislav Kontur <bkontur@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a better alternative of #2728. The idea is to change relayer a bit and let it wait for the header that will be fully refunded (when speaking of its size) before submitting batch delivery/confirmation transaction. That allows us to have better bridge fee estimations:
As a backup plan for the breaking changes (when header size suddenly grows), the relayer will be "selecting" smaller header only a few times (4 atm). If after 4 attempts, the call size is still above maximal, it'll submit what it has.
The runtime code logic changes are minimal:
MAX_HEADER_SIZE + max_justification_size(AVERAGE_HEADER_SIZE), whereMAX_HEADER_SIZEwas90_000and max justification size was2 * 20_000 + some overhead for other fields. So max refundable call size was about90_000 + 40_000 = 130_000;120kb + 2 *1024 + overhead for other fields = 122kb + overhead for other fields. The other is for regular headers - it is somewhere near3Kb + overhead for other fields. Since we assume that mandatory header submission is mandatory for our bridge (and also rare), we could use the latter estimation for our batch transactions.The "core" of relayer logic changes is in the
relays/lib-substrate-relay/src/on_demand/headers.rsfile.What is left in this PR:
polkadotbinary (session time for Rococo and Westend increased from 1m to 5m) + modifiedsubstrate-relay(average Rococo header size is set to100bytes):