Skip to content

dashboard: a Slipstream page, and withdrawing a slipstream tx from admin - #84

Draft
rsantacroce wants to merge 1 commit into
feat/slipstream-servicefrom
feat/slipstream-dashboard
Draft

rsantacroce wants to merge 1 commit into
feat/slipstream-servicefrom
feat/slipstream-dashboard

Conversation

@rsantacroce

Copy link
Copy Markdown
Collaborator

What

This is the dashboard half of slipstream, stacked on #83. Its base is feat/slipstream-service, so the diff here is only the dashboard. It retargets to main once #83 merges.

  • Public /slipstream is shown in the nav only when SLIPSTREAM_API_URL is set. It has four parts:
    • Fees: the minimum submission rate, the current mineable rate, what is required now, and how recently that was read from the template.
    • Submit: a curl line pointing at PUBLIC_SLIPSTREAM_URL, and a link to the pool's info.json.
    • Recent transactions: each with its fee rate and status.
      • Statuses: in template, mined, confirmed, or dropped/expired with a reason.
      • The block is shown with (ours) or (another pool).
  • Admin → Tools lists the txs that are still open, each with a Withdraw button (CSRF-gated like every admin action).
    • Withdrawing calls removeslipstreamtx on the enforcer (ENFORCER_GBT_URL), because the enforcer is what holds the txs.
    • On its next poll the service records the tx as dropped (withdrawn).
    • Without ENFORCER_GBT_URL the list still shows, but the buttons do not.

Design notes

  • The page reads the slipstream service's API, not slipstream.db. The service stays the only owner of its schema, and there is no second reader to keep in step.
  • If the service is down, the page says so. It costs the page one card, not the page, and the rest of the dashboard is unaffected.
  • Withdraw goes to the enforcer, not the service. The service has no authenticated surface to take it from, and the dashboard's admin auth already guards this route.

Testing

  • dashboard/test/slipstream.test.js (6 new tests):
    • The page renders both rates, the submit line, statuses and reasons.
    • It degrades when the service is down.
    • The nav link appears only when slipstream is enabled.
    • Admin tools lists open txs with withdraw forms.
    • fetchSlipstream works against a stub service.
    • Withdraw sends removeslipstreamtx to a stub enforcer.
  • The full dashboard suite passes: 195 tests.
  • Live, against a real stack: patched bitcoind (regtest), the enforcer from feat: accept slipstream txs on the block template server bip300301_enforcer#642 with --enable-slipstream, the slipstream service, and this dashboard.
    • A submitted non-standard tx was mined and confirmed. The page showed it as confirmed at its block height.
    • A second tx was withdrawn from Admin → Tools. The flash said withdrew 1 tx(s), the service recorded accepted, in_template, dropped (withdrawn), and the page showed it as dropped.

Found, not fixed here

Without a shares.db (a proxy that has never run), / returns 500 from views/index.ejs:71. This is the same on the base branch, so it is not from this change.

With SLIPSTREAM_API_URL set, the public nav gains /slipstream: the
minimum submission rate and current mineable rate, how to submit, and
each recent tx with where it stands -- in template, mined (ours or not),
confirmed, dropped with its reason. The page reads the slipstream
service's API rather than slipstream.db, so the service stays the only
owner of its schema, and a service that is down costs the page one card.

Admin -> Tools lists the txs still open, each with a Withdraw button.
That calls removeslipstreamtx on the enforcer, which holds the txs; the
service records the tx as dropped (withdrawn) on its next poll.
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.

1 participant