Skip to content

Commit 70c4341

Browse files
author
AztecBot
committed
Merge branch 'next' into merge-train/avm
2 parents 9f51ccd + f94d8e8 commit 70c4341

File tree

4 files changed

+19
-39
lines changed

4 files changed

+19
-39
lines changed

noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/reset/read_request/get_propagated_read_requests.nr

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,5 @@ pub unconstrained fn get_propagated_read_requests<let ReadRequestLen: u32>(
1717
}
1818
}
1919

20-
// If not all read requests are propagated, we must still copy the first item beyond the claimed length into the
21-
// propagated array to prevent incorrect equality assertions in `validate_propagated_read_requests`.
22-
// See the implementation of `validate_propagated_read_requests` for more details.
23-
if read_requests.length != ReadRequestLen {
24-
let num_propagated = propagated_read_requests.length;
25-
propagated_read_requests.array[num_propagated] = read_requests.array[read_requests.length];
26-
}
27-
2820
propagated_read_requests
2921
}

noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/reset/read_request/tests/propagated_read_tests.nr

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,10 @@ fn extra_read_request_beyond_claimed_length() {
6464
let index_22 = builder.add_read_request(22);
6565
let read_request_22 = builder.read_requests.array[index_22];
6666

67-
// Change the claimed length to be 1, making the last read request irrelevant.
68-
// But it will be propagated, to the same index as the rest of the empty read requests, which should fail.
67+
// Change the claimed length to be 1, making the second read request (22) irrelevant.
6968
builder.read_requests.length = 1;
70-
71-
builder.build_propagated_read_requests();
72-
73-
assert_eq(builder.propagated_read_requests.length, 0);
74-
assert_array_eq(builder.propagated_read_requests.array, [read_request_22]);
69+
// Propagate it to the output at the new claimed length, where all un-validated read requests will be compared to.
70+
builder.propagated_read_requests.array[0] = read_request_22;
7571

7672
builder.validate();
7773
}
@@ -82,33 +78,25 @@ fn extra_identical_read_requests_beyond_claimed_length() {
8278

8379
builder.add_pending_read(1);
8480

85-
let index_11 = builder.add_read_request(11);
86-
let read_request_11 = builder.read_requests.array[index_11];
87-
88-
builder.add_settled_read(2);
89-
90-
let claimed_length = builder.read_requests.length;
81+
// Add a read request without hints.
82+
let index_22 = builder.add_read_request(22);
83+
let read_request_22 = builder.read_requests.array[index_22];
9184

92-
// Fill the read requests array with the same dummy read request.
93-
let mut dummy_read_request = read_request_11;
94-
dummy_read_request.inner.inner = 9999;
95-
for i in claimed_length..builder.read_requests.array.len() {
96-
builder.read_requests.array[i] = dummy_read_request;
85+
// Fill the read requests array with the same read request.
86+
for i in 2..builder.read_requests.array.len() {
87+
builder.read_requests.array[i] = read_request_22;
9788
}
9889

99-
// The claimed length doesn't change, making all dummy read requests irrelevant.
100-
assert_eq(builder.read_requests.length, claimed_length);
101-
102-
builder.build_propagated_read_requests();
90+
// Change the claimed length to be 1, making all read requests except the first one irrelevant.
91+
builder.read_requests.length = 1;
92+
// Propagate it to the output at the new claimed length, where the un-validated read requests will be compared to.
93+
builder.propagated_read_requests.array[0] = read_request_22;
10394

10495
builder.validate();
10596

106-
// The dummy read request is propagated. But the claimed length is correctly set to 1.
107-
assert_eq(builder.propagated_read_requests.length, 1);
108-
assert_array_eq(
109-
builder.propagated_read_requests.array,
110-
[read_request_11, dummy_read_request],
111-
);
97+
// The dummy read request is propagated. But the claimed length is correctly set to 0.
98+
assert_eq(builder.propagated_read_requests.length, 0);
99+
assert_array_eq(builder.propagated_read_requests.array, [read_request_22]);
112100
}
113101

114102
#[test(should_fail_with = "Incorrect propagated read requests length")]

spartan/environments/next-scenario.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ RPC_REPLICAS=2
2727

2828
PUBLISHERS_PER_PROVER=1
2929
PROVER_PUBLISHER_MNEMONIC_START_INDEX=8000
30-
PROVER_REPLICAS=6
30+
PROVER_REPLICAS=8
3131
PROVER_AGENTS_PER_PROVER=1
3232

3333
RUN_TESTS=true

yarn-project/end-to-end/src/spartan/mempool_limit.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ const config = setupEnvironment(process.env);
4949

5050
const debugLogger = createLogger('e2e:spartan-test:mempool_limiter');
5151

52-
const TX_FLOOD_SIZE = 30;
53-
const TX_MEMPOOL_LIMIT = 25;
52+
const TX_FLOOD_SIZE = 15;
53+
const TX_MEMPOOL_LIMIT = 10;
5454
const CONCURRENCY = 5;
5555

5656
describe('mempool limiter test', () => {

0 commit comments

Comments
 (0)