fix(snapshot): import pm_oracle oracle-metrics fields (P1-P5) - #136
Merged
On1x merged 1 commit intoAug 6, 2026
Merged
Conversation
import_pm_oracles() previously skipped the oracle-metrics fields added by the P1-P5 commits (markets_in_dispute_window, disputes_awaiting_ response/decision, resolved_late_count, resolution_time_hist), so a snapshot taken after the upgrade lost them on import (gauges were re-derived by pm_seed_oracle_gauges only when dgpo.pm_oracle_gauges_ seeded was absent, and the forward-accumulating histogram/late counter were never recoverable). Forward-compatible import: fields are read only when present, so old snapshots (pre-upgrade) still import cleanly and keep the existing seed-on-first-block behavior; new snapshots preserve the gauges and the resolution-latency histogram. Display-only; no consensus impact. Matches the fc::array<share_type,8> serialization used by FC_REFLECT (base64 vector<char> via from_variant).
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
Follow-up to the P1-P5 oracle-metrics commits on
pm(#124):import_pm_oracles()inplugins/snapshot/plugin.cppskipped the five new display-onlypm_oracle_objectfields, so a snapshot taken after the upgrade lost them on import.Why it matters
markets_in_dispute_window,disputes_awaiting_response,disputes_awaiting_decision): were only recoverable whendgpo.pm_oracle_gauges_seededwas absent; if a post-upgrade snapshot carried the seeded flag, they stayed zeroed.resolved_late_count+resolution_time_hist: forward-accumulating (no seed) — previously impossible to recover on snapshot import; the histogram and late counter silently reset to 0.Change
plugins/snapshot/plugin.cpp, insideimport_pm_oracles():Forward-compatible:
contains()guards mean pre-upgrade snapshots (fields absent) import cleanly and keep the existing seed-on-first-block behavior; post-upgrade snapshots preserve gauges and the histogram.fc::array<share_type, 8>serializes through FC_REFLECT as a base64vector<char>and reads back via the genericfrom_variant(already used in this plugin forpacked_trxetc.).Verification
git diff --checkclean; single file, 13 insertions, no other changes.contains()-guarded import style exactly.