Skip to content

Commit 664bfe8

Browse files
author
Garand Tyson
committed
README: tx sets selected during the previous ballot; its one run at the goal fixture did not help
Describes the sixth experiment and its limits, and reports its run at 90 validators, 800 ms and 10,000 TPS (on m6id.8xlarge; the earlier runs of this fixture were on c6id.8xlarge): window 1 at 1,068 ms against 980 ms without it. The set was ready for 17% of the ledgers, and sets selected early after a built one were short, which filled the following sets to the cap. Not measured at 48 validators.
1 parent 2ae2b51 commit 664bfe8

1 file changed

Lines changed: 126 additions & 29 deletions

File tree

‎README.md‎

Lines changed: 126 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# stellar-core: leader schedule with terms, leader tx-set push, apply-time tx-set validation, transactions sent to the leaders only (experimental branch)
1+
# stellar-core: leader schedule with terms, leader tx-set push, apply-time tx-set validation, transactions sent to the leaders only, tx sets selected during the previous ballot (experimental branch)
22

33
**This branch is an experiment. It is not production code and must not run on a real network.**
44
The leader schedule and the tx-set push have no feature flag and no protocol gate, and the branch
@@ -16,13 +16,20 @@ instances**: at 48 validators (16 organizations) and 8,000 TPS, and at the goal
1616
ms (limit 960), a ledger every 0.90 s, 15.7 MB/s per node; with leader terms and pre-validation
1717
alone it is at 1,032 ms, 1.02 s per ledger and 43 MB/s.
1818

