1
- From aa223c645791be158a597efb8579270dbe5bdd82 Mon Sep 17 00:00:00 2001
1
+ From 1899e603ebf036b2d0ea0728907bd6f8ffc26406 Mon Sep 17 00:00:00 2001
2
2
From: Jon Cinque <
[email protected] >
3
- Date: Wed, 31 Aug 2022 01:02:34 +0200
4
- Subject: [PATCH] [PATCH] feat: double PACKET_DATA_SIZE
3
+ Date: Mon, 24 Oct 2022 20:19:43 -0400
4
+ Subject: [PATCH] feat: double PACKET_DATA_SIZE
5
5
6
- Try blind double of PACKET_DATA_SIZE; this double things across the
7
- board and is not a permanent solution.
8
6
---
9
- rpc/src/rpc.rs | 16 +++++++++++-----
7
+ rpc/src/rpc.rs | 17 + +++++++++++-----
10
8
sdk/src/packet.rs | 3 ++-
11
- web3.js/src/transaction/constants.ts | 2 +-
12
- 3 files changed, 14 insertions(+), 7 deletions(-)
9
+ web3.js/src/transaction/constants.ts | 4 ++ +-
10
+ 3 files changed, 17 insertions(+), 7 deletions(-)
13
11
14
12
diff --git a/rpc/src/rpc.rs b/rpc/src/rpc.rs
15
- index 8d5d12f033..9d46a315ce 100644
13
+ index 11838cf1bc..f429fc5abb 100644
16
14
--- a/rpc/src/rpc.rs
17
15
+++ b/rpc/src/rpc.rs
18
- @@ -4393 ,8 +4393 ,11 @@ pub mod rpc_obsolete_v1_7 {
16
+ @@ -4415 ,8 +4415 ,11 @@ pub mod rpc_obsolete_v1_7 {
19
17
}
20
18
}
21
19
@@ -29,7 +27,7 @@ index 8d5d12f033..9d46a315ce 100644
29
27
fn decode_and_deserialize<T>(
30
28
encoded: String,
31
29
encoding: TransactionBinaryEncoding,
32
- @@ -8285 ,7 +8288 ,7 @@ pub mod tests {
30
+ @@ -8376 ,7 +8379 ,7 @@ pub mod tests {
33
31
}
34
32
35
33
#[test]
@@ -38,7 +36,7 @@ index 8d5d12f033..9d46a315ce 100644
38
36
let ff_tx = vec![0xffu8; PACKET_DATA_SIZE];
39
37
let tx58 = bs58::encode(&ff_tx).into_string();
40
38
assert_eq!(tx58.len(), MAX_BASE58_SIZE);
41
- @@ -8295 ,8 +8298,11 @@ pub mod tests {
39
+ @@ -8386 ,8 +8389,12 @@ pub mod tests {
42
40
43
41
#[test]
44
42
fn test_decode_and_deserialize_too_large_payloads_fail() {
@@ -49,11 +47,12 @@ index 8d5d12f033..9d46a315ce 100644
49
47
+ // So, we need 4 - (PACKET_DATA_SIZE % 3) extra bytes to ensure we'll spill over
50
48
+ let extra_bytes = 4 - (PACKET_DATA_SIZE % 3);
51
49
+ let too_big = PACKET_DATA_SIZE + extra_bytes;
50
+ +
52
51
let tx_ser = vec![0xffu8; too_big];
52
+
53
53
let tx58 = bs58::encode(&tx_ser).into_string();
54
- let tx58_len = tx58.len();
55
54
diff --git a/sdk/src/packet.rs b/sdk/src/packet.rs
56
- index 412375e35f..112d962fe8 100644
55
+ index 08389860f9..12714028d7 100644
57
56
--- a/sdk/src/packet.rs
58
57
+++ b/sdk/src/packet.rs
59
58
@@ -15,7 +15,8 @@ static_assertions::const_assert_eq!(PACKET_DATA_SIZE, 1232);
@@ -67,18 +66,21 @@ index 412375e35f..112d962fe8 100644
67
66
bitflags! {
68
67
#[repr(C)]
69
68
diff --git a/web3.js/src/transaction/constants.ts b/web3.js/src/transaction/constants.ts
70
- index 075337e8dc..618d48cdfd 100644
69
+ index 075337e8dc..3d4960464f 100644
71
70
--- a/web3.js/src/transaction/constants.ts
72
71
+++ b/web3.js/src/transaction/constants.ts
73
- @@ -5,7 +5,7 @@
72
+ @@ -4,8 +4,10 @@
73
+ * 1280 is IPv6 minimum MTU
74
74
* 40 bytes is the size of the IPv6 header
75
75
* 8 bytes is the size of the fragment header
76
+ + *
77
+ + * Double the minimum for larger transactions
76
78
*/
77
79
- export const PACKET_DATA_SIZE = 1280 - 40 - 8;
78
- + export const PACKET_DATA_SIZE = 2464 ;
80
+ + export const PACKET_DATA_SIZE = 2 * (1280 - 40 - 8) ;
79
81
80
82
export const VERSION_PREFIX_MASK = 0x7f;
81
83
82
84
- -
83
- 2.37.2
85
+ 2.38.1
84
86
0 commit comments