Skip to content

Standardize polling - #656

Open
Randy808 wants to merge 1 commit into
Blockstream:masterfrom
Randy808:standardize-polling
Open

Standardize polling#656
Randy808 wants to merge 1 commit into
Blockstream:masterfrom
Randy808:standardize-polling

Conversation

@Randy808

@Randy808 Randy808 commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

To alleviate the burden on user rate limits, I reduced the polling cadence for some endpoints to something more manageable (and standardized polling intervals in const.js).

Here's a summary of the changes:

  • Standardized global chain-tip polling at 30s, while retaining navigation-triggered refreshes on block, transaction, and address pages, rate-limited to at most
    once every 5s
  • Changed recent mempool transaction polling from 5s to 30s
  • Changed mempool summary polling from 30s to 60s on mempool and unconfirmed-transaction pages
  • Changed fee-estimate polling to 60s on mempool, recent-transactions, and unconfirmed-transaction pages
  • Changed block-list refreshes to be tip-triggered, with a 10-minute fallback for same-height reorgs
  • Replaced timed confirmed-peg polling with block-triggered requests; retained 60s polling for pending peg transactions
  • Changed market chart refreshes from 60s to 10 minutes
  • Changed high-value asset refreshes from 60s to 10 minutes

To run locally, npm install and use the following snippets:

# Bitcoin
export API_URL=https://blockstream.info/api
export PORT=4999
source flavors/blockstream/config.env
source flavors/bitcoin-mainnet/config.env
npm run dev-server
# Liquid
export API_URL=https://blockstream.info/liquid/api
export PORT=5000
source flavors/blockstream/config.env
source flavors/liquid-mainnet/config.env
npm run dev-server

@Randy808
Randy808 force-pushed the standardize-polling branch from a86f603 to 1353a3b Compare August 17, 2026 20:53
@Randy808
Randy808 marked this pull request as ready for review August 17, 2026 20:54
Comment thread client/src/app.js

export const dashboardNewBlocks = (page$, latestBlock$) =>
page$
.switchMap(page => page && page.pathname == '/'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should we use view$ == 'dashBoard' instead of page.pathname == '/'?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

view$ has a loading state that would delay the establishment of the stream. Delaying the establishment of the stream might cause us to skip a new block ('new' being any block after the initial one) instead of just the initial one.

Comment thread client/src/app.js
, bitcoinMarketChartUrl = process.env.BITCOIN_MARKET_CHART_URL || 'https://api.coingecko.com/api/v3/coins/bitcoin/market_chart?vs_currency=usd&days=1&interval=hourly'
, blockTemplatePollIntervalMs = 30000
, blockTemplatePollIntervalMs = pollIntervalsMs.fast
, tipRequestThrottleMs = 5000

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It wasn't added to the new pollIntervalsMs table, even though the whole point of the PR was to consolidate all the intervals in one place. It's a minor issue.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The throttle is different from the polling. It represents how often the request can be made (mainly to limit event-triggered requests like navigating to tx page)

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