Drop message decode max length to 4_000_000
It has been a long time since Bitcoin's maximum network message length was 32MB, so we should follow suit. This is also an important DoS limit, so we should limit it as much as possible.
This commit is contained in:
parent
c8ac25219a
commit
fe917765c0
|
@ -343,7 +343,7 @@ impl<R: Read> ReadExt for R {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Maximum size, in bytes, of a vector we are allowed to decode
|
/// Maximum size, in bytes, of a vector we are allowed to decode
|
||||||
pub const MAX_VEC_SIZE: usize = 32 * 1024 * 1024;
|
pub const MAX_VEC_SIZE: usize = 4_000_000;
|
||||||
|
|
||||||
/// Data which can be encoded in a consensus-consistent way
|
/// Data which can be encoded in a consensus-consistent way
|
||||||
pub trait Encodable {
|
pub trait Encodable {
|
||||||
|
|
Loading…
Reference in New Issue