Skip to content

DAO-1983 (C2/6): BlockTimeProvider + QueryClient default refetch#2093

Open
TravellerOnTheRun wants to merge 3 commits into
mainfrom
dao-1983-c2
Open

DAO-1983 (C2/6): BlockTimeProvider + QueryClient default refetch#2093
TravellerOnTheRun wants to merge 3 commits into
mainfrom
dao-1983-c2

Conversation

@TravellerOnTheRun

Copy link
Copy Markdown
Contributor

Why

Hardcoded “refresh every 60s” and “assume N seconds per block” made the UI stale (on-chain data lagging real block time) and misleading for countdowns. This PR introduces a provider that loads the chain’s average block time, exposes it where needed, and sets React Query’s default refetchInterval so wagmi/on-chain reads can track the chain without every hook copying the same magic number.

AVERAGE_BLOCKTIME stays exported until later PRs finish migrating call sites—so the tree stays type-clean and CI stays green at each step.

What to check

  • App boots with BlockTimeProvider after QueryClientProvider.
  • Graceful behavior if Blockscout fails (fallback interval).

Stack

Depends on C1 (or main once C1 is merged). Next: C3–C6 migrate hooks and finally remove the legacy constants.

…C1/6)

Pure fetch + Vitest; minimal barrel export. No provider yet.
…O-1983 C2/6)

Fetch average block time from Blockscout; set default refetch interval.
Legacy AVERAGE_BLOCKTIME constant kept until call sites are migrated.
@github-actions

github-actions Bot commented Apr 13, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@TravellerOnTheRun TravellerOnTheRun self-assigned this Apr 13, 2026
@TravellerOnTheRun TravellerOnTheRun requested a review from a team April 13, 2026 12:49
</BoosterProvider>
</BuilderContextProviderWithPrices>
</ConnectWalletProvider>
</BlockTimeProvider>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wooooooooow! provider hell. Suggestion: use Zustand instead of providers. It reduces boilerplate and does't add extra providers

Base automatically changed from dao-1983-c1 to main April 28, 2026 08:20
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.

2 participants