Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 17b63e9

Browse files
authored
ci: Update twotx.patch to apply properly (#3748)
1 parent 84a04d2 commit 17b63e9

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

token/twoxtx.patch

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
1-
From aa223c645791be158a597efb8579270dbe5bdd82 Mon Sep 17 00:00:00 2001
1+
From 1899e603ebf036b2d0ea0728907bd6f8ffc26406 Mon Sep 17 00:00:00 2001
22
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
55

6-
Try blind double of PACKET_DATA_SIZE; this double things across the
7-
board and is not a permanent solution.
86
---
9-
rpc/src/rpc.rs | 16 +++++++++++-----
7+
rpc/src/rpc.rs | 17 ++++++++++++-----
108
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(-)
1311

1412
diff --git a/rpc/src/rpc.rs b/rpc/src/rpc.rs
15-
index 8d5d12f033..9d46a315ce 100644
13+
index 11838cf1bc..f429fc5abb 100644
1614
--- a/rpc/src/rpc.rs
1715
+++ 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 {
1917
}
2018
}
2119

@@ -29,7 +27,7 @@ index 8d5d12f033..9d46a315ce 100644
2927
fn decode_and_deserialize<T>(
3028
encoded: String,
3129
encoding: TransactionBinaryEncoding,
32-
@@ -8285,7 +8288,7 @@ pub mod tests {
30+
@@ -8376,7 +8379,7 @@ pub mod tests {
3331
}
3432

3533
#[test]
@@ -38,7 +36,7 @@ index 8d5d12f033..9d46a315ce 100644
3836
let ff_tx = vec![0xffu8; PACKET_DATA_SIZE];
3937
let tx58 = bs58::encode(&ff_tx).into_string();
4038
assert_eq!(tx58.len(), MAX_BASE58_SIZE);
41-
@@ -8295,8 +8298,11 @@ pub mod tests {
39+
@@ -8386,8 +8389,12 @@ pub mod tests {
4240

4341
#[test]
4442
fn test_decode_and_deserialize_too_large_payloads_fail() {
@@ -49,11 +47,12 @@ index 8d5d12f033..9d46a315ce 100644
4947
+ // So, we need 4 - (PACKET_DATA_SIZE % 3) extra bytes to ensure we'll spill over
5048
+ let extra_bytes = 4 - (PACKET_DATA_SIZE % 3);
5149
+ let too_big = PACKET_DATA_SIZE + extra_bytes;
50+
+
5251
let tx_ser = vec![0xffu8; too_big];
52+
5353
let tx58 = bs58::encode(&tx_ser).into_string();
54-
let tx58_len = tx58.len();
5554
diff --git a/sdk/src/packet.rs b/sdk/src/packet.rs
56-
index 412375e35f..112d962fe8 100644
55+
index 08389860f9..12714028d7 100644
5756
--- a/sdk/src/packet.rs
5857
+++ b/sdk/src/packet.rs
5958
@@ -15,7 +15,8 @@ static_assertions::const_assert_eq!(PACKET_DATA_SIZE, 1232);
@@ -67,18 +66,21 @@ index 412375e35f..112d962fe8 100644
6766
bitflags! {
6867
#[repr(C)]
6968
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
7170
--- a/web3.js/src/transaction/constants.ts
7271
+++ b/web3.js/src/transaction/constants.ts
73-
@@ -5,7 +5,7 @@
72+
@@ -4,8 +4,10 @@
73+
* 1280 is IPv6 minimum MTU
7474
* 40 bytes is the size of the IPv6 header
7575
* 8 bytes is the size of the fragment header
76+
+ *
77+
+ * Double the minimum for larger transactions
7678
*/
7779
-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);
7981

8082
export const VERSION_PREFIX_MASK = 0x7f;
8183

8284
--
83-
2.37.2
85+
2.38.1
8486

0 commit comments

Comments
 (0)