Limit max number of unconfirmed messages at inbound lane (#545)

* limit maximal number of unconfirmed messages at inbound lane

* unrewarded_relayer_entries API

* change relay to support max unrewarded relayer entries

* Update modules/message-lane/src/inbound_lane.rs

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* Update relays/messages-relay/src/message_lane_loop.rs

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>

* removed pub

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
This commit is contained in:
Svyatoslav Nikolsky
2020-12-08 13:58:07 +03:00
committed by Bastian Köcher
parent 93b3d49047
commit 2944f997d1
17 changed files with 321 additions and 52 deletions
+7
View File
@@ -429,6 +429,8 @@ impl pallet_shift_session_manager::Trait for Runtime {}
parameter_types! {
pub const MaxMessagesToPruneAtOnce: bp_message_lane::MessageNonce = 8;
pub const MaxUnrewardedRelayerEntriesAtInboundLane: bp_message_lane::MessageNonce =
bp_millau::MAX_UNREWARDED_RELAYER_ENTRIES_AT_INBOUND_LANE;
pub const MaxUnconfirmedMessagesAtInboundLane: bp_message_lane::MessageNonce =
bp_rialto::MAX_UNCONFIRMED_MESSAGES_AT_INBOUND_LANE;
pub const MaxMessagesInDeliveryTransaction: bp_message_lane::MessageNonce =
@@ -438,6 +440,7 @@ parameter_types! {
impl pallet_message_lane::Trait for Runtime {
type Event = Event;
type MaxMessagesToPruneAtOnce = MaxMessagesToPruneAtOnce;
type MaxUnrewardedRelayerEntriesAtInboundLane = MaxUnrewardedRelayerEntriesAtInboundLane;
type MaxUnconfirmedMessagesAtInboundLane = MaxUnconfirmedMessagesAtInboundLane;
type MaxMessagesInDeliveryTransaction = MaxMessagesInDeliveryTransaction;
@@ -743,6 +746,10 @@ impl_runtime_apis! {
fn latest_confirmed_nonce(lane: bp_message_lane::LaneId) -> bp_message_lane::MessageNonce {
BridgeMillauMessageLane::inbound_latest_confirmed_nonce(lane)
}
fn unrewarded_relayers_state(lane: bp_message_lane::LaneId) -> bp_message_lane::UnrewardedRelayersState {
BridgeMillauMessageLane::inbound_unrewarded_relayers_state(lane)
}
}
#[cfg(feature = "runtime-benchmarks")]