bridgevm: promote quote engine + swap store from cmd/bridge daemon#3
Merged
Conversation
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.
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bridge_estimateFee/bridge_submitRequest/bridge_getStatus/bridge_cancelRequest/bridge_health/bridge_getMPCPublicKeyRPCs serve from the VM so any client (the daemon atcmd/bridgeis 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.BridgeSigner/BridgeMessageValidatoralready 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/...cleangofmt -l bridgevm/cleaninternal/bchainclient — verified via cmd/bridge integration suite on luxfi/bridge#z/depermissionless