Skip to content

Commit 06af06f

Browse files
willcl-arkgithub-actions[bot]
authored andcommitted
support a full IBD PR run
1 parent bb1c0b7 commit 06af06f

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

bench.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,12 @@ def cmd_run(args: argparse.Namespace) -> int:
105105
return 1
106106
logger.info(f"Using matrix entry: {matrix_entry}")
107107

108+
# In full IBD mode, ignore datadir (sync from genesis)
109+
datadir = None if benchmark_config.full_ibd else args.datadir
110+
108111
# Build config with CLI args and benchmark config values
109112
cli_args: dict = {
110-
"datadir": args.datadir,
113+
"datadir": datadir,
111114
"tmp_datadir": args.tmp_datadir,
112115
"output_dir": args.output_dir,
113116
"no_cache_drop": args.no_cache_drop,

bench/benchmark_config.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class BenchmarkConfig:
2525
"""
2626

2727
# Benchmark metadata
28+
full_ibd: bool
2829
start_height: int
2930
runs: int
3031

@@ -78,8 +79,13 @@ def from_toml(cls, path: Path) -> BenchmarkConfig:
7879
instrumented = bitcoind.pop("instrumented", {})
7980
instrumented_debug = instrumented.get("debug", [])
8081

82+
# Full IBD mode: skip datadir copy, sync from genesis
83+
full_ibd = benchmark.get("full_ibd", False)
84+
start_height = 0 if full_ibd else benchmark.get("start_height", 0)
85+
8186
config = cls(
82-
start_height=benchmark.get("start_height", 0),
87+
full_ibd=full_ibd,
88+
start_height=start_height,
8389
runs=benchmark.get("runs", 3),
8490
matrix=matrix,
8591
bitcoind_args=bitcoind,
@@ -88,6 +94,8 @@ def from_toml(cls, path: Path) -> BenchmarkConfig:
8894
)
8995

9096
logger.info(f"Loaded benchmark config from {path}")
97+
if config.full_ibd:
98+
logger.info(" Mode: Full IBD (fresh sync from genesis)")
9199
logger.info(f" Start height: {config.start_height}, Runs: {config.runs}")
92100
if config.matrix:
93101
logger.info(f" Matrix parameters: {list(config.matrix.keys())}")
@@ -217,6 +225,7 @@ def to_dict(self) -> dict[str, Any]:
217225
This captures the config for logging with results.
218226
"""
219227
result: dict[str, Any] = {
228+
"full_ibd": self.full_ibd,
220229
"start_height": self.start_height,
221230
"runs": self.runs,
222231
"command_template": self.generate_command_template(),

0 commit comments

Comments
 (0)