Skip to content

fix(meta): refresh stale guardian versions#460

Draft
elsiribot wants to merge 1 commit into
fedimint:masterfrom
elsiribot:2026-05-debug-guardian-version
Draft

fix(meta): refresh stale guardian versions#460
elsiribot wants to merge 1 commit into
fedimint:masterfrom
elsiribot:2026-05-debug-guardian-version

Conversation

@elsiribot

Copy link
Copy Markdown

Summary

Fixes #458 — guardian versions getting stuck at an old cached value.

  • Rust (multimint.rs): The get_federation_meta path returned cached metadata unconditionally, ignoring staleness. It now checks the same CACHE_UPDATE_INTERVAL_SECS threshold used by the background refresh and re-caches when stale. Staleness logic is factored out into federation_meta_is_stale. Also tightens the background loop to use short-lived nc (non-committing) transactions per check instead of holding one open across the whole sweep.
  • Dart (fed_preview.dart): The federation preview only showed guardian versions captured at widget construction. It now refreshes federation metadata every 30s via getFederationMeta and maps guardian versions by peerId (instead of by list index, which assumed ordering).

Test plan

  • Open the federation preview for a federation where a guardian was just upgraded; verify the new version appears without restarting the app
  • Confirm the background refresh still updates FederationMetaKey on the documented cadence
  • Verify on-demand get_federation_meta callers see fresh data after the cache interval elapses

@m1sterc001guy

Copy link
Copy Markdown
Collaborator

Needs rebase

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Guardian versions getting stuck at old value

2 participants