-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Lower the max size of transaction packet to prevent going oversize. #9308
Conversation
It would indeed be nice to know what's causing the issue, so adding some traces in the propagator to check the estimated RLP size and the actual size when it overflows in |
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.
LGTM
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.
I agree with @ngotchac that it'd be nice to know more about the root cause of the problem but it seems worth trying with a lower packet size.
@@ -148,7 +148,8 @@ const MAX_PEER_LAG_PROPAGATION: BlockNumber = 20; | |||
const MAX_NEW_HASHES: usize = 64; | |||
const MAX_NEW_BLOCK_AGE: BlockNumber = 20; | |||
// maximal packet size with transactions (cannot be greater than 16MB - protocol limitation). | |||
const MAX_TRANSACTION_PACKET_SIZE: usize = 8 * 1024 * 1024; | |||
// keep it under 8MB as well, cause it seems that it may result oversized after compression. | |||
const MAX_TRANSACTION_PACKET_SIZE: usize = 5 * 1024 * 1024; |
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.
I don't understand. Before it was 8 * ...
, which is 8MBs, not 16, right?
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.
I believe this is the maximum size of a single transaction RLP. So if the final size is correct (and not increased by compression), you'd be able to fit at most three 5MB transactions, and have 1MB remaining for the rest of the packet.
Solves: #9255 (comment)
Still I'm quite unsure what could cause the packet to go oversize, it seems it might be a combination of:
estimate_size
in RLPMight be worth further debugging if someone is into it. @debris / @ngotchac ?