metrics: anchor pq sig aggregate building time at interval 2 start#784
Open
ch4r10t33r wants to merge 3 commits into
Open
metrics: anchor pq sig aggregate building time at interval 2 start#784ch4r10t33r wants to merge 3 commits into
ch4r10t33r wants to merge 3 commits into
Conversation
Record lean_pq_sig_aggregated_signatures_building_time_seconds from the beginning of the aggregation slot interval through STARK proof completion, not just the xmss aggregate call. Expose related PQ production counters and extend the /metrics API fixture contract.
Resolve conflicts in: - packages/testing/.../api_endpoint.py: combine pq-sig and aggregate-coverage entries in the /metrics fixture contract - src/lean_spec/forks/lstar/spec.py: keep both math and time imports; preserve aggregation_interval_start plumbing alongside upstream's Interval arithmetic refactor - src/lean_spec/subspecs/metrics/registry.py: keep PQ_SIG bucket constant alongside aggregate-coverage section constants - tests/.../metrics/test_registry.py: merge pq-sig and coverage test cases
Previously the building-time clock was captured as time.perf_counter() inside tick_interval, immediately before calling aggregate(). That measures 'time since tick_interval fired' — not 'time since the aggregation interval boundary'. Host scheduling lag would silently under-report. Anchor instead at the wall-clock interval-2 start derived from chain config (genesis_time + store.time * MILLISECONDS_PER_INTERVAL). At each STARK proof completion observe time.time() - interval_start, clamped at 0 to guard against clock skew. aggregate() no longer needs the perf_counter parameter from tick_interval. Update the integration test to use a realistic genesis_time so the recorded duration is bounded (< 60s), which would catch any future regression that re-anchors against unix epoch.
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.
Summary
lean_pq_sig_aggregated_signatures_building_time_seconds(plus related PQ production counters) in the leanSpec metrics registry with leanMetrics-aligned buckets and help text.TypeOneMultiSignature.aggregate), including select/fill prep — not just the xmss prove call.tick_interval→aggregate); extend the/metricsAPI fixture contract and add registry + interval-2 integration tests.Test plan
uv run pytest tests/lean_spec/subspecs/metrics/test_registry.py --no-covuv run pytest tests/lean_spec/forks/lstar/forkchoice/test_store_attestations.py::test_interval_2_records_pq_sig_building_time_metric --no-cov