feat: add authenticated Zone benchmarking and scenarios#155
Merged
Conversation
This was referenced Jul 22, 2026
Rjected
marked this pull request as ready for review
July 22, 2026 16:30
Rjected
added a commit
that referenced
this pull request
Jul 22, 2026
Adds stderr progress reporting across benchmark setup, transaction generation, and scenario execution on top of #155, #156, and #157. It: - reports nonce discovery, total setup and workload transaction counts, and submission milestones; - reports generation progress for file output and stdout without mixing progress into generated output; and - reports scenario initialization, elapsed runtime, completed journeys, and active steps. This consolidates the standalone progress changes from #167 and #168 into #169.
Adds a Tempo-only `auth-token-map` command that derives a selected logical or root account pool from `WorkloadSpec` and writes the flat sender-to-token JSON consumed by Zone private-RPC authentication. It implements the canonical Zone digest and secp256k1 token encoding with fixed conformance vectors, one shared validity window per refresh, local signer recovery, scope and TTL validation, and rejection of maps that expire before publication. Output is deterministic lowercase JSON; files are atomically published with Unix mode `0600`, symlinks rejected, and one-shot replacement requires `--force`. Watch mode refreshes the complete map before expiry with bounded retries, retains the last valid file after failures, and handles SIGINT and SIGTERM. The command does not submit RPC requests. --------- Co-authored-by: zhygis <5236121+Zygimantass@users.noreply.github.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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.
Adds authenticated Zone benchmarking and a reusable multi-chain scenario runner on top of the existing workload/template system.
Authenticated RPC traffic
Generated and extracted transaction records now carry the logical on-chain sender.
bench sendcan map that address to a configurable HTTP header, reload atomically replaced maps, and route aggregate block and txpool queries through a separate--query-rpc-url. The selected credential follows submissions, retries, setup and inclusion receipt polling, reconciliation, and receipt collection while aggregate queries remain unauthenticated. Missing sender metadata or mappings fail before dispatch; malformed replacements leave the last valid map active. Legacy NDJSON remains accepted when sender authentication is disabled.Tempo keychain transactions use the authorized root user for authentication, while sponsored transactions use the transaction sender rather than the sponsor.
txgen-tempo auth-token-mapderives protocol-compatible tokens for an exact workload account pool, supports one-shot and watched refresh modes, and writes a sorted secret map through mode-0600atomic replacement without contacting the Zone RPC.Scenario execution and composition
Both chain binaries gain versioned
scenario run,scenario validate, andscenario rendercommands. Named chains reuse ordinary workload files and splitrpc_urlsubmission traffic from optionalquery_rpc_urlchain, nonce, checkpoint, confirmation, log, and adapter-query traffic. Per-chainrequest_authapplies the same sender-header map to submissions and sender-scoped receipt or transaction lookups.Scenarios compose
checkpoint, adapterinvoke, templatesubmit,wait_receipt, and decodedwait_logsteps through immutable typed saves, ABI encoding, and hash expressions. The runner preflights chain IDs, pending nonce state, templates, and setup materialization before mutating a chain, then submits and confirms setup in order. Runtime controls cover journey and transaction pacing, bounded concurrency, account leases, confirmations, step timeouts, andcontinueorfail-fastpolicies. Ambiguous post-dispatch outcomes disable further submissions on that chain to avoid unsafe nonce reuse. Failed or timed-out journeys are reported before the command exits nonzero.Reusable fragments support relative includes, typed parameters and outputs, nested aliases, namespaced saves, recursion and cycle detection, and source provenance in reports. Validation expands and checks composition, workloads, templates, ABIs, events, filters, and references without RPC access; rendering emits deterministic flattened YAML. Long-running generation, benchmark setup, scenario initialization, and active steps report progress on stderr.
Zone actions and receipt reporting
Tempo scenarios expose
prepare_encrypted_deposit, a query-only action that reads a stable ZonePortal encryption key and creates a fresh OS-random secp256k1/AES-GCM payload compatible with viem’s encrypted-deposit tuple format.Confirmed outer-transaction receipts feed distributions for
gas_used,effective_gas_price, andfee_paid = gas_used * effective_gas_price. Bench results group them by workload input; scenarios group them by chain, template, and expanded step. Each distribution includes count, min, mean, p50, p95, and p99. Missing fee fields do not discard gas usage, and collection remains receipt-based without tracing or internal-call attribution.Scenario JSON reports also include one client-generated
run_id, execution configuration, journey and step outcomes, latency distributions, sanitized failures, optional lifecycle samples, and fragment provenance.ClickHouse rollout and library impact
Migrations
006_txgen_scenario_runs.sqland007_txgen_scenario_steps.sqlmust be deployed before enabling scenario ClickHouse reporting. Publication writes JSON first, then synchronously inserts step rows, the scenario aggregate, and finallytxgen_runsas the visibility marker. Complete-run queries should begin attxgen_runsand join byrun_id. Receipt metrics are not persisted by the ClickHouse reporters in this change.The public Rust surface adds sender metadata, request-auth and authenticated RPC primitives, receipt aggregation, scenario schema/runtime/report types, online materialization helpers, nonce reservation rollback, and adapter scenario hooks.
txgen-cli::runnow requiresNetworkAdapter + Default, and fixed-size ABI byte values must match their declared length instead of being padded or truncated.