diff --git a/DEVELOP.md b/DEVELOP.md index 5f1e8e99..9fdf270f 100644 --- a/DEVELOP.md +++ b/DEVELOP.md @@ -35,4 +35,8 @@ Generate test ETH lockups once the cluster is up: kubectl exec -it -c tests eth-devnet-0 -- npx truffle exec src/send-lockups.js +Adjust number of nodes in running cluster: + + tilt args -- --num=2 + Once you're done, press Ctrl-C. Run `tilt down` to tear down the devnet. diff --git a/bridge/cmd/vaa-test/main.go b/bridge/cmd/vaa-test/main.go index 7e1c2e2c..f33dc5c8 100644 --- a/bridge/cmd/vaa-test/main.go +++ b/bridge/cmd/vaa-test/main.go @@ -1,3 +1,4 @@ +// vaa-test generates VAA test fixtures used by the ETH devnet tests package main import ( diff --git a/bridge/pkg/devnet/constants.go b/bridge/pkg/devnet/constants.go index cef43f12..1551837c 100644 --- a/bridge/pkg/devnet/constants.go +++ b/bridge/pkg/devnet/constants.go @@ -15,8 +15,8 @@ var ( GanacheClientDefaultAccountAddress = common.HexToAddress("0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1") // Contracts (deployed by "truffle migrate" on a deterministic devnet) - WrappedAssetContractAddress = common.HexToAddress("0x79183957Be84C0F4dA451E534d5bA5BA3FB9c696") - BridgeContractAddress = common.HexToAddress("0xCfEB869F69431e42cdB54A4F4f105C19C080A601") + WrappedAssetContractAddress = common.HexToAddress("0xe78A0F7E598Cc8b0Bb87894B0F60dD2a88d6a8Ab") + BridgeContractAddress = common.HexToAddress("0x5b1869D9A4C187F2EAa108f3062412ecf0526b24") ) const ( diff --git a/bridge/pkg/devnet/deterministic_key.go b/bridge/pkg/devnet/deterministic_key.go index 4c42cf7f..2044f5bd 100644 --- a/bridge/pkg/devnet/deterministic_key.go +++ b/bridge/pkg/devnet/deterministic_key.go @@ -1,10 +1,8 @@ package devnet import ( - "bytes" "crypto/ecdsa" "crypto/elliptic" - "encoding/binary" mathrand "math/rand" "github.com/libp2p/go-libp2p-core/crypto" @@ -12,12 +10,10 @@ import ( // DeterministicEcdsaKeyByIndex generates a deterministic ecdsa.PrivateKey from a given index. func DeterministicEcdsaKeyByIndex(c elliptic.Curve, idx uint64) *ecdsa.PrivateKey { - buf := make([]byte, 200) - binary.LittleEndian.PutUint64(buf, idx) - - worstRNG := bytes.NewBuffer(buf) - - key, err := ecdsa.GenerateKey(c, bytes.NewReader(worstRNG.Bytes())) + // use 555 as offset to deterministically generate key 0 to match vaa-test such that + // we generate the same key. + r := mathrand.New(mathrand.NewSource(int64(555 + idx))) + key, err := ecdsa.GenerateKey(c, r) if err != nil { panic(err) } diff --git a/devnet/bridge.yaml b/devnet/bridge.yaml index f5cc64a7..71fa183b 100644 --- a/devnet/bridge.yaml +++ b/devnet/bridge.yaml @@ -56,19 +56,19 @@ spec: # volumeMounts: # - name: guardian-data # mountPath: /data -# - name: agent -# image: solana-agent -# command: -# - /usr/local/bin/agent -# - '11111111111111111111111111111111' # TODO: program address -# - 'solana-devnet' # host -# - '8899' # rpc port -# - '8999' # pubsub/ws port -# - '9000' # grpc listen port -# ports: -# - containerPort: 9000 -# name: grpc -# protocol: TCP + - name: agent + image: solana-agent + command: + - /usr/local/bin/agent + - '11111111111111111111111111111111' # TODO: program address + - 'solana-devnet' # host + - '8899' # rpc port + - '8999' # pubsub/ws port + - '9000' # grpc listen port + ports: + - containerPort: 9000 + name: grpc + protocol: TCP # volumeClaimTemplates: # - metadata: # name: guardian-data diff --git a/ethereum/test/wormhole.js b/ethereum/test/wormhole.js index 3ae5d270..e95b5fd5 100644 --- a/ethereum/test/wormhole.js +++ b/ethereum/test/wormhole.js @@ -43,6 +43,10 @@ advanceBlock = () => { }); } +/* + The VAA test fixtures are generated by bridge/cmd/vaa-test. + */ + contract("Wormhole", function () { it("should use master wrapped asset", async function () { let bridge = await Wormhole.deployed();