19+
**The sixth experiment (tx sets selected during the previous ballot) did not help at the goal
20+
fixture.** Measured once, on 2026-11-12, at 90 validators and 10,000 TPS on m6id.8xlarge (the
21+
CPU of c6id.8xlarge; no c6id capacity that evening): the first window is at 1,068 ms, against
22+
980 ms for the branch without it on c6id.8xlarge. The set was ready in time for 17% of the
23+
ledgers, and using it left the ledgers unevenly filled. It was not measured at 48 validators.
24+
Details: [What the sixth experiment did at the goal fixture](#what-the-sixth-experiment-did-at-the-goal-fixture).
25+
1926
The earlier benchmark (48 validators, 5,000 TPS, 1,000 ms, 4-core instances) is kept below.
2027

2128
## What this branch is
2229

2330
It is the overlay-v2 stack up to [#5459](https://github.com/stellar/stellar-core/pull/5459)
2431
(Rust overlay over QUIC, millisecond close times, compressed tx-set responses, leader-only tx-set
25-
construction) plus five experiments:
32+
construction) plus six experiments:
2633

2734
1. **No nomination** ([#5495](https://github.com/stellar/stellar-core/pull/5495)). The SCP
2835
nomination phase is deleted and replaced by a leader schedule that every node computes locally.
@@ -45,7 +52,7 @@ construction) plus five experiments:
4552
leaves in one flight instead of being paced over a round trip.
4653
- Details and limits: [docs/rust-overlay/txset-fetching.md](docs/rust-overlay/txset-fetching.md).
4754
3. **Vote without validating the tx set; validate and execute at apply**
48-
([#5498](https://github.com/stellar/stellar-core/pull/5498), the latest experiment). Gated on
55+
([#5498](https://github.com/stellar/stellar-core/pull/5498)). Gated on
4956
protocol 30; protocol 29 and older behave as before.
5057
- **Vote.** A node votes for the leader's value as soon as it holds the tx set, without running
5158
the set's validity check. Still checked before the vote: the value itself (signature, close
@@ -80,8 +87,8 @@ construction) plus five experiments:
8087
- **One build.** The first-round leader builds once, a lead time before its trigger, pushes
8188
the set as soon as it exists and proposes it unchanged at the trigger.
8289
5. **Transactions go to the upcoming leaders only**
83-
([#5501](https://github.com/stellar/stellar-core/pull/5501), the latest experiment). No
84-
protocol gate and no version negotiation.
90+
([#5501](https://github.com/stellar/stellar-core/pull/5501)). No protocol gate and no
91+
version negotiation.
8592
- **Targets.** A node that accepts a transaction no longer advertises it to every peer. Its
8693
overlay sends the body straight to the leaders of the node's current round and of the next
8794
one for the next ledger and, one ledger before a new leader term starts, to that term's
@@ -97,11 +104,37 @@ construction) plus five experiments:
97104
connection key, signed by the node key.
98105
- **Cost.** Followers no longer hold the transactions before the leader's set arrives, so
99106
they verify signatures when they check the set at apply instead of in the background.
100-
101-
Unchanged by all five: the ballot protocol's accept, confirm and commit rules. For a valid tx
107+
6. **The leader selects its next set during the previous ballot and executes its own set
108+
before the trigger** ([#NNNN](https://github.com/stellar/stellar-core/pull/NNNN), the latest
109+
experiment). No protocol gate; nothing on the wire changes.
110+
- **Why.** A set names the hash of the ledger it goes on top of, so its build could not
111+
start before that ledger had closed. At 90 validators the build (0.24 s) was the first
112+
0.29 s of every ledger.
113+
- **Selection.** The node that expects to lead the next ledger takes the pre-validation of
114+
experiment 4 one step further: when its candidates are validated, a background thread
115+
trims and surge-prices them against the state its speculative execution left, and writes
116+
the set without a parent.
117+
- **Completion.** When the ledger has closed with the value that was executed, the leader
118+
only names it as the parent, hashes the set and pushes it. It does so only if a build
119+
would have to start at once (the trigger is due, or less than a build's lead time away)
120+
and a build of that size would take time; otherwise it builds as before, from a fresher
121+
mempool. The selection is dropped if the ledger closed with another value, if the limits
122+
changed, or if a time-bounded transaction is not valid for the close time the set gets.
123+
- **Early execution.** The leader hands its prepared set to its apply thread as soon as the
124+
set is ready, instead of at the trigger. If that execution finds the set invalid before
125+
the proposal, the set is not proposed.
126+
- **Checks.** The builder still validates the structure of what it selected before the set
127+
leaves it. Re-reading the written XDR and validating the result now happens on a
128+
background thread, after the push.
129+
- **Cost.** A set selected early holds what the mempool held when the previous ledger was
130+
executed: transactions that arrive during the rest of that ledger's ballot wait for the
131+
next set.
132+
133+
Unchanged by all six: the ballot protocol's accept, confirm and commit rules. For a valid tx
102134
set, ledger state and meta are also unchanged; experiment 3 changes when a set is validated and
103135
executed, and what an invalid set does to the ledger; experiment 4 changes who leads; experiment
104-
5 changes which transactions reach a leader, and which submissions a node refuses.
136+
5 changes which transactions reach a leader, and which submissions a node refuses; experiment 6
137+
changes when a leader chooses its transactions and when it starts executing its own set.
105138

106139
## Performance results
107140

@@ -146,28 +179,31 @@ per build, all on 2026-11-12. "Base" is this branch up to experiment 3.
146179

147180
### 800 ms target at the goal: 90 validators, 10,000 TPS
148181

149-
30 organizations, 22-23 validators per region, the same instances and load shape, 10,080 TPS
150-
offered. Both runs missed their first window and the load was stopped after it.
182+
30 organizations, 22-23 validators per region, the same load shape, 10,080 TPS offered. All
183+
three runs missed their first window and the load was stopped after it. The first two ran on
184+
c6id.8xlarge; the third, eleven hours later, on m6id.8xlarge (the same CPU model and core
185+
count, 128 GiB instead of 64, other availability zones), because c6id.8xlarge could not be
186+
had: it differs from the second in the build **and** in the instance type.
151187

152-
| Window 1 | Leader terms and pre-validation (#5502, `8aa7f6bf0`) | + transactions to leaders only (#5501, `6ab837c27`) |
153-
|---|---:|---:|
154-
| p75, average over 90 nodes (limit 960 ms) | 1,032 ms | **980 ms** |
155-
| p99, average over 90 nodes (limit 1,600 ms) | 1,887 ms (over) | **1,441 ms** (inside) |
156-
| Time per ledger | 1.02 s | **0.90 s** (median 0.88 s) |
157-
| The first minute of the load | 802 ms for 30 s, then a backlog | 805 ms over the whole minute |
158-
| Tx sets at the 10,000 cap | 93% | 39% |
159-
| Leader builds finished before the trigger | 0 of 40 sampled | 40 of 55 sampled |
160-
| Leader build; candidates in the mempool | 0.33 s; 20,200 | 0.24 s; 8,350 (median) |
161-
| Trigger to first ballot | 0.58 s | **0.39 s** |
162-
| First ballot to externalize | 0.32 s | 0.32 s |
163-
| Externalize to ledger closed | 0.07 s | 0.07 s |
164-
| **Trigger to ledger closed** | 0.97 s | **0.77 s** |
165-
| Tx set at a follower after the proposal | 0.23 s | 0.17 s |
166-
| Tx-set validation at apply | (not listed) | 0.14 s |
167-
| **Overlay traffic per node, each way** | 43 MB/s | **15.7 MB/s** |
168-
| Leader and ballot timeouts, empty tx sets | 0 | 0 |
169-
| Submitted against included at the end | 49,855 short (backlog) | 81 more (the backlog drained) |
170-
| Run verdict | FAIL (block time: p75 and p99) | FAIL (block time: p75) |
188+
| Window 1 | Leader terms and pre-validation (#5502, `8aa7f6bf0`) | + transactions to leaders only (#5501, `6ab837c27`) | + sets selected during the previous ballot (experiment 6, `18a3a0238`), **on m6id.8xlarge** |
189+
|---|---:|---:|---:|
190+
| p75, average over 90 nodes (limit 960 ms) | 1,032 ms | **980 ms** | 1,068 ms |
191+
| p99, average over 90 nodes (limit 1,600 ms) | 1,887 ms (over) | **1,441 ms** (inside) | 1,664 ms (over) |
192+
| Time per ledger | 1.02 s | **0.90 s** (median 0.88 s) | 1.03 s (median 1.03 s) |
193+
| The first minute of the load | 802 ms for 30 s, then a backlog | 805 ms over the whole minute | 834 ms (median 806 ms); 23 of 72 sets at the cap |
194+
| Tx sets at the 10,000 cap | 93% | 39% | 91% |
195+
| Leader builds finished before the trigger | 0 of 40 sampled | 40 of 55 sampled | 10 of 20 sampled sets ready before the trigger (6 of them selected early) |
196+
| Leader build; candidates in the mempool | 0.33 s; 20,200 | 0.24 s; 8,350 (median) | 0.30 s; 20,200 (median) |
197+
| Trigger to first ballot | 0.58 s | **0.39 s** | 0.56 s |
198+
| First ballot to externalize | 0.32 s | 0.32 s | 0.33 s |
199+
| Externalize to ledger closed | 0.07 s | 0.07 s | 0.07 s |
200+
| **Trigger to ledger closed** | 0.97 s | **0.77 s** | 0.95 s |
201+
| Tx set at a follower after the proposal | 0.23 s | 0.17 s | 0.23 s |
202+
| Tx-set validation at apply | (not listed) | 0.14 s | 0.16 s |
203+
| **Overlay traffic per node, each way** | 43 MB/s | **15.7 MB/s** | 14.2 MB/s |
204+
| Leader and ballot timeouts, empty tx sets | 0 | 0 | 0 |
205+
| Submitted against included at the end | 49,855 short (backlog) | 81 more (the backlog drained) | not compared (load stopped in a backlog) |
206+
| Run verdict | FAIL (block time: p75 and p99) | FAIL (block time: p75) | FAIL (block time: p75 and p99) |
171207

172208
- **Neither build holds 800 ms at 90 validators and 10,000 TPS.** With transactions sent to the
173209
leaders only the miss is 20 ms on the window's p75 instead of 72 ms, p99 stays inside its
@@ -180,6 +216,41 @@ offered. Both runs missed their first window and the load was stopped after it.
180216
- There is no run of the base (up to experiment 3) at this fixture. In the #5502 column, the
181217
set's arrival, the build and the traffic are from that PR's first run at this fixture
182218
(`deec2d87c`, 1,046 ms); its rerun with `8aa7f6bf0` reported the same stage table.
219+
- **Experiment 6 made this fixture worse in its one run**: 1,068 ms against 980 ms, with the
220+
network in a backlog within the first minute. The next section says why. There is no run of
221+
experiments 1 to 5 on m6id.8xlarge to separate the instance type from the change.
222+
223+
### What the sixth experiment did at the goal fixture
224+
225+
One run (`18a3a0238`, 90 x m6id.8xlarge, 2026-11-12), read from the logs of twelve nodes and
226+
the network's metrics. Trigger to first ballot and the other stage rows of the table above are
227+
means over the window, in which the network was already in a backlog.
228+
229+
| | |
230+
|---|---|
231+
| Ledgers for which the leader used a set selected early | 75 of about 433 (17%); 269 times the selection was not finished when the previous ledger closed; none on a term's first ledger |
232+
| Time the background job needs after the leader's execution | 0.40 s: validation 0.18 s (0.05 s before, when it decoded less), selection 0.22 s |
233+
| Completing an early set at the close | 0.024 s, against a build of 0.30 s |
234+
| Leader's cycle (previous close to close), early set / built set | 0.74 s (6 sampled ledgers) / 1.01 s (14) |
235+
| Transactions in the first early set after a built one | 4,620, 4,875, 4,787, 5,022 on the sampled leaders (a ledger has to carry about 8,060) |
236+
| Sets found invalid at apply; failed self-checks; dropped executions | 0; 0 of 432; 0 of 39,006 |
237+
238+
1. **The selection was rarely ready.** It can only start when the leader has executed the
239+
previous ledger, and it took 0.4 s, about what is left of that ledger's ballot. The estimate
240+
it was built on was 0.15 to 0.3 s.
241+
2. **Where it was ready, it did what it was built for**: the set was pushed when the previous
242+
ledger closed, and those ledgers took 0.74 s instead of 1.01 s.
243+
3. **But a set selected early is short when the ledger before it was built at its close.** It
244+
holds what reached the mempool in the 0.3 to 0.5 s between that build's pull and its own.
245+
What it leaves behind fills the next built set to the 10,000 cap. A capped set takes longer
246+
to push, validate and agree on, so its ledger is late and the next trigger is already due.
247+
In the first minute of the load 23 of 72 sets were at the cap and 12 held fewer than 6,000
248+
transactions; in the run without experiment 6 that minute had 2 capped sets and ran at
249+
805 ms.
250+
4. **Moving the builder's checks gained little**: the structural check that stays in front of
251+
the push takes 0.037 s at these sizes; the two that moved to the background took 0.05 s.
252+
5. Not built: using an early set only when it is full (which is the backlog, where the build
253+
is on the critical path), and a job that fits into the ballot.
183254

184255
### Where a ledger's time goes at 90 validators and 10,000 TPS
185256

@@ -550,6 +621,28 @@ Defaults that matter: validators as generators, `--scp-timeout-ms 2000`,
550621

551622
## Known limitations of the prototype
552623

624+
Tx sets selected during the previous ballot, and the leader's early execution:
625+
- A set selected early holds what the mempool held when the previous ledger was executed.
626+
Transactions that arrive during the rest of that ledger's ballot wait for the next set.
627+
Submit-to-apply latency was not measured.
628+
- The set still names its parent's header hash, which exists only once the parent is committed
629+
(it contains the bucket-list hash), so the set cannot be pushed before the previous ledger
630+
closes. Computing that hash earlier means running the commit's bucket-list work on copies
631+
before externalize; not attempted.
632+
- The first ledger of a leader term gains little: its leader executed the previous ledger as a
633+
follower, shortly before consensus, and its selection is rarely ready in time.
634+
- The selection runs on a background thread next to the validation tasks. With real transaction
635+
execution it would compete with the apply thread for cores; apply is a sleep in every run
636+
here.
637+
- Time-bounded transactions of a set selected early are validated again on the main thread at
638+
the close when the close time's second moved. The load in these runs has no time bounds.
639+
- Re-reading the written set is no longer done before the push and the proposal. A fault that
640+
only that check would catch closes a ledger without transactions and costs the leader its
641+
term, where the builder used to stop. The structure of the selection and the shape of the
642+
XDR are still checked first.
643+
- The tie-break among candidates with equal fee rates in a set selected early is seeded from a
644+
node secret; no test observes it.
645+
553646
Transactions to the leaders only:
554647
- No protocol gate and no version negotiation: a node without the change ignores the identity
555648
stream, and nodes with the change flood toward it.
@@ -617,6 +710,10 @@ Leader schedule:
617710
Unchanged from stellar-core: see [INSTALL.md](./INSTALL.md), [CONTRIBUTING.md](./CONTRIBUTING.md)
618711
and [`./docs`](./docs).
619712

713+
Test status with experiment 6 (the commit before this README change): the full test suite
714+
passes (657 test cases), also with `--all-versions`; the new tests also pass under
715+
AddressSanitizer.
716+
620717
Test status with experiments 4 and 5 (`6ab837c27`, #5501 on top of #5502): the full test suite
621718
passes, also with `--all-versions`, including the Rust overlay's tests.
622719

0 commit comments

Comments
 (0)