20260324 完成和routinator对齐snapshot delta replay correctness一致
This commit is contained in:
@@ -58,6 +58,14 @@ def load_timing_summary(bundle_root: Path) -> dict:
|
||||
return json.loads(timing_path.read_text(encoding="utf-8"))
|
||||
|
||||
|
||||
def load_json(path: Path) -> dict:
|
||||
return json.loads(require_path(path, "file").read_text(encoding="utf-8"))
|
||||
|
||||
|
||||
def lock_validation_time(lock_obj: dict, fallback_started_at: str) -> str:
|
||||
return lock_obj.get("validationTime") or lock_obj.get("validation_time") or fallback_started_at
|
||||
|
||||
|
||||
def build_case(bundle_root: Path, repo_root: Path, rir: str) -> dict:
|
||||
if rir not in RIR_CONFIG:
|
||||
raise SystemExit(
|
||||
@@ -76,6 +84,8 @@ def build_case(bundle_root: Path, repo_root: Path, rir: str) -> dict:
|
||||
delta_timing = require_path(rir_root / "timings" / "delta-replay.json", "file")
|
||||
base_timing_obj = json.loads(base_timing.read_text(encoding="utf-8"))
|
||||
delta_timing_obj = json.loads(delta_timing.read_text(encoding="utf-8"))
|
||||
base_locks_obj = load_json(rir_root / "base-locks.json")
|
||||
delta_locks_obj = load_json(rir_root / "locks-delta.json")
|
||||
|
||||
case = {
|
||||
"bundle_root": str(bundle_root),
|
||||
@@ -98,8 +108,12 @@ def build_case(bundle_root: Path, repo_root: Path, rir: str) -> dict:
|
||||
"tal_path": str(require_path(repo_root / cfg["tal"], "file")),
|
||||
"ta_path": str(require_path(repo_root / cfg["ta"], "file")),
|
||||
"validation_times": {
|
||||
"snapshot": base_timing_obj["startedAt"],
|
||||
"delta": delta_timing_obj["startedAt"],
|
||||
"snapshot": lock_validation_time(base_locks_obj, base_timing_obj["startedAt"]),
|
||||
"delta": lock_validation_time(delta_locks_obj, delta_timing_obj["startedAt"]),
|
||||
},
|
||||
"timing_started_at": {
|
||||
"snapshot_replay": base_timing_obj["startedAt"],
|
||||
"delta_replay": delta_timing_obj["startedAt"],
|
||||
},
|
||||
"routinator_timings": {
|
||||
"base_replay_seconds": float(durations["base-replay"]),
|
||||
|
||||
Reference in New Issue
Block a user