Skip to content

feat: add change-server support for bitcoin, bitcoincash, dogecoin, litecoin#448

Open
bobbythelobster wants to merge 1 commit into
EdgeApp:masterfrom
bobbythelobster:edgar/change-server-utxo
Open

feat: add change-server support for bitcoin, bitcoincash, dogecoin, litecoin#448
bobbythelobster wants to merge 1 commit into
EdgeApp:masterfrom
bobbythelobster:edgar/change-server-utxo

Conversation

@bobbythelobster
Copy link
Copy Markdown

Integrate the change-server protocol for UTXO engines following the contract in edge-core-js PR #718.

Key Changes

  • Upgrade edge-core-js to ^2.43.0 for change-server types
  • Wire onSubscribeAddresses callback through EngineEmitter
  • Add syncNetwork() to UtxoEngine for change-server wakeups
  • Gate block-height confirmation checks behind usesChangeServer
  • Set usesChangeServer: true for bitcoin, bitcoincash, dogecoin, litecoin

How It Works

When usesChangeServer is enabled:

  • Engine subscribes wallet addresses with core via onSubscribeAddresses
  • Core subscribes them on the change-server
  • On address activity, core calls syncNetwork({ subscribeParam })
  • Engine triggers address-scoped transaction + UTXO refresh (reusing existing processing)
  • Block events no longer queue per-tx confirmation fetches (the key optimization)
  • Unconfirmed→confirmed transitions discovered via address wakeups instead

When usesChangeServer is disabled:

  • All existing Blockbook-driven behavior unchanged

Contract compliance (per edge-core-js PR #718)

  • Set currencyInfo.usesChangeServer = true
  • Accept subscribedAddresses from core
  • Call onSubscribeAddresses() with wallet addresses on startup
  • Implement syncNetwork() for change-server wakeups
  • Keep ordinary Blockbook polling as fallback
  • Handle needsSync === false
  • Handle missing checkpoints
  • seenTxCheckpoint already implemented

Relates to Asana task 1213394471711299

…itecoin

Integrate the change-server protocol for UTXO engines following the
contract in edge-core-js PR #718.

Key changes:
- Upgrade edge-core-js to ^2.43.0 for change-server types
- Wire onSubscribeAddresses callback through EngineEmitter
- Add syncNetwork() to UtxoEngine
- Gate block-height confirmation checks behind usesChangeServer
- Set usesChangeServer for bitcoin, bitcoincash, dogecoin, litecoin
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