mirror of
https://github.com/luxfi/chains.git
synced 2026-09-24 00:26:00 +00:00
Completes the bridge cross-chain release leg the recon flagged as missing. - internal/bridgeattest: the ONE canonical definition of the bridge-transfer attestation seam between B (bridgevm) and M (mpcvm). M threshold-signs a domain-bound bridge-transfer digest; B and every EVM gateway holding the group key's address verifies before mint/release. Domain-bound + replay-safe; test proves a signature over one transfer verifies for THAT transfer and no other. - evmclient.go: the concrete EVM ChainClient B instantiates per external EVM (Zoo 200201, Lux testnet C 96368) — chainClients was never populated because the interface had SendTransaction but no concrete EVM client; B could not broadcast a release. Now wired via evmByChainID in factory. - release.go: on a confirmed lock/burn in an accepted block, B builds the destination release call, obtains + verifies M's threshold attestation, and broadcasts to the destination gateway. Both directions (Zoo<->Lux). - attest.go: injects the two runtime deps (Warp->M, KMS relayer key) as clean interface boundaries rather than hard-wiring transports. Co-authored-by: Hanzo Dev <[email protected]>
29 lines
838 B
Go
29 lines
838 B
Go
// Copyright (C) 2019-2025, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package bridgevm
|
|
|
|
import (
|
|
"github.com/luxfi/ids"
|
|
"github.com/luxfi/log"
|
|
"github.com/luxfi/node/vms"
|
|
)
|
|
|
|
var _ vms.Factory = (*Factory)(nil)
|
|
|
|
// VMID is the unique identifier for BridgeVM (B-Chain)
|
|
var VMID = ids.ID{'b', 'r', 'i', 'd', 'g', 'e', 'v', 'm', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
|
|
|
// Factory creates new BridgeVM instances
|
|
type Factory struct{}
|
|
|
|
// New returns a new instance of the BridgeVM
|
|
func (f *Factory) New(logger log.Logger) (interface{}, error) {
|
|
return &VM{
|
|
pendingBlocks: make(map[ids.ID]*Block),
|
|
pendingBridges: make(map[ids.ID]*BridgeRequest),
|
|
chainClients: make(map[string]ChainClient),
|
|
evmByChainID: make(map[uint32]*evmChainClient),
|
|
}, nil
|
|
}
|