Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
12 changes: 6 additions & 6 deletions Cargo.lock

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

4 changes: 3 additions & 1 deletion consensus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,8 @@ impl<C, TxApi> CreateProposal<C, TxApi> where
use client::block_builder::BlockBuilder;
use runtime_primitives::traits::{Hash as HashT, BlakeTwo256};

const MAX_TRANSACTIONS: usize = 40;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is already MAX_TRANSACTIONS_SIZE constant, maybe move the two close to each other (rather move the other one here).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unfortunately it's not possible to move the MAX_TRANSACTIONS_SIZE down for now because it's used elsewhere.


let inherent_data = InherentData {
timestamp: self.believed_minimum_timestamp,
parachains: candidates,
Expand All @@ -648,7 +650,7 @@ impl<C, TxApi> CreateProposal<C, TxApi> where
let mut pending_size = 0;

let ready_iter = self.transaction_pool.ready();
for ready in ready_iter {
for ready in ready_iter.take(MAX_TRANSACTIONS) {
let encoded_size = ready.data.encode().len();
if pending_size + encoded_size >= MAX_TRANSACTIONS_SIZE {
break
Expand Down