You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Rename CAP-0083 + add meta example
This change renames `STELLAR_VALUE_SKIP` to `STELLAR_VALUE_EMPTY_TX_SET`
based on feedback on the name "skip" being misleading. It also adds
example `LedgerCloseData` meta.
* Fix a few missed "skip" usages that copilot found
The stellar-core repo contains [an example `LedgerCloseData` meta file demonstrating the application of a `STELLAR_VALUE_EMPTY_TX_SET` ledger](https://github.com/stellar/stellar-core/blob/master/test-lcm/HerderTests/370dd5e0af5cfa8d.xdr).
145
+
For readability, this CAP provides a JSON-ified version of this XDR below.
When the network votes to skip the ledger, validators will externalize a `StellarValue` with fields set as follows:
233
+
When the network votes to drop a transaction set, validators will externalize a `StellarValue` with fields set as follows:
149
234
150
235
*`txSetHash` : Set to `0x0`
151
236
*`closeTime` : Set as usual
152
237
*`upgrades` : Set as usual
153
-
*`ext` : Set to `STELLAR_VALUE_SKIP`
154
-
*`proposedValue` : Details about the original `StellarValue` that a quorum of validators decided to skip.
238
+
*`ext` : Set to `STELLAR_VALUE_EMPTY_TX_SET`
239
+
*`proposedValue` : Details about the original `StellarValue` that a quorum of validators decided to drop the transaction set from.
155
240
* `proposedValue.txSetHash` : The hash of the transaction set that was insufficiently disseminated or invalid.
156
-
* `proposedValue.previousLedgerHash` : The hash of the ledger prior to this one. Used to construct an empty transaction set corresponding to this skip value.
157
-
* `proposedValue.previousLedgerVersion` : The ledger version of the previous ledger. Used to construct an empty transaction set corresponding to this skip value.
241
+
* `proposedValue.previousLedgerHash` : The hash of the ledger prior to this one. Used to construct an empty transaction set corresponding to this empty-tx-set value.
242
+
* `proposedValue.previousLedgerVersion` : The ledger version of the previous ledger. Used to construct an empty transaction set corresponding to this empty-tx-set value.
158
243
* `proposedValue.lcValueSignature` : The signature from the original `StellarValue`. Can be used to determine which validator proposed the original `StellarValue`.
159
244
160
-
#### Skip Value Application
245
+
#### Empty Transaction Set Value Application
161
246
162
-
At apply time, ledgers containing a skip value should be treated as ledgers with
163
-
empty transaction sets. In every other way, they should be treated as normal
164
-
`STELLAR_VALUE_SIGNED` ledgers.
247
+
At apply time, ledgers containing a `STELLAR_VALUE_EMPTY_TX_SET` value should be
248
+
treated as any other ledger with an empty transaction set. In every other way,
249
+
they should be treated as normal `STELLAR_VALUE_SIGNED` ledgers.
165
250
166
251
### PREPARE Message Validation
167
252
@@ -177,20 +262,20 @@ ballots for `STELLAR_VALUE_SIGNED` values with invalid transaction sets.
177
262
178
263
We considered a few alternative methods to achieve parallel downloading of transaction sets before landing on this protocol change:
179
264
180
-
* Rather than skipping a ledger on failure to download a transaction set, we looked into rolling back SCP to an earlier phase. However, this would be a large change to SCP, which was not designed to ever step backwards. We decided it was cleaner, and easier to verify the change if validators instead voted to skip the current ledger.
181
-
* We analyzed how far along consensus a validator could safely proceed without a transaction set if there was no skip or rollback mechanism, and decided that the lack of such a mechanism was too limiting. Without some method for validators to agree that a transaction set is unavailable, it is only safe to proceed with early nomination voting.
265
+
* Rather than dropping a transaction set on failure to download a transaction set, we looked into rolling back SCP to an earlier phase. However, this would be a large change to SCP, which was not designed to ever step backwards. We decided it was cleaner, and easier to verify the change if validators instead voted to drop the transaction set from the current ledger.
266
+
* We analyzed how far along consensus a validator could safely proceed without a transaction set if there was no drop or rollback mechanism, and decided that the lack of such a mechanism was too limiting. Without some method for validators to agree that a transaction set is unavailable, it is only safe to proceed with early nomination voting.
182
267
183
268
## Protocol Upgrade Transition
184
269
185
-
`STELLAR_VALUE_SKIP` values will become valid on the network at the protocol boundary. However, validators will not generate them unless they have enabled parallel transaction set downloading. Parallel transaction set downloading will initially be disabled by default, and we would like to gradually enable it across the validator network.
270
+
`STELLAR_VALUE_EMPTY_TX_SET` values will become valid on the network at the protocol boundary. However, validators will not generate them unless they have enabled parallel transaction set downloading. Parallel transaction set downloading will initially be disabled by default, and we would like to gradually enable it across the validator network.
186
271
187
272
Validation of PREPARE messages will be relaxed at the protocol boundary.
188
273
189
274
### Downstream Impact
190
275
191
-
Downstream consumers of `StellarValue`s may require modification. Specifically, those that reason about `txSetHash` will need to handle the new `0x0` value, and those that reason about `ext` will need to handle the new `STELLAR_VALUE_SKIP` extension.
276
+
Downstream consumers of `StellarValue`s may require modification. Specifically, those that reason about `txSetHash` will need to handle the new `0x0` value, and those that reason about `ext` will need to handle the new `STELLAR_VALUE_EMPTY_TX_SET` extension.
192
277
193
-
To help determine if you depend on something that contains a `StellarValue`, transitive dependencies on `StellarValue` are as follows:
278
+
To help determine if you depend on something that contains a `StellarValue`, transitive dependencies on `StellarValue`(outside of the SCP messages already discussed in this CAP) are as follows:
194
279
```
195
280
StellarValue
196
281
│
@@ -209,7 +294,7 @@ StellarValue
209
294
└──► StoredDebugTransactionSet.scpValue
210
295
```
211
296
212
-
Downstream consumers of `StellarValue`s should treat skipped ledgers as empty ledgers.
297
+
Downstream consumers of `StellarValue`s should treat ledgers containing `STELLAR_VALUE_EMPTY_TX_SET` as empty ledgers.
213
298
214
299
### Backwards Incompatibilities
215
300
As detailed in the previous section, downstream consumers of `StellarValue`s may require modification.
@@ -218,15 +303,17 @@ As detailed in the previous section, downstream consumers of `StellarValue`s may
218
303
We expect this change to increase throughput on validators by expediting consensus. Simulation has shown this to be manageable. However, we will rollout the parallel downloading portion of this change slowly to ensure that real-world performance data matches simulation.
219
304
220
305
## Security Concerns
221
-
This CAP introduces a new method by which malicious validators could negatively impact the network. A malicious validator could introduce bad transaction set hashes, which then force the network to skip a ledger after some delay. However, this attack is mitigated by the following factors:
306
+
This CAP introduces a new method by which malicious validators could negatively impact the network. A malicious validator could introduce bad transaction set hashes, which then force the network to externalize an empty ledger after some delay. However, this attack is mitigated by the following factors:
222
307
223
308
* The attacker would have to win leader election to propose the bad value. This limits the frequency with which this attack can be pulled off.
224
-
* By design, we include the original value that was skipped in the `STELLAR_VALUE_SKIP` struct, including the signature for the value. This enables node operators to easily determine which validators are misbehaving and remove them from their quorum sets.
309
+
* By design, we include the original value that was dropped in the `STELLAR_VALUE_EMPTY_TX_SET` struct, including the signature for the value. This enables node operators to easily determine which validators are misbehaving and remove them from their quorum sets.
225
310
226
311
## Test Cases
227
-
TBD
312
+
The [pull request that implements this feature](https://github.com/stellar/stellar-core/pull/5209) contains many tests for it. Of particular interest to CAP readers might be the test "network externalizes empty-tx-set on missing value", which generates `LedgerCloseData` meta for `STELLAR_VALUE_EMPTY_TX_SET` ledgers when run with the `--capture-lcm` flag.
313
+
314
+
Future pull requests will introduce an automated test harness that stresses a large number of interleavings for transaction set arrival and SCP messages.
0 commit comments