Testnet support for Aurora (#947)
* Testnet support * Upgrade contract for 1conf * Formatting changes Change-Id: Id06481d77d770a04eb200aadb82574e23cddcd36
This commit is contained in:
parent
21e2a710a7
commit
b718225e45
|
@ -110,6 +110,48 @@ yargs(hideBin(process.argv))
|
||||||
|
|
||||||
console.log(vm)
|
console.log(vm)
|
||||||
})
|
})
|
||||||
|
.command('generate_upgrade_chain_vaa [chain_id] [contract_address]', 'create a VAA to upgrade a chain (debug-only)', (yargs) => {
|
||||||
|
return yargs
|
||||||
|
.positional('chain_id', {
|
||||||
|
describe: 'chain id to upgrade',
|
||||||
|
type: "number",
|
||||||
|
required: true
|
||||||
|
})
|
||||||
|
.positional('contract_address', {
|
||||||
|
describe: 'contract to upgrade to',
|
||||||
|
type: "string",
|
||||||
|
required: true
|
||||||
|
})
|
||||||
|
.option('guardian_secret', {
|
||||||
|
describe: 'Guardian\'s secret key',
|
||||||
|
type: "string",
|
||||||
|
default: "cfb12303a19cde580bb4dd771639b0d26bc68353645571a8cff516ab2ee113a0"
|
||||||
|
})
|
||||||
|
}, async (argv: any) => {
|
||||||
|
let data = [
|
||||||
|
"0x",
|
||||||
|
"00000000000000000000000000000000000000000000004e4654427269646765", // NFT Bridge header
|
||||||
|
"02",
|
||||||
|
ethers.utils.defaultAbiCoder.encode(["uint16"], [argv.chain_id]).substring(2 + (64 - 4)),
|
||||||
|
ethers.utils.defaultAbiCoder.encode(["bytes32"], [argv.contract_address]).substring(2),
|
||||||
|
].join('')
|
||||||
|
|
||||||
|
const vm = signAndEncodeVM(
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
"0x0000000000000000000000000000000000000000000000000000000000000004",
|
||||||
|
Math.floor(Math.random() * 100000000),
|
||||||
|
data,
|
||||||
|
[
|
||||||
|
argv.guardian_secret
|
||||||
|
],
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
);
|
||||||
|
|
||||||
|
console.log(vm)
|
||||||
|
})
|
||||||
.command('solana execute_governance_vaa [vaa]', 'execute a governance VAA on Solana', (yargs) => {
|
.command('solana execute_governance_vaa [vaa]', 'execute a governance VAA on Solana', (yargs) => {
|
||||||
return yargs
|
return yargs
|
||||||
.positional('vaa', {
|
.positional('vaa', {
|
||||||
|
|
|
@ -75,6 +75,8 @@ spec:
|
||||||
- ws://eth-devnet:8545
|
- ws://eth-devnet:8545
|
||||||
- --avalancheRPC
|
- --avalancheRPC
|
||||||
- ws://eth-devnet:8545
|
- ws://eth-devnet:8545
|
||||||
|
- --auroraRPC
|
||||||
|
- ws://eth-devnet:8545
|
||||||
- --fantomRPC
|
- --fantomRPC
|
||||||
- ws://eth-devnet:8545
|
- ws://eth-devnet:8545
|
||||||
- --oasisRPC
|
- --oasisRPC
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
# Aurora testnet env
|
||||||
|
# Rename to .env to use with truffle migrations
|
||||||
|
|
||||||
|
# Wormhole Core Migrations
|
||||||
|
INIT_SIGNERS=["0x13947Bd48b18E53fdAeEe77F3473391aC727C638"]
|
||||||
|
INIT_CHAIN_ID=0x9
|
||||||
|
INIT_GOV_CHAIN_ID=0x1
|
||||||
|
INIT_GOV_CONTRACT=0x0000000000000000000000000000000000000000000000000000000000000004
|
||||||
|
|
||||||
|
# Bridge Migrations
|
||||||
|
BRIDGE_INIT_CHAIN_ID=0x9
|
||||||
|
BRIDGE_INIT_GOV_CHAIN_ID=0x1
|
||||||
|
BRIDGE_INIT_GOV_CONTRACT=0x0000000000000000000000000000000000000000000000000000000000000004
|
||||||
|
BRIDGE_INIT_WETH=0x9D29f395524B3C817ed86e2987A14c1897aFF849
|
|
@ -129,8 +129,8 @@ module.exports = {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
network_id: 0x4e454153,
|
network_id: 0x4e454153,
|
||||||
gas: 70000000,
|
gas: 10000000,
|
||||||
gasPrice: 8000000000,
|
from: "0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0", // public key
|
||||||
},
|
},
|
||||||
fantom: {
|
fantom: {
|
||||||
provider: () => {
|
provider: () => {
|
||||||
|
|
|
@ -107,6 +107,7 @@ func runListNodes(cmd *cobra.Command, args []string) {
|
||||||
|
|
||||||
if isTestnet {
|
if isTestnet {
|
||||||
networks = append(networks, network{"Ropsten", vaa.ChainIDEthereumRopsten})
|
networks = append(networks, network{"Ropsten", vaa.ChainIDEthereumRopsten})
|
||||||
|
networks = append(networks, network{"Aurora", vaa.ChainIDAurora})
|
||||||
networks = append(networks, network{"Karura", vaa.ChainIDKarura})
|
networks = append(networks, network{"Karura", vaa.ChainIDKarura})
|
||||||
networks = append(networks, network{"Acala", vaa.ChainIDAcala})
|
networks = append(networks, network{"Acala", vaa.ChainIDAcala})
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,6 +75,9 @@ var (
|
||||||
ethRopstenRPC *string
|
ethRopstenRPC *string
|
||||||
ethRopstenContract *string
|
ethRopstenContract *string
|
||||||
|
|
||||||
|
auroraRPC *string
|
||||||
|
auroraContract *string
|
||||||
|
|
||||||
fantomRPC *string
|
fantomRPC *string
|
||||||
fantomContract *string
|
fantomContract *string
|
||||||
|
|
||||||
|
@ -164,6 +167,9 @@ func init() {
|
||||||
oasisRPC = NodeCmd.Flags().String("oasisRPC", "", "Oasis RPC URL")
|
oasisRPC = NodeCmd.Flags().String("oasisRPC", "", "Oasis RPC URL")
|
||||||
oasisContract = NodeCmd.Flags().String("oasisContract", "", "Oasis contract address")
|
oasisContract = NodeCmd.Flags().String("oasisContract", "", "Oasis contract address")
|
||||||
|
|
||||||
|
auroraRPC = NodeCmd.Flags().String("auroraRPC", "", "Aurora Websocket RPC URL")
|
||||||
|
auroraContract = NodeCmd.Flags().String("auroraContract", "", "Aurora contract address")
|
||||||
|
|
||||||
fantomRPC = NodeCmd.Flags().String("fantomRPC", "", "Fantom Websocket RPC URL")
|
fantomRPC = NodeCmd.Flags().String("fantomRPC", "", "Fantom Websocket RPC URL")
|
||||||
fantomContract = NodeCmd.Flags().String("fantomContract", "", "Fantom contract address")
|
fantomContract = NodeCmd.Flags().String("fantomContract", "", "Fantom contract address")
|
||||||
|
|
||||||
|
@ -301,6 +307,7 @@ func runNode(cmd *cobra.Command, args []string) {
|
||||||
|
|
||||||
if *testnetMode {
|
if *testnetMode {
|
||||||
readiness.RegisterComponent(common.ReadinessEthRopstenSyncing)
|
readiness.RegisterComponent(common.ReadinessEthRopstenSyncing)
|
||||||
|
readiness.RegisterComponent(common.ReadinessAuroraSyncing)
|
||||||
readiness.RegisterComponent(common.ReadinessKaruraSyncing)
|
readiness.RegisterComponent(common.ReadinessKaruraSyncing)
|
||||||
readiness.RegisterComponent(common.ReadinessAcalaSyncing)
|
readiness.RegisterComponent(common.ReadinessAcalaSyncing)
|
||||||
}
|
}
|
||||||
|
@ -346,6 +353,7 @@ func runNode(cmd *cobra.Command, args []string) {
|
||||||
*polygonContract = devnet.GanacheWormholeContractAddress.Hex()
|
*polygonContract = devnet.GanacheWormholeContractAddress.Hex()
|
||||||
*avalancheContract = devnet.GanacheWormholeContractAddress.Hex()
|
*avalancheContract = devnet.GanacheWormholeContractAddress.Hex()
|
||||||
*oasisContract = devnet.GanacheWormholeContractAddress.Hex()
|
*oasisContract = devnet.GanacheWormholeContractAddress.Hex()
|
||||||
|
*auroraContract = devnet.GanacheWormholeContractAddress.Hex()
|
||||||
*fantomContract = devnet.GanacheWormholeContractAddress.Hex()
|
*fantomContract = devnet.GanacheWormholeContractAddress.Hex()
|
||||||
*karuraContract = devnet.GanacheWormholeContractAddress.Hex()
|
*karuraContract = devnet.GanacheWormholeContractAddress.Hex()
|
||||||
*acalaContract = devnet.GanacheWormholeContractAddress.Hex()
|
*acalaContract = devnet.GanacheWormholeContractAddress.Hex()
|
||||||
|
@ -402,6 +410,12 @@ func runNode(cmd *cobra.Command, args []string) {
|
||||||
if *ethRopstenContract == "" {
|
if *ethRopstenContract == "" {
|
||||||
logger.Fatal("Please specify --ethRopstenContract")
|
logger.Fatal("Please specify --ethRopstenContract")
|
||||||
}
|
}
|
||||||
|
if *auroraRPC == "" {
|
||||||
|
logger.Fatal("Please specify --auroraRPC")
|
||||||
|
}
|
||||||
|
if *auroraContract == "" {
|
||||||
|
logger.Fatal("Please specify --auroraContract")
|
||||||
|
}
|
||||||
if *karuraRPC == "" {
|
if *karuraRPC == "" {
|
||||||
logger.Fatal("Please specify --karuraRPC")
|
logger.Fatal("Please specify --karuraRPC")
|
||||||
}
|
}
|
||||||
|
@ -421,6 +435,12 @@ func runNode(cmd *cobra.Command, args []string) {
|
||||||
if *ethRopstenContract != "" {
|
if *ethRopstenContract != "" {
|
||||||
logger.Fatal("Please do not specify --ethRopstenContract in non-testnet mode")
|
logger.Fatal("Please do not specify --ethRopstenContract in non-testnet mode")
|
||||||
}
|
}
|
||||||
|
if *auroraRPC != "" && !*unsafeDevMode {
|
||||||
|
logger.Fatal("Please do not specify --auroraRPC")
|
||||||
|
}
|
||||||
|
if *auroraContract != "" && !*unsafeDevMode {
|
||||||
|
logger.Fatal("Please do not specify --auroraContract")
|
||||||
|
}
|
||||||
if *karuraRPC != "" && !*unsafeDevMode {
|
if *karuraRPC != "" && !*unsafeDevMode {
|
||||||
logger.Fatal("Please do not specify --karuraRPC")
|
logger.Fatal("Please do not specify --karuraRPC")
|
||||||
}
|
}
|
||||||
|
@ -517,6 +537,7 @@ func runNode(cmd *cobra.Command, args []string) {
|
||||||
ethRopstenContractAddr := eth_common.HexToAddress(*ethRopstenContract)
|
ethRopstenContractAddr := eth_common.HexToAddress(*ethRopstenContract)
|
||||||
avalancheContractAddr := eth_common.HexToAddress(*avalancheContract)
|
avalancheContractAddr := eth_common.HexToAddress(*avalancheContract)
|
||||||
oasisContractAddr := eth_common.HexToAddress(*oasisContract)
|
oasisContractAddr := eth_common.HexToAddress(*oasisContract)
|
||||||
|
auroraContractAddr := eth_common.HexToAddress(*auroraContract)
|
||||||
fantomContractAddr := eth_common.HexToAddress(*fantomContract)
|
fantomContractAddr := eth_common.HexToAddress(*fantomContract)
|
||||||
karuraContractAddr := eth_common.HexToAddress(*karuraContract)
|
karuraContractAddr := eth_common.HexToAddress(*karuraContract)
|
||||||
acalaContractAddr := eth_common.HexToAddress(*acalaContract)
|
acalaContractAddr := eth_common.HexToAddress(*acalaContract)
|
||||||
|
@ -755,6 +776,10 @@ func runNode(cmd *cobra.Command, args []string) {
|
||||||
ethereum.NewEthWatcher(*ethRopstenRPC, ethRopstenContractAddr, "ethropsten", common.ReadinessEthRopstenSyncing, vaa.ChainIDEthereumRopsten, lockC, nil, 1, chainObsvReqC[vaa.ChainIDEthereumRopsten]).Run); err != nil {
|
ethereum.NewEthWatcher(*ethRopstenRPC, ethRopstenContractAddr, "ethropsten", common.ReadinessEthRopstenSyncing, vaa.ChainIDEthereumRopsten, lockC, nil, 1, chainObsvReqC[vaa.ChainIDEthereumRopsten]).Run); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if err := supervisor.Run(ctx, "aurorawatch",
|
||||||
|
ethereum.NewEthWatcher(*auroraRPC, auroraContractAddr, "aurora", common.ReadinessAuroraSyncing, vaa.ChainIDAurora, lockC, nil, 1, chainObsvReqC[vaa.ChainIDAurora]).Run); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
if err := supervisor.Run(ctx, "karurawatch",
|
if err := supervisor.Run(ctx, "karurawatch",
|
||||||
ethereum.NewEthWatcher(*karuraRPC, karuraContractAddr, "karura", common.ReadinessKaruraSyncing, vaa.ChainIDKarura, lockC, nil, 1, chainObsvReqC[vaa.ChainIDKarura]).Run); err != nil {
|
ethereum.NewEthWatcher(*karuraRPC, karuraContractAddr, "karura", common.ReadinessKaruraSyncing, vaa.ChainIDKarura, lockC, nil, 1, chainObsvReqC[vaa.ChainIDKarura]).Run); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -12,6 +12,7 @@ const (
|
||||||
ReadinessEthRopstenSyncing readiness.Component = "ethRopstenSyncing"
|
ReadinessEthRopstenSyncing readiness.Component = "ethRopstenSyncing"
|
||||||
ReadinessAvalancheSyncing readiness.Component = "avalancheSyncing"
|
ReadinessAvalancheSyncing readiness.Component = "avalancheSyncing"
|
||||||
ReadinessOasisSyncing readiness.Component = "oasisSyncing"
|
ReadinessOasisSyncing readiness.Component = "oasisSyncing"
|
||||||
|
ReadinessAuroraSyncing readiness.Component = "auroraSyncing"
|
||||||
ReadinessFantomSyncing readiness.Component = "fantomSyncing"
|
ReadinessFantomSyncing readiness.Component = "fantomSyncing"
|
||||||
ReadinessKaruraSyncing readiness.Component = "karuraSyncing"
|
ReadinessKaruraSyncing readiness.Component = "karuraSyncing"
|
||||||
ReadinessAcalaSyncing readiness.Component = "acalaSyncing"
|
ReadinessAcalaSyncing readiness.Component = "acalaSyncing"
|
||||||
|
|
|
@ -369,6 +369,11 @@ func (e *Watcher) Run(ctx context.Context) error {
|
||||||
p2p.DefaultRegistry.AddErrorCount(e.chainID, 1)
|
p2p.DefaultRegistry.AddErrorCount(e.chainID, 1)
|
||||||
return
|
return
|
||||||
case ev := <-headSink:
|
case ev := <-headSink:
|
||||||
|
if ev == nil {
|
||||||
|
logger.Error("new header event is nil", zap.String("eth_network", e.networkName))
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
currentHash := ev.Hash()
|
currentHash := ev.Hash()
|
||||||
logger.Info("processing new header",
|
logger.Info("processing new header",
|
||||||
|
|
|
@ -98,6 +98,8 @@ func (c ChainID) String() string {
|
||||||
return "avalanche"
|
return "avalanche"
|
||||||
case ChainIDOasis:
|
case ChainIDOasis:
|
||||||
return "oasis"
|
return "oasis"
|
||||||
|
case ChainIDAurora:
|
||||||
|
return "aurora"
|
||||||
case ChainIDFantom:
|
case ChainIDFantom:
|
||||||
return "fantom"
|
return "fantom"
|
||||||
case ChainIDAlgorand:
|
case ChainIDAlgorand:
|
||||||
|
@ -131,6 +133,8 @@ func ChainIDFromString(s string) (ChainID, error) {
|
||||||
return ChainIDAvalanche, nil
|
return ChainIDAvalanche, nil
|
||||||
case "oasis":
|
case "oasis":
|
||||||
return ChainIDOasis, nil
|
return ChainIDOasis, nil
|
||||||
|
case "aurora":
|
||||||
|
return ChainIDAurora, nil
|
||||||
case "fantom":
|
case "fantom":
|
||||||
return ChainIDFantom, nil
|
return ChainIDFantom, nil
|
||||||
case "algorand":
|
case "algorand":
|
||||||
|
@ -164,6 +168,8 @@ const (
|
||||||
ChainIDOasis ChainID = 7
|
ChainIDOasis ChainID = 7
|
||||||
// ChainIDAlgorand is the ChainID of Algorand
|
// ChainIDAlgorand is the ChainID of Algorand
|
||||||
ChainIDAlgorand ChainID = 8
|
ChainIDAlgorand ChainID = 8
|
||||||
|
// ChainIDAurora is the ChainID of Aurora
|
||||||
|
ChainIDAurora ChainID = 9
|
||||||
// ChainIDFantom is the ChainID of Fantom
|
// ChainIDFantom is the ChainID of Fantom
|
||||||
ChainIDFantom ChainID = 10
|
ChainIDFantom ChainID = 10
|
||||||
// ChainIDKarura is the ChainID of Karura
|
// ChainIDKarura is the ChainID of Karura
|
||||||
|
|
|
@ -17,6 +17,7 @@ enum ChainID {
|
||||||
CHAIN_ID_AVALANCHE = 6;
|
CHAIN_ID_AVALANCHE = 6;
|
||||||
CHAIN_ID_OASIS = 7;
|
CHAIN_ID_OASIS = 7;
|
||||||
CHAIN_ID_ALGORAND = 8;
|
CHAIN_ID_ALGORAND = 8;
|
||||||
|
CHAIN_ID_AURORA = 9;
|
||||||
CHAIN_ID_FANTOM = 10;
|
CHAIN_ID_FANTOM = 10;
|
||||||
CHAIN_ID_KARURA = 11;
|
CHAIN_ID_KARURA = 11;
|
||||||
CHAIN_ID_ACALA = 12;
|
CHAIN_ID_ACALA = 12;
|
||||||
|
|
Loading…
Reference in New Issue