Generic benchmark operation generator#5438
Merged
ndr-ds merged 1 commit intotestnet_conwayfrom Feb 16, 2026
Merged
Conversation
704ef5b to
14a2561
Compare
ma2bd
reviewed
Feb 14, 2026
linera-client/src/benchmark.rs
Outdated
| }) | ||
| } | ||
|
|
||
| fn get_next_destination(&mut self) -> ChainId { |
Contributor
There was a problem hiding this comment.
nit: remove get_ (by analogy with iterators)?
14a2561 to
b6c1664
Compare
ndr-ds
added a commit
that referenced
this pull request
Feb 17, 2026
Introduce an `OperationGenerator` trait that decouples operation generation from the benchmark loop, enabling custom application benchmarks without touching the core benchmark infrastructure. Key changes: - **New `OperationGenerator` trait**: defines a `generate_operations` interface that produces operations dynamically per block instead of pre-generating them. External crates can implement this trait to benchmark arbitrary applications (e.g., prediction market order benchmarking in `pm-app`). - **Two built-in generators**: `NativeFungibleTransferGenerator` and `FungibleTransferGenerator`, which replicate the existing behavior for native and fungible token transfer benchmarks respectively. - **Backport `--single-destination-per-block` CLI flag**: this already existed on `main` but was missing from the testnet branch. - **Per-chain unique owners**: each chain now gets its own unique owner instead of sharing one across a batch, avoiding conflicts during concurrent benchmarking. - **Removed `make_benchmark_block_info`**: replaced by dynamic per-block generation through the `OperationGenerator` trait. - **Skip wallet lookup when `close_chains` is true**: avoids picking up existing chains from the wallet that would then be closed after the benchmark, and skips writing the new temporary chains back to the wallet since they won't be reused. - CI - Manual benchmarking with both native and fungible tokens, with and without `--single-destination-per-block`
ndr-ds
added a commit
that referenced
this pull request
Feb 18, 2026
Introduce an `OperationGenerator` trait that decouples operation generation from the benchmark loop, enabling custom application benchmarks without touching the core benchmark infrastructure. Key changes: - **New `OperationGenerator` trait**: defines a `generate_operations` interface that produces operations dynamically per block instead of pre-generating them. External crates can implement this trait to benchmark arbitrary applications (e.g., prediction market order benchmarking in `pm-app`). - **Two built-in generators**: `NativeFungibleTransferGenerator` and `FungibleTransferGenerator`, which replicate the existing behavior for native and fungible token transfer benchmarks respectively. - **Backport `--single-destination-per-block` CLI flag**: this already existed on `main` but was missing from the testnet branch. - **Per-chain unique owners**: each chain now gets its own unique owner instead of sharing one across a batch, avoiding conflicts during concurrent benchmarking. - **Removed `make_benchmark_block_info`**: replaced by dynamic per-block generation through the `OperationGenerator` trait. - **Skip wallet lookup when `close_chains` is true**: avoids picking up existing chains from the wallet that would then be closed after the benchmark, and skips writing the new temporary chains back to the wallet since they won't be reused. - CI - Manual benchmarking with both native and fungible tokens, with and without `--single-destination-per-block`
github-merge-queue bot
pushed a commit
that referenced
this pull request
Feb 18, 2026
## Motivation Frontport of #5438 from `testnet_conway` to `main`. ## Proposal Cherry-pick of #5438 with conflict resolution: - Adopted `OperationGenerator` trait replacing `main`'s inline `generate_operations`/`create_operation`/`ChainDestinationManager` - Kept `ChainListenerStartupError` variant from `main` - Made `fungible_transfer` a module-level function - Removed unused `single_destination_per_block` parameter from internal benchmark methods (generators encapsulate this logic) ## Test Plan CI.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposal
Introduce an
OperationGeneratortrait that decouples operation generation from the benchmark loop, enabling customapplication benchmarks without touching the core benchmark infrastructure.
Key changes:
OperationGeneratortrait: defines agenerate_operationsinterface that produces operations dynamicallyper block instead of pre-generating them. External crates can implement this trait to benchmark arbitrary applications
(e.g., prediction market order benchmarking in
pm-app).NativeFungibleTransferGeneratorandFungibleTransferGenerator, which replicate theexisting behavior for native and fungible token transfer benchmarks respectively.
--single-destination-per-blockCLI flag: this already existed onmainbut was missing from thetestnet branch.
avoiding conflicts during concurrent benchmarking.
make_benchmark_block_info: replaced by dynamic per-block generation through theOperationGeneratortrait.
close_chainsis true: avoids picking up existing chains from the wallet that wouldthen be closed after the benchmark, and skips writing the new temporary chains back to the wallet since they won't be
reused.
Test Plan
--single-destination-per-block