Skip to content

Generic benchmark operation generator#5438

Merged
ndr-ds merged 1 commit intotestnet_conwayfrom
ndr-ds/generic-benchmark-operator
Feb 16, 2026
Merged

Generic benchmark operation generator#5438
ndr-ds merged 1 commit intotestnet_conwayfrom
ndr-ds/generic-benchmark-operator

Conversation

@ndr-ds
Copy link
Copy Markdown
Contributor

@ndr-ds ndr-ds commented Feb 13, 2026

Proposal

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.

Test Plan

  • CI
  • Manual benchmarking with both native and fungible tokens, with and without --single-destination-per-block

@ndr-ds ndr-ds force-pushed the ndr-ds/generic-benchmark-operator branch from 704ef5b to 14a2561 Compare February 13, 2026 16:25
@ndr-ds ndr-ds requested review from afck, deuszx and ma2bd February 13, 2026 18:17
})
}

fn get_next_destination(&mut self) -> ChainId {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: remove get_ (by analogy with iterators)?

Copy link
Copy Markdown
Contributor

@ma2bd ma2bd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice extension

@ndr-ds ndr-ds force-pushed the ndr-ds/generic-benchmark-operator branch from 14a2561 to b6c1664 Compare February 16, 2026 15:34
@ndr-ds ndr-ds merged commit fca3ee1 into testnet_conway Feb 16, 2026
75 of 77 checks passed
@ndr-ds ndr-ds deleted the ndr-ds/generic-benchmark-operator branch February 16, 2026 18:09
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants