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

Signed extension to refund relayer at the target chain #1657

Merged
merged 25 commits into from
Dec 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
8999d63
add utlity pallet to the Millau runtime
svyatonik Nov 22, 2022
89a9268
RefundRelayerForMessagesDeliveryFromParachain prototype
svyatonik Nov 22, 2022
20f90aa
Merge branch 'master' into signed-extension-to-refund-relayer-at-targ…
svyatonik Nov 25, 2022
dc35853
done with RefundRelayerForMessagesDeliveryFromParachain::post_dispatch
svyatonik Nov 25, 2022
25e4c09
parse calls
svyatonik Nov 25, 2022
e72c723
check batch for obsolete headers/messages
svyatonik Nov 28, 2022
4bb3766
fmt
svyatonik Nov 28, 2022
54e350b
shorten generic arg names + add parachain id generic arg
svyatonik Nov 28, 2022
92cc156
check lane_id
svyatonik Nov 28, 2022
5dc098a
impl all state read functions
svyatonik Nov 28, 2022
29dc969
Merge branch 'master' into signed-extension-to-refund-relayer-at-targ…
svyatonik Nov 28, 2022
e581c4d
fix typos from review
svyatonik Nov 29, 2022
d067da3
renamed extension + reference issue from TODO
svyatonik Nov 29, 2022
8ab7c9f
tests for pre-dispaytch
svyatonik Nov 29, 2022
da8699e
renamed extension source file
svyatonik Nov 29, 2022
d2596ab
tests for post-dispatch
svyatonik Nov 29, 2022
3f5e08d
abstract fee calculation
svyatonik Nov 30, 2022
7d31015
clippy
svyatonik Nov 30, 2022
3258a8e
actually fix clippy
svyatonik Nov 30, 2022
ecf5f7c
Merge branch 'master' into signed-extension-to-refund-relayer-at-targ…
svyatonik Nov 30, 2022
9b3b5f3
Update bin/runtime-common/src/refund_relayer_extension.rs
svyatonik Dec 9, 2022
557fce8
Update bin/runtime-common/src/refund_relayer_extension.rs
svyatonik Dec 9, 2022
16686ee
Update bin/runtime-common/src/refund_relayer_extension.rs
svyatonik Dec 9, 2022
054d4e8
Update bin/runtime-common/src/refund_relayer_extension.rs
svyatonik Dec 9, 2022
948db62
Merge branch 'master' into signed-extension-to-refund-relayer-at-targ…
svyatonik Dec 9, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions bin/millau/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ pallet-sudo = { git = "https://github.com/paritytech/substrate", branch = "maste
pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-utility = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
Expand Down Expand Up @@ -113,6 +114,7 @@ std = [
"pallet-timestamp/std",
"pallet-transaction-payment-rpc-runtime-api/std",
"pallet-transaction-payment/std",
"pallet-utility/std",
"pallet-xcm/std",
"scale-info/std",
"sp-api/std",
Expand Down
8 changes: 8 additions & 0 deletions bin/millau/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,13 @@ impl pallet_bridge_parachains::Config<WithWestendParachainsInstance> for Runtime
type MaxParaHeadSize = MaxWestendParaHeadSize;
}

impl pallet_utility::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
type PalletsOrigin = OriginCaller;
type WeightInfo = ();
}

construct_runtime!(
pub enum Runtime where
Block = Block,
Expand All @@ -556,6 +563,7 @@ construct_runtime!(
{
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
Sudo: pallet_sudo::{Pallet, Call, Config<T>, Storage, Event<T>},
Utility: pallet_utility,

// Must be before session.
Aura: pallet_aura::{Pallet, Config<T>},
Expand Down
8 changes: 8 additions & 0 deletions bin/runtime-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ bp-runtime = { path = "../../primitives/runtime", default-features = false }
pallet-bridge-grandpa = { path = "../../modules/grandpa", default-features = false }
pallet-bridge-messages = { path = "../../modules/messages", default-features = false }
pallet-bridge-parachains = { path = "../../modules/parachains", default-features = false }
pallet-bridge-relayers = { path = "../../modules/relayers", default-features = false }

# Substrate dependencies

frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-utility = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
Expand All @@ -43,6 +46,8 @@ xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "master
xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "master", default-features = false }

[dev-dependencies]
bp-rialto = { path = "../../primitives/chain-rialto" }
bp-test-utils = { path = "../../primitives/test-utils" }
millau-runtime = { path = "../millau/runtime" }

[features]
Expand All @@ -61,6 +66,9 @@ std = [
"pallet-bridge-grandpa/std",
"pallet-bridge-messages/std",
"pallet-bridge-parachains/std",
"pallet-bridge-relayers/std",
"pallet-transaction-payment/std",
"pallet-utility/std",
"pallet-xcm/std",
"scale-info/std",
"sp-api/std",
Expand Down
3 changes: 2 additions & 1 deletion bin/runtime-common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub mod messages_api;
pub mod messages_benchmarking;
pub mod messages_extension;
pub mod parachains_benchmarking;
pub mod refund_relayer_extension;

mod messages_generation;

Expand Down Expand Up @@ -78,7 +79,7 @@ where
#[macro_export]
macro_rules! generate_bridge_reject_obsolete_headers_and_messages {
($call:ty, $account_id:ty, $($filter_call:ty),*) => {
#[derive(Clone, codec::Decode, codec::Encode, Eq, PartialEq, frame_support::RuntimeDebug, scale_info::TypeInfo)]
#[derive(Clone, codec::Decode, Default, codec::Encode, Eq, PartialEq, frame_support::RuntimeDebug, scale_info::TypeInfo)]
pub struct BridgeRejectObsoleteHeadersAndMessages;
impl sp_runtime::traits::SignedExtension for BridgeRejectObsoleteHeadersAndMessages {
const IDENTIFIER: &'static str = "BridgeRejectObsoleteHeadersAndMessages";
Expand Down
Loading