Skip to content

Feat/block replay time#7205

Open
rob-stacks wants to merge 16 commits into
stacks-network:developfrom
rob-stacks:feat/block_replay_time
Open

Feat/block replay time#7205
rob-stacks wants to merge 16 commits into
stacks-network:developfrom
rob-stacks:feat/block_replay_time

Conversation

@rob-stacks
Copy link
Copy Markdown
Contributor

Description

This simple patch adds a new information to every transaction in the blockreplay/simulate api: execution_time_millis

It is the amount of wall-clock milliseconds required for executing the transaction. It is a simple fallback for those platform
without hardware profiler support.

Note: the patch fixes a bunch of error in the openapi schema

Applicable issues

  • fixes #

Additional info (benefits, drawbacks, caveats)

Checklist

  • Test coverage for new or modified code paths
  • For new Clarity features or consensus changes, add property tests (see docs/property-testing.md)
  • Changelog fragment(s) or "no changelog" label added (see changelog.d/README.md)
  • Required documentation changes (e.g., rpc/openapi.yaml for RPC endpoints, event-dispatcher.md for new events)
  • New clarity functions have corresponding PR in clarity-benchmarking repo

Comment thread stackslib/src/net/api/blockreplay.rs Outdated
Comment thread stackslib/src/net/api/blockreplay.rs Outdated
Comment thread stackslib/src/net/api/blockreplay.rs Outdated
@coveralls
Copy link
Copy Markdown

coveralls commented May 18, 2026

Coverage Report for CI Build 26511304685

Coverage decreased (-3.4%) to 82.325%

Details

  • Coverage decreased (-3.4%) from the base build.
  • Patch coverage: 33 of 33 lines across 1 file are fully covered (100%).
  • 13725 coverage regressions across 183 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

13725 previously-covered lines in 183 files lost coverage.

Top 10 Files by Coverage Loss Lines Losing Coverage Coverage
stackslib/src/net/chat.rs 653 83.57%
stackslib/src/chainstate/stacks/transaction.rs 550 87.08%
stackslib/src/config/mod.rs 518 61.69%
stackslib/src/chainstate/burn/db/sortdb.rs 511 83.28%
stackslib/src/chainstate/stacks/db/transactions.rs 486 93.81%
clarity/src/vm/ast/parser/v2/lexer/mod.rs 468 58.39%
stackslib/src/net/mod.rs 410 74.14%
stackslib/src/chainstate/stacks/db/blocks.rs 296 86.39%
stackslib/src/chainstate/burn/operations/leader_key_register.rs 265 45.05%
stackslib/src/chainstate/stacks/index/storage.rs 261 80.6%

Coverage Stats

Coverage Status
Relevant Lines: 220673
Covered Lines: 181668
Line Coverage: 82.32%
Coverage Strength: 18368702.63 hits per line

💛 - Coveralls

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 20, 2026

CLA assistant check
All committers have signed the CLA.

Comment thread docs/rpc/components/schemas/block-replay-transaction.schema.yaml Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds wall-clock execution timing metrics to transactions returned by the Nakamoto blockreplay / blocksimulate RPC responses, intended as a fallback when hardware profiling isn’t available. The PR also attempts to update the OpenAPI schema for the replay transaction object.

Changes:

  • Add per-transaction wall-clock timing collection (execution_stats) during block (re)mining.
  • Refactor transaction RPC response to include an optional nested profiler object and attach timing data.
  • Update RPC schema + add changelog fragment (schema update currently has blocking correctness issues).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 8 comments.

File Description
stackslib/src/net/api/blockreplay.rs Adds timing tracker and exposes it in replay/simulate transaction responses; refactors profiler fields into a nested object.
stackslib/src/net/api/tests/blockreplay.rs Adds a basic assertion referencing the new timing field.
docs/rpc/components/schemas/block-replay-transaction.schema.yaml Attempts to document execution_stats (currently invalid schema + mismatched response shape).
changelog.d/block_replay_execution_stats.added Changelog entry for the new execution_stats response data.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread stackslib/src/net/api/blockreplay.rs
Comment thread stackslib/src/net/api/blockreplay.rs Outdated
Comment thread stackslib/src/net/api/blockreplay.rs
Comment thread stackslib/src/net/api/blockreplay.rs Outdated
Comment thread stackslib/src/net/api/tests/blockreplay.rs
Comment thread docs/rpc/components/schemas/block-replay-transaction.schema.yaml Outdated
Comment thread docs/rpc/components/schemas/block-replay-transaction.schema.yaml Outdated
Comment thread stackslib/src/net/api/blockreplay.rs
Comment thread docs/rpc/components/schemas/block-replay-transaction.schema.yaml Outdated
Comment thread docs/rpc/components/schemas/block-replay-transaction.schema.yaml
Comment thread docs/rpc/components/schemas/block-replay-transaction.schema.yaml
Comment thread stackslib/src/net/api/blockreplay.rs
Comment thread stackslib/src/net/api/blockreplay.rs Outdated
Copy link
Copy Markdown
Contributor

@federico-stacks federico-stacks left a comment

Choose a reason for hiding this comment

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

Heads-up: a bunch of jobs failed including OpenApi validation

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.

6 participants