-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add new mode to apply load for tx set validation #5404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,11 @@ | |
| APPLY_LOAD_MODE="benchmark" | ||
| APPLY_LOAD_MODEL_TX="sac" | ||
|
|
||
| # Which timing path to use: "apply" preserves the historical apply-only | ||
| # benchmark, while "txset-validation-and-apply" simulates a non-leader receiving | ||
| # and validating a tx set before applying it. Tx-set creation is not measured. | ||
| APPLY_LOAD_TIMING_PHASES = "apply" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to add this to all the benchmark configs |
||
|
|
||
| # Whether to time the write part of the apply stage. This can be | ||
| # disabled to get less noisy results for non-write related changes, | ||
| # but should be enabled to get more comprehensive e2e numbers. | ||
|
|
@@ -62,4 +67,4 @@ NODE_SEED="SDQVDISRYN2JXBS7ICL7QJAEKB3HWBJFP2QECXG7GZICAHBK4UNJCWK2 self" | |
|
|
||
| [QUORUM_SET] | ||
| THRESHOLD_PERCENT=100 | ||
| VALIDATORS=["$self"] | ||
| VALIDATORS=["$self"] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,9 +20,11 @@ Common options can be placed at any place in the command line. | |
| Command options can only by placed after command. | ||
|
|
||
| * **apply-load**: Benchmarks Soroban transaction application time using | ||
| synthetic transactions. The benchmark is isolated to mostly just executing | ||
| the transactions and thus it omits a lot of the supporting mechanisms | ||
| (such as overlay, SCP, mempool etc). This command will generate enough | ||
| synthetic transactions. The benchmark omits the overlay and mempool, but | ||
| each iteration reconstructs the tx set from serialized bytes and runs real | ||
| consensus with the node as its own single-validator quorum. It does not | ||
| simulate network transport, peer fetching, or multi-node timing. | ||
|
Comment on lines
+23
to
+26
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can just say that it may measure txset stuff |
||
| This command will generate enough | ||
| transactions to fill up a synthetic transaction queue (it's just a list of | ||
| transactions with the same limits as the real queue), and then create a | ||
| transaction set off of that to apply. This can also be used to record the | ||
|
|
@@ -36,6 +38,20 @@ Command options can only by placed after command. | |
| consisting only of fast SAC transfer. | ||
| - `APPLY_LOAD_MODE="benchmark"`: benchmarks a fixed-size ledger of model | ||
| transactions. Use `APPLY_LOAD_MODEL_TX` to select the model transaction. | ||
| * `APPLY_LOAD_TIMING_PHASES` selects one of two timing paths: | ||
| - `"apply"`: the default historical apply-only benchmark. Its close helper | ||
| still calls `checkValid`, but that happens before the recorded ledger-close | ||
| timer and leaves the caches warm, as consensus validation would on a live | ||
| node. Output remains in the historical format. | ||
| - `"txset-validation-and-apply"`: simulates a non-leader receiving the tx | ||
| set over the wire, validating it through local consensus, and then applying | ||
| it. It reports validation, ledger close, and end-to-end time. Leader-side | ||
| tx-set creation and signing happen before the measured span. The signature | ||
| verification cache is cleared before validation, then retained so apply | ||
| sees the warm cache produced by validation. | ||
| `"txset-validation-and-apply"` is not supported with | ||
| `APPLY_LOAD_MODE="max-sac-tps"`; that search retains its historical | ||
| apply-only timing objective. | ||
| * Load generation is configured in the Core config file. The relevant settings | ||
| all begin with `APPLY_LOAD_`. See full example configurations with | ||
| per-setting documentation in the `docs` directory | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,6 +76,8 @@ HerderSCPDriver::SCPMetrics::SCPMetrics(Application& app) | |
| {"scp", "timing", "self-to-others-externalize-lag"})) | ||
| , mBallotBlockedOnTxSet(app.getMetrics().NewTimer( | ||
| {"scp", "timing", "ballot-blocked-on-txset"})) | ||
| , mTxSetValidation( | ||
| app.getMetrics().NewTimer({"herder", "txset", "validate"})) | ||
| , mEmptyTxSetExternalized( | ||
| app.getMetrics().NewCounter({"scp", "empty-tx-set", "externalized"})) | ||
| , mEmptyTxSetValueReplaced(app.getMetrics().NewCounter( | ||
|
|
@@ -1859,12 +1861,18 @@ HerderSCPDriver::checkAndCacheTxSetValid(TxSetXDRFrame const& txSet, | |
| LedgerHeaderHistoryEntry const& lcl, | ||
| uint64_t closeTimeOffset) const | ||
| { | ||
| ZoneScoped; | ||
|
|
||
| auto key = TxSetValidityKey{lcl.hash, txSet.getContentsHash(), | ||
| closeTimeOffset, closeTimeOffset}; | ||
|
|
||
| bool* pRes = mTxSetValidCache.maybeGet(key); | ||
| if (pRes == nullptr) | ||
| { | ||
| std::string zoneTxt("miss"); | ||
| ZoneText(zoneTxt.c_str(), zoneTxt.size()); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: You should be able to use one-line ZoneNamed here, as your string is static (same for 'hit' branch) |
||
| auto validationTime = mSCPMetrics.mTxSetValidation.TimeScope(); | ||
|
SirTyson marked this conversation as resolved.
|
||
|
|
||
| // The invariant here is that we only validate tx sets nominated | ||
| // to be applied to the current ledger state. However, in case | ||
| // if we receive a bad SCP value for the current state, we still | ||
|
|
@@ -1895,6 +1903,8 @@ HerderSCPDriver::checkAndCacheTxSetValid(TxSetXDRFrame const& txSet, | |
| } | ||
| else | ||
| { | ||
| std::string zoneTxt("hit"); | ||
| ZoneText(zoneTxt.c_str(), zoneTxt.size()); | ||
| return *pRes; | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I don't think it's correct to call the apply-only mode 'historical', both have a valid use case