Commit Graph

41 Commits

Author SHA1 Message Date
claudijd 8221708ef0 Move from ADD to COPY on Dockerfiles 2022-07-13 09:27:15 -04:00
Jonathan Claudius 0919f29dc3
Docker FROM image pinning (#1337)
* Add script to check docker pinning project wide

* Add workflow to run check-docker-pin

* Pin Docker image refs which were unpinned

* Add exceptions to the pin checking logic

* Fixes to check-docker-pin

* Clean up find command

* Bash optimizations

* Switch to env shebang

* Switch from find to git ls-files and add justification for ignore choices
2022-07-06 15:05:30 -04:00
Evan Gray cc72c2a644 algo: contracts 2022-04-29 20:56:17 -04:00
bruce-riley d04328b858
Celo testnet support (#1051)
* Initial Celo support

Change-Id: Iee98ee29a8b09af9ca76945792b750d96a170702

* Watcher support

* Fix high level make file

* Remove node binary committed by mistake

* Port change from EthWatcher to CeloWatcher

* Use docker to build ABIs

* Refactor watcher to eliminate massive redunancy

* Fix lint-and-tests to handle multiple defs on link

* Minor code cleanup

* Celo should use ganache in devnet

* Prep for mainnet deploy

* Code review rework

* Remove celo from sdk package.json
2022-04-28 12:20:38 -04:00
Jeff Schroeder 349fa42c58
Spy relayer cleanup (#1015)
* initial spy-relayer

* Update spy_relayer Dockerfile

* added example mainnet config files

* split out private keys into its own ENV variable

* Update spy relayer supportedChains.json

To remove the `walletPrivateKey` entries. All of the private keys have
been split out into their own json file.

* fixed evm private key env parse

* missing solana accounts report 0 balance, rather than error

* wallet address is logged in debug

* spy_relayer: enabled prometheus default metrics

Also set a prefix of `relayer_`

* spy_relayer: updates to the prometheus bits

* Use a single metric registry
* Use a simpler metric name and add labels for individual wallets

* spy_relayer: human readable app mode in the metrics

[ listener | relayer | both ]

* spy_relayer: unify metrics

* remove the collection of default metrics
* hardcode the `spy_relayer_` prefix on all custom metrics

* fixed dep arrays, nullable terra token/balance info

* attempt stack debug

* debug pullTerraBalance

* provider http or ws

* update sdk

* logging for tokenAddress is 0

* fix foreign address calc

* fix calcLocalAddressesTerra

* relayer/spy_relayer: update prometheus helpers

Add / url handler for the ingress-gce stupid load balancer that
doesn't support custom url healthchecks unless you make a BackendConfig
custom resource definition.

* logging refinement

* use chain name in prometheus

* adjust retry timeout calculation

* spy_relayer: update prometheus bits

* improved error handling

* relayer ui improvements

* prep sdk release

* use latest sdk, manual redeem button

* relaying ux improvements

* gas price fix

* shortened terra success log

* use gh base relayer list

* fix prometheus urls

* Update prometheus metric name

* only show TPS warning on mainnet

* show relayer fee in source preview

* fix unwrap check

* add native bool to balance metric

* logging improvements

* add feeRecipientAddress to redeemOnSolana

* gather solana fees

* remove relayer ws support

* add nativeCurrencySymbol to ChainConfigInfo

* fix solana native symbol

* demoteWorking option, logger contexts

* scoped logging

* bridge_ui: unwrap native

* add evm wallet monitor test

* solana vaa parsing fix

* add monitorRedis

* make Jeff's brain happy

* log demoting keys

* register redisQueue metric

* human readable redisQueue metric

* fix timestamp inconsistency

* use scopedLogger for the first level of workers

* pull wallet balances in parallel

* more scoped logging

* pick a solana fee

* moving keys log improvement

* update eth gas calculations based on recent txs

* use postVaaSolanaWithRetry

* split success and failures by chain

* fix using terraCoin

* check prom every 10s

* batch getting evm token balances

* batch calcLocalAddressesEVM

* debug worker logging

* log retry number

* support Polygon?

* reset status on demotion

* enhance!

* update avax fee

Co-authored-by: Chase Moran <chasemoran45@gmail.com>
Co-authored-by: Kevin Peters <kpeters@jumptrading.com>
Co-authored-by: Evan Gray <battledingo@gmail.com>
2022-03-28 23:39:08 -04:00
Evan Gray a3272dce4a remove pyth2wormhole 2022-03-07 10:23:34 -05:00
Stanisław Drozd 2ea41b8176
[WIP] Pr/drozdziak1/p2w batching/5e704f8b (#877)
* ethereum: p2w contract -> p2w emitter, fill in essential envs

Change-Id: I6fa9364a96738d2cc02ec829a31fedba0586d8e8

commit-id:0a56f1f8

* Add p2w-relay, a p2w-sdk integration test

commit-id:6bfab639

* p2w-sdk: Expand README

Change-Id: I17cb547d6aaddc240588923561c26d11a787df2e

commit-id:6ebd6a22

* p2w-sdk: don't build ETH contracts, only the types

Change-Id: I7cbd18328227700635d7688aa24a9671e8919fcd

commit-id:adf079f7

* p2w: configurability and sane envs

commit-id:f10fd90e

* Solitaire: Implement Option<T> support in structs

commit-id:31aa12d6

* bridge/governance.rs: Stop pestering about EMITTER_ADDRESS

commit-id:d5bd7234

* p2w-attest: price batching

This commit introduces support for multiple Pyth product/price pairs
per call. The initial maximum batch size is 5 and is enforced using a
`P2W_MAX_BATCH_SIZE` constant.

solana/pyth2wormhole/program:
* On-chain batching logic
* Batch message parsing logic

solana/pyth2wormhole/client:
* Off-chain batching logic - divides any number of symbols into
largest possible batches
* Use a multi-symbol config file instead of CLI arguments

third_party/pyth/p2w-sdk:
* Expose batch parsing logic

third_party/pyth/p2w-relay:
* Comment out target chain calls until ETH contract supports batching
* Test the batch parsing function

third_party/pyth/p2w_autoattest.py:
* Generate and use the symbol config file  with pyth2wormhole-client

third_party/pyth/pyth_publisher.py:
* Add a configurable number of mock Pyth symbols
* Adjust HTTP endpoint for multiple symbols

commit-id:73787a61

* p2w-attest: mention attestation size in batch

This commit ensures that no matter the attestation format, a batch
will never contain attestations of different sizes. This guarantee
enables forward compatibility by adding new constant-size fields at
the end of a batch at all times. An older implementation will simply
not consume the remaining newer values while respecting the stated
batch member alignment.

commit-id:210da230

* pyth2wormhole-client: use fresh blockhashes, harden batch errors

This commit makes sure we don't have to deal with expired transactions
due to stale blockhashes. The problem existed with larger symbol
configs as well as on Solana mainnet. Additionally, the attestation logic
now treats transaction errors as non-critical - a failure for a batch
does not prevent attestation attempts for batches farther in the queue

commit-id:5e704f8b
2022-02-23 19:12:16 +01:00
Evan Gray 075defa634 feat: improve bridge_ui tilt
properly cache npm ci in Docker container image
support hotloading outside ci
2022-02-14 07:56:38 -05:00
jumpsiegel f90ed66ca0
Stub out algorand support in wormhole (#611)
* Stub out algorand support in wormhole

  1) Introduce the algorand chain constant in all the appropriate places
  2) Deploy pyth/hernandc algorand smart contracts into devnet
  3) Fund all the correct contracts for devnet testing

Change-Id: I6e4402b5b21223b32ea89653f8c7606f5c7f2843

* pr/jsiegel/algorand-v1: ALGORAND is not a EVM chain @ gusc1a-ossdev-jsl1

* pr/jsiegel/algorand-v1: fix lint @ gusc1a-ossdev-jsl1

* pr/jsiegel/algorand-v1: put the requirements into the image @ gusc1a-ossdev-jsl1

* jsiegel/algorand: make the watcher hang forever @ gusc1a-ossdev-jsl1

* jsiegel/algorand: comment these out @ gusc1a-ossdev-jsl1

* jsiegel/algorand: put this back in @ gusc1a-ossdev-jsl1

* jsiegel/algorand: fix guardian example @ gusc1a-ossdev-jsl1

* Generate teal source code

commit-id:a537a109

* jsiegel/algorand: it builds @ gusc1a-ossdev-jsl1

* pr/jsiegel/algorand-v1: add Dockerfile.teal @ gusc1a-ossdev-jsl1

* jsiegel/algorand: improve the dependencies @ gusc1a-ossdev-jsl1

* pr/jsiegel/algorand-v1: Fix up build @ gusc1a-ossdev-jsl1

* dead file

* pr/jsiegel/algorand-v1: remove more stuff @ gusc1a-ossdev-jsl1

* pr/jsiegel/algorand-v1: fix build @ gusc1a-ossdev-jsl1

* pr/jsiegel/algorand-v1: freeze the requirements @ gusc1a-ossdev-jsl1

* pr/jsiegel/algorand-v1: Fix teal to use pipenv @ gusc1a-ossdev-jsl1

* pr/jsiegel/algorand-v1: fix miss-merge @ gusc1a-ossdev-jsl1

Co-authored-by: Leo <leo@certus.one>
2021-12-22 11:22:04 -05:00
Leo e4802d42d7 devnet: add algorand sandnet
As far as I can tell, both primary and node are happy. We can't use
https://github.com/algorand/sandbox since it makes too many
assumptions about its environment (docker-compose, interactive
development vs. reproducible CI usage).

Instead, use the official mainnet Docker images and ship our own config.

Caveat: "goal network create" is not reproducible and each Docker
build will generate a new set of root keys. We can presumably avoid
this by hardcoding the output of "goal network create"
(using --noimportkeys to avoid having to vendor a SQLite DB.. we'd
just re-import them to kmd at runtime, which is what goal is doing
internally: f51d2d7d5a/netdeploy/networkTemplate.go (L131))

Change-Id: I8c99c6150c9c244c9f12b68a58184c2d5697cee8
2021-12-09 11:54:17 +00:00
Stan Drozd 05edb3d14f pyth2wormhole: rename p2w-client service to p2w-attest
Change-Id: I34a53146919c12ab41b958cc8cd57108ee509faa
2021-11-15 15:22:29 +00:00
Stan Drozd 19c475e4a6 pyth2wormhole: share pending attestation information over HTTP
Change-Id: I585392f995f3d32b5e8152c08c79a012091c36ed
2021-11-15 15:22:29 +00:00
Stan Drozd 3e96438f4e pyth2wormhole: initial SDK skeleton
Change-Id: I8697ced892a1bf69f948c9743741d32a442a402f
2021-09-16 13:15:13 +00:00
Stan Drozd f24f86adf5 pyth2wormhole-client: Run an automated attestation script in Tilt
Change-Id: Id2e6def6c246862601a206084867c5f1b26a6673
2021-09-09 17:24:32 +02:00
Stan Drozd a97a34e174 Add a test pyth instance
Change-Id: Ifa5b50fb80f01f386fc8079eec3a0564df8072e1
2021-08-18 12:54:11 +02:00
Leopold Schabel cc3482a607
Replace third_party/solana by solana-test-validator (#197)
We no longer need to carry a patch and build Solana, and can use
solana-test-validator (with sleepy PoH!) instead. This significantly reduces
build times and will make downstream testing much easier.

Also remove the remnants of do.sh and the old BPF toolchain.

Test Plan: Ran E2E tests.
2021-04-07 20:16:19 +02:00
Leo 69b7d3e99e Update to Rust 1.49 2021-02-12 13:48:44 +01:00
Leo 67b8f4dfa2 third_party/solana: update to v1.4.25 2021-02-01 22:22:28 +01:00
Hendrik Hofstadt 2b30a30601
upgrade solana sdk version (#166)
* upgrade solana sdk version

Commitment levels were deprecated and the fastest confirmation level is `Processed`.

Also the upgradeable loader now requires the program to be writeable.

* Add deprecation comment

* update agent commitment level
2021-01-28 17:44:54 +01:00
Leo 9f2f609bc1 Bump Go and pin all Docker images to digests 2021-01-19 16:15:54 +01:00
Hendrik Hofstadt efa03ef73c
Implement upgradeability (#151)
* Implement contract upgrade VAA action

* naming and (╯°□°)╯︵ ┻━┻

* Carefully unflip table and replace broken cutlery ┬─┬ノ( ◕◡◕ ノ)

* fix and automate upgradeability

* document contract upgrade call

* Update comments

* Exhaustiveness check in VAA payload switch

* Fix typo

Co-authored-by: Leo <leo@certus.one>
2021-01-19 13:01:45 +01:00
Leo 30278397f7 bridge: add erc20 abi for use in tests 2020-11-29 17:07:15 +01:00
Leo fddbd01f9d solana: update Rust and Solana to latest stable releases
Unfortunately, the new release has a much chattier message_processor,
but we cannot do anything about that without losing value debug info.
2020-11-29 17:07:15 +01:00
Leo de8d1dee31 devnet: pin Dockerfile syntax to digest
This speeds up the build by ~1.5s by avoiding a remote lookup on
Docker Hub every time this is built (WTF).
2020-11-29 17:07:15 +01:00
Hendrik Hofstadt cee28540bd
Upgrade SDK; add balance rpc call (#80) 2020-11-13 14:14:56 +01:00
Leo d151c95d82 node.proto stub and dependencies
ghstack-source-id: 2343d22a0e
Pull Request resolved: https://github.com/certusone/wormhole/pull/62
2020-10-28 22:47:12 +01:00
Leo 7e366b5da6 Update all Go dependencies to latest
...except for libp2p, which broke compatibility
between go-libp2p and go-libp2p-core:

https://github.com/libp2p/go-libp2p-core/issues/168

I explicitly updated all transitive dependencies using
go get -u ./..., so the top-level go.mod file grew to include those.
2020-10-16 20:48:53 +02:00
Hendrik Hofstadt 25533f0264
bridge: add secp check instruction (#41)
* bridge: add secp check instruction

* solana: update to secp solana upstream

* solana: iteration on secp

* solana: fix secp instruction

serialization indices were off and secp ix data was serialized twice

* solana: optimize ix serialization

* agent: send multiple chunks of signatures

* doc: update protocol spec

* solana: store signatures in siginfo; reconstruct signed VAA in webinterface

* solana: reformat

* solana: add rustfmt config
2020-10-01 16:42:45 +02:00
Hendrik Hofstadt f6750a3762 all: consider decimals on wrapped assets, fix VAA posting, fix solana account parsing 2020-08-28 15:10:42 +02:00
Hendrik Hofstadt e3dcc654fb bridge: simplify lockup serialization 2020-08-21 22:56:21 +02:00
Hendrik Hofstadt 8e595889d6 solana: increase instruction limit 2020-08-21 19:52:04 +02:00
Hendrik Hofstadt a1e548e4b9 solana: don't rebuild solana when bridge changes 2020-08-21 16:29:44 +02:00
Hendrik Hofstadt a4fecd36f0 solana: build token program using latest solana version 2020-08-20 20:12:44 +02:00
Leo 894e058091 Build Solana smart contract 2020-08-20 18:56:26 +02:00
Hendrik Hofstadt 6d3dea0884 solana: inject bridge program on launch 2020-08-20 14:09:49 +02:00
Hendrik Hofstadt 135b98e556 Update solana patches 2020-08-19 15:19:17 +02:00
Leo 12873e5819 Add tooling to regenerate the Go ABI 2020-08-17 23:02:06 +02:00
Hendrik Hofstadt 49d2872d9c Update devnet and Solana program 2020-08-16 13:21:39 +02:00
Leo 294e256c74 third_party/solana: fix syscall patch
It's not applying, but at least it fails properly now!
2020-08-16 11:04:26 +02:00
Leo 487de66f40 solana: rebase onto master and cherry pick CreateProgram PR 2020-08-16 10:12:55 +02:00
Leo 7fc59ec5f4 Add Solana devnet and have agents talk to it 2020-08-15 23:54:44 +02:00