Skip to content
Unverified Commit 2573d65e authored by Svyatoslav Nikolsky's avatar Svyatoslav Nikolsky Committed by GitHub
Browse files

Add option to only relay free headers to substrate-relay (#2884)

* added FreeHeadersInterval to pallet-bridge-grandpa configuration

* added is_free_execution_expected parameter to the submit_finality_proof_ex + check it from the transaction extension

* move transaction extensions to a separate folder

* move grandpa call result check from RefundTransactionExtensionAdapter to RefundBridgedGrandpaMessages

* added RefundBridgedMessages to refund and bump priority of standalone messages transactions

* check_obsolete_submit_finality_proof may now boost transaction priority (this is not used yet - see next commit)

* added CheckAndBoostBridgeGrandpaTransactions that checks whether bridge GRANDPA transactions are obsolete and, if not, it may apply priority boost to

* relayer may be slashed to explicit account

* slash registered relayer if it has submitted failed GRANDPA transaction

* allow accepting some parachain headers for free

* added FreeParachainUpdateForFreeRelayHeader

* fix benchmarks compilation

* added WeightInfoExt for pallet-bridge-grandpa to include extra wight coming from CheckAndBoostBridgeGrandpaTransactions

* added free_headers_interval to the (runtime) FinalityApi of the chain

* added --only-free-headers CLI parameter (not used yet) to finality and complex relay

* actually use HeadersToRelay::Free in finality-relay

* actually support only-free-headers mode in parachains relay

* removed inactual comment (free_source_headers_interval is cached at relay level)

* added comment re free-headers-only support in on-demand parachains relay

* added --only-free-headers support to standalone parachains relay

* fixed dependency in runtime-codegen

* update RBH and WBH runtimes + ask for free execution if we are running in HeadersToRelay::Free mode

* add missing standalone RBH<>WBH finality relay

* also refund for submitting initial parachain head

* make FreeHeadersRemaining an Option => we know that when we are outside of tx body, it is `None` and otherwise it is `Some`

* add some traces to relay

* add more traces to pallets

* check for reorgs in signed ext for parachains module

* fix benchmarks compilation

* free interval instead of fixed free headers

* updated relays for new free headers criteria

* fixed trace

* CannotAcceptMoreFreeHeaders -> FreeHeadersLimitExceded

* additional_call_result_check -> check_call_result_ex

* is_granda_call_succeeded -> is_grandpa_call_successful

* move tx priority boost from check_obsolete_submit_finality_proof to extension

* lost changes

* dec counter when importing new para header

* limit maximal "free" parachain head size

* added grandpa_and_parachain_pallets_share_free_headers_counter test

* with free intervals (instead of fixed free headers) we need to check `improved_by` from extension code

* fix test name

* added CheckAndBoostBridgeParachainsTransactions to boost parachain transactions priority

* check parachain id in CheckAndBoostBridgeParachainsTransactions

* use submit_parachain_head_call_ex in tests

* removed commented code

* changed condition for consistency

* include overweight from runtime signed extensions into submit_parachain_heads call weight

* fixed comment

* removed obsolete code comment

* added important comment + test

* some fixes

* fix no-std compile

* again fix lost change

* use submit_parachain_heads_ex for Rococo<>Westend bridge

* fix for mandatory + interval check in ext

* deleted moved files (merge conflict)

* update polkadot-sdk refs + fix compilation

* removed another moved file

* bump chain versions

* bump relayer version

* lock up
parent f14e95c4
Pipeline #469811 passed with stages
in 9 minutes and 48 seconds