-
Notifications
You must be signed in to change notification settings - Fork 173
feat: mpool msg limits #5732
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
feat: mpool msg limits #5732
Conversation
9091ffe
to
39218ff
Compare
e4c59ae
to
6913987
Compare
# This test checks the limitations of the message pool, which can take a while. | ||
[[profile.default.overrides]] | ||
filter = 'test(message_pool::msgpool::selection::test_selection::message_selection_trimming_msgs_two_senders)' | ||
slow-timeout = { period = "120s", terminate-after = 3 } | ||
|
||
# This test checks the limitations of the message pool, which can take a while. | ||
[[profile.default.overrides]] | ||
filter = 'test(message_pool::msgpool::selection::test_selection::message_selection_trimming_msgs_two_senders_complex)' | ||
slow-timeout = { period = "120s", terminate-after = 3 } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be mitigated by #5812. I'm not certain that's the culprit, but my spidey senses tell me that it's the only reasonable possibility.
273cb4c
to
8a37ea8
Compare
@@ -218,7 +226,7 @@ impl Chains { | |||
chain_node.msgs.clear(); | |||
chain_node.valid = false; | |||
} else { | |||
chain_node.msgs.drain(0..i as usize + 1); | |||
chain_node.msgs.truncate(i as usize + 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
outstanding bug from 2021 that made on of the new tests fail
@@ -429,7 +439,7 @@ where | |||
let network_version = chain_config.network_version(ts.epoch()); | |||
|
|||
let min_gas = price_list_by_network_version(network_version) | |||
.on_chain_message(to_vec(m)?.len()) | |||
.on_chain_message(m.chain_length()?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
outstanding bug that made us overcharge for some messages (thus them or others not being selected)
if to_vec(msg)?.len() > 32 * 1024 { | ||
if to_vec(msg)?.len() > MAX_MESSAGE_SIZE { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lotus allows messages of up to 64 KiB, so should we.
7ab78c1
to
3ec807d
Compare
@@ -29,6 +33,253 @@ type Pending = HashMap<Address, HashMap<u64, SignedMessage>>; | |||
// A cap on maximum number of message to include in a block | |||
const MAX_BLOCK_MSGS: usize = 16000; | |||
const MAX_BLOCKS: usize = 15; | |||
const CBOR_GEN_LIMIT: usize = 8192; // Same limits as in Go's `cbor-gen`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add the link to the go code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now I see we are using two different types anyhow::Result
and Result
in lot of places, I feel we should use one for consistency. Not sure if this is the correct PR to resolve if at all, Otherwise, LGTM.
Summary of changes
Follow up of #5729.
Changes introduced in this pull request:
Reference issue to close (if applicable)
Closes #5730
Other information and links
Change checklist