mirror of
https://github.com/luxfi/bridge.git
synced 2026-09-24 00:26:46 +00:00
Arbitrum, Optimism and Avalanche were in the picker on bridge.lux.network and the assembler had never heard of them. A swap to any of the three is accepted, takes the user's funds, and then cannot build the release — the failure lands after the money has moved, which is the worst place in the flow to find a gap. The cause was a second copy of data that already existed. The networks file declares `chainId` and `type: evm` per network; evmChainIDs said it again in Go, and the two drifted. configureEVM now reads the config, so a network the operator offers is a network the assembler knows by construction. The table stays as a fallback for a config that declares no id, and only for that. A network with no usable id stays unregistered rather than guessing. An EIP-155 id is signed into the transaction: a wrong one produces a signature valid on some OTHER chain, so refusing beats inventing. TestEveryOfferedEVMNetworkCanBeAssembled walks the config and fails on any EVM network the assembler lacks or disagrees with about the id. Verified by mutation — dropping Arbitrum reports it by name. The companion test checks the other direction: Bitcoin, Solana, TON and XRP must NOT be registered as EVM, because giving a chain an EIP-155 id it does not have is inventing a fact about it. TestEstateChainIDsAreConfigured now passes nil networks, keeping the fallback table as its subject rather than silently testing the config.