Limit max number of messages in delivery transaction (#541)

* limit max number of messages in delivery tx

* support max-messages-in-delivery-tx in relayer

* clippy

* clippy

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

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

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
This commit is contained in:
Svyatoslav Nikolsky
2020-12-03 09:44:52 +03:00
committed by Bastian Köcher
parent a872ee6ff1
commit f1949c6342
15 changed files with 427 additions and 68 deletions
+3
View File
@@ -100,12 +100,14 @@ impl frame_system::Trait for TestRuntime {
parameter_types! {
pub const MaxMessagesToPruneAtOnce: u64 = 10;
pub const MaxUnconfirmedMessagesAtInboundLane: u64 = 16;
pub const MaxMessagesInDeliveryTransaction: u64 = 128;
}
impl Trait for TestRuntime {
type Event = TestEvent;
type MaxMessagesToPruneAtOnce = MaxMessagesToPruneAtOnce;
type MaxUnconfirmedMessagesAtInboundLane = MaxUnconfirmedMessagesAtInboundLane;
type MaxMessagesInDeliveryTransaction = MaxMessagesInDeliveryTransaction;
type OutboundPayload = TestPayload;
type OutboundMessageFee = TestMessageFee;
@@ -279,6 +281,7 @@ impl SourceHeaderChain<TestMessageFee> for TestSourceHeaderChain {
fn verify_messages_proof(
proof: Self::MessagesProof,
_max_messages: MessageNonce,
) -> Result<ProvedMessages<Message<TestMessageFee>>, Self::Error> {
proof
.result