-
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
Select header that will be fully refunded in on-demand batch finality relay #2729
Select header that will be fully refunded in on-demand batch finality relay #2729
Conversation
… **batch** finality relay
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 !
Do you want to update subtree? I could do it also maybe with #2727 |
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 |
## 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
… 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
* 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>
… 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
… 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
* 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 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_SIZE
was90_000
and 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.rs
file.What is left in this PR:
polkadot
binary (session time for Rococo and Westend increased from 1m to 5m) + modifiedsubstrate-relay
(average Rococo header size is set to100
bytes):