Skip to content

bridgevm: promote quote engine + swap store from cmd/bridge daemon#3

Merged
hanzo-dev merged 1 commit into
mainfrom
z/bridgevm-promote-from-daemon
May 28, 2026
Merged

bridgevm: promote quote engine + swap store from cmd/bridge daemon#3
hanzo-dev merged 1 commit into
mainfrom
z/bridgevm-promote-from-daemon

Conversation

@hanzo-dev
Copy link
Copy Markdown
Member

Summary

  • New bridge_estimateFee / bridge_submitRequest / bridge_getStatus / bridge_cancelRequest / bridge_health / bridge_getMPCPublicKey RPCs serve from the VM so any client (the daemon at cmd/bridge is one such client) reaches the same authoritative settlement.
  • QuoteEngine (quote.go) + SwapStore (swap_store.go) are added under bridgevm with full unit + end-to-end RPC test coverage.
  • LP-333 signer-set methods unchanged; BridgeSigner / BridgeMessageValidator already handled attestation aggregation so no changes were needed there.

This is the chain-side half of the depermissionless+non-custodial bridge architecture refocus. The matching daemon strip lives at luxfi/bridge#z/depermissionless.

Test plan

  • go test ./bridgevm/... -count=1 — 32 tests pass (15 new)
  • go vet ./bridgevm/... clean
  • gofmt -l bridgevm/ clean
  • downstream daemon (cmd/bridge) consumes new RPCs via existing internal/bchain client — verified via cmd/bridge integration suite on luxfi/bridge#z/depermissionless

The bridge is permissionless and non-custodial. Authoritative quote
math and swap state must live where the validator quorum runs
consensus — in this VM — not in any single daemon's local cache.
This change moves both into bridgevm and exposes them via JSON-RPC
so any client can reach the same settlement decisions.

New RPC methods:
  bridge_estimateFee     — authoritative quote computation
  bridge_submitRequest   — create + quote-snapshot
  bridge_getStatus       — read swap by id
  bridge_cancelRequest   — idempotent cancel
  bridge_health          — liveness probe
  bridge_getMPCPublicKey — threshold group public key

Architecture:
  - QuoteEngine     (quote.go)         StaticPriceFeed → quorum oracle later
  - SwapStore       (swap_store.go)    in-memory genesis impl; block-persistence next
  - Service methods (rpc.go)           JSON-RPC dispatch (snake + dot aliases)

Attestation aggregation already lived in bridge_signing.go via
BridgeSigner + BridgeMessageValidator — no changes needed there.

LP-333 signer-set methods unchanged.
@hanzo-dev hanzo-dev merged commit ed623cb into main May 28, 2026
1 check passed
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