Skip to content

Conversation

@msbrogli
Copy link
Member

@msbrogli msbrogli commented Jan 24, 2026

Motivation

Add HTTP API and CLI support for dry-running nano contract block execution without modifying state. This allows developers to inspect what would happen during NC execution for debugging and verification purposes.

Acceptance Criteria

  1. Add /nano_contract/dry_run HTTP endpoint that accepts either block_hash or tx_hash and returns detailed execution results
  2. Add x-nc-dry-run CLI command with --block-hash or --tx-hash options, supporting JSON and text output formats
  3. Add NCDryRunBlockExecutor that wraps NCBlockExecutor for read-only execution with in-memory voided state tracking
  4. Refactor NCBlockExecutor.execute_block() to accept a should_skip predicate

Checklist

  • If you are requesting a merge into master, confirm this code is production-ready and can be included in future releases as soon as it gets merged

@msbrogli msbrogli self-assigned this Jan 24, 2026
@msbrogli msbrogli requested a review from jansegre as a code owner January 24, 2026 06:06
@msbrogli msbrogli moved this from Todo to In Progress (WIP) in Hathor Network Jan 24, 2026
@msbrogli msbrogli changed the title Feat/nano dry run feat(nano): Add HTTP API and CLI to re-run blocks and nano transactions Jan 24, 2026
@msbrogli msbrogli changed the base branch from master to refactor/nano-block-executor-dryrun-2 January 24, 2026 06:07
self,
block: Block,
*,
dry_run: bool = False,
Copy link
Member Author

Choose a reason for hiding this comment

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

Remove dry_run.

Copy link
Member Author

Choose a reason for hiding this comment

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

Block executor is still checking if a transaction should be skipped or not based on tx.meta.voided_by. It works fine for the actual execution but not for the dry run.

@github-actions
Copy link

🐰 Bencher Report

Branchfeat/nano-dry-run
Testbedubuntu-22.04
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
minutes (m)
(Result Δ%)
Lower Boundary
minutes (m)
(Limit %)
Upper Boundary
minutes (m)
(Limit %)
sync-v2 (up to 20000 blocks)📈 view plot
🚷 view threshold
1.68 m
(-2.23%)Baseline: 1.72 m
1.55 m
(92.05%)
2.06 m
(81.48%)
🐰 View full continuous benchmarking report in Bencher

@msbrogli msbrogli force-pushed the feat/nano-dry-run branch 2 times, most recently from 2a64558 to 1fe053a Compare January 24, 2026 06:27
Copy link
Member Author

Choose a reason for hiding this comment

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

Still not running and saving the output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress (WIP)

Development

Successfully merging this pull request may close these issues.

2 participants