Commit Graph

265 Commits

Author SHA1 Message Date
Leopold Schabel e0ca52deb5
Update README.md 2020-11-15 18:48:53 +01:00
Leo 0d12e142f1 Remove broken .run files 2020-11-14 10:25:53 +01:00
Hendrik Hofstadt cee28540bd
Upgrade SDK; add balance rpc call (#80) 2020-11-13 14:14:56 +01:00
Leo aed8f6637c Remove outdated TODO comments 2020-11-13 11:44:09 +01:00
Leo 175c998915 Update DEVELOP.md 2020-11-13 11:24:59 +01:00
Leo be80d6b454 Update DEVELOP.md 2020-11-10 23:07:25 +01:00
Leo a30ec89224 Update DEVELOP.md 2020-11-10 22:53:54 +01:00
Leo 86fdfa859b devnet: deterministic Solana accounts and lockup generator 2020-11-10 22:53:36 +01:00
Leo cc1dcf0867 web: clarify some headings 2020-11-10 22:19:28 +01:00
Leo db63c3efbc web: integrate with Tilt deployment 2020-11-10 19:39:32 +01:00
Leo 6cc3495ac5 web: fail slightly more gracefully when MetaMask is not installed
Also adds a page title.
2020-11-10 19:36:55 +01:00
Leo 35d265b9c8 tools: build with -mod=readonly 2020-11-10 16:33:52 +01:00
Leo 91c23bfe25 Update DEVELOP.md 2020-11-10 16:31:05 +01:00
Leo 58ba151013 bridge/pkg/p2p: actually increment counter 2020-11-06 12:50:54 +01:00
Leo 2df0fe50c0 bridge/pkg/p2p: clarify comment 2020-11-06 12:48:12 +01:00
Leo 863e1c038b dev-install.sh: update to k3s v1.19.3+k3s2
k3s now takes care of SELinux the proper way by adding a repo:
https://github.com/rancher/k3s/pull/2408
2020-11-01 11:40:11 +01:00
Leo 30f56e08ba Tiltfile: graph of build dependencies 2020-10-31 12:46:16 +01:00
Leo 47ce567498 bridge: promote heartbeat messages to logger.Debug 2020-10-29 15:51:45 +01:00
Leo 9f75d19d11 bridge: implement aggregation timeouts and retransmissions
Fixes #21

ghstack-source-id: a89630d9e3
Pull Request resolved: https://github.com/certusone/wormhole/pull/72
2020-10-29 10:14:12 +01:00
Leo a853317421 bridge: refactor out devnetVAASubmission in observation.go
ghstack-source-id: 93e811b135
Pull Request resolved: https://github.com/certusone/wormhole/pull/71
2020-10-29 10:14:12 +01:00
Leo aa33dc4565 bridge: split up processor.go
No code changes except for `break` -> `return`.

ghstack-source-id: ed7784c590
Pull Request resolved: https://github.com/certusone/wormhole/pull/70
2020-10-29 10:13:14 +01:00
Leo f3107ebed4 solana: add uncommitted Cargo.lock files
If there's a reason they are missing, then I didn't realize :-)

Ref #29

ghstack-source-id: 9052f64e76
Pull Request resolved: https://github.com/certusone/wormhole/pull/68
2020-10-28 22:47:12 +01:00
Leo a4058512d5 bridge: migrate cmd/ to cobra
Reviewer note: Does not touch any of the business logic. Avoided
renaming files whereever possible to make it easier to spot differences.

Verbatim migration, in a future CL, we could replace some of the
flag validation code with cobra features and eliminate the global vars.

Moved the dlv tool definition out of the way for the top-level wrapper.

tools/bin/cobra is a helper utility that generates boilerplate
(we slightly deviate from their default scheme by having guardiand
in a separate package, rather than stuffing everything into cmd/)

ghstack-source-id: caec9a38a6
Pull Request resolved: https://github.com/certusone/wormhole/pull/67
2020-10-28 22:47:12 +01:00
Leo 6c7ca964e4 Remove outdated TODO comments
- Metrics tracked in #11.
- Timeout and retransmits covered in #21.
- Dependency injection doesn't make sense at this scale.
- `-1` on `GenerateKeyPair` means "this doesn't make sense for Ed25519,
  please crash if anyone ever tried to generate RSA keys".

ghstack-source-id: 8951628351
Pull Request resolved: https://github.com/certusone/wormhole/pull/66
2020-10-28 22:47:12 +01:00
Leo 11c74dd692 bridge: refactor p2p logic into pkg/p2p
ghstack-source-id: 86417c1301
Pull Request resolved: https://github.com/certusone/wormhole/pull/65
2020-10-28 22:47:12 +01:00
Leo fd27570637 bridge: remove all supervisor.SignalHealthy calls
Supervisor does not back off tasks that failed in a healthy state.

There are a couple places where we rely on supervisor for
application-level backoff, so we always want back-off. The distinction
is meant to enable runnables to implement their own specific back-off
logic, which we don't, so we can safely ignore it.

Fixes #37

ghstack-source-id: c756381b1b
Pull Request resolved: https://github.com/certusone/wormhole/pull/64
2020-10-28 22:47:12 +01:00
Leo 8be34ac657 bridge: refactor processor logic into pkg/processor
This increases modularity in preparation for integration testing
and addition of a CLI command hierarchy.

ghstack-source-id: 9c94373236
Pull Request resolved: https://github.com/certusone/wormhole/pull/63
2020-10-28 22:47:12 +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 13f79a96b3 devnet: use real account and nonce for send-lockups.js
ghstack-source-id: fb233fa727
Pull Request resolved: https://github.com/certusone/wormhole/pull/61
2020-10-28 22:47:12 +01:00
Leo bdd9d96559 bridge: bypass p2p for our own signatures
ghstack-source-id: ce2bbc780f
Pull Request resolved: https://github.com/certusone/wormhole/pull/60
2020-10-28 22:47:12 +01:00
Leo 45d10618ce bridge: verify LockupObservation signature
Final missing piece of the aggregation mechanism - signatures are now
verified before storing them in the aggregation.

ghstack-source-id: 3bb57c4886
Pull Request resolved: https://github.com/certusone/wormhole/pull/59
2020-10-28 22:47:12 +01:00
Leo 55fd671228 bridge: correctly calculate 2/3+ majority
Adds test vectors.

ghstack-source-id: 1f7e0d783f
Pull Request resolved: https://github.com/certusone/wormhole/pull/58
2020-10-28 22:47:12 +01:00
Leo 6c5b9875cf IDE helper scripts for logs and lockups
The .run folder is a new IntelliJ feature to allow for run configuration
sharing without having to check in .idea.

ghstack-source-id: a1d6f70adc
Pull Request resolved: https://github.com/certusone/wormhole/pull/57
2020-10-28 22:47:12 +01:00
Hendrik Hofstadt dadb287220
bridge: fix quorum calculation (#69) 2020-10-28 21:22:15 +01:00
Hendrik Hofstadt cf90bbec0d cli: create_wrapped command, deterministic generation 2020-10-28 20:37:06 +01:00
Hendrik Hofstadt 8d7a35683e
bridge: fix quorum (#56) 2020-10-25 08:57:04 +01:00
Leo c0882192da docs: align tables
Couldn't help it
2020-10-22 20:52:16 +02:00
Leo e8d169d9ed Merge remote-tracking branch 'origin/master' 2020-10-22 20:28:55 +02:00
Leo 509d9c3d73 bridge: use mlockall(2) to prevent pages from being swapped out
The extra capability is harmless and is, at worst, a DoS risk.

ghstack-source-id: d30b50dbca
Pull Request resolved: https://github.com/certusone/wormhole/pull/55
2020-10-22 16:51:56 +02:00
Hendrik Hofstadt 2b223ca038 docs: update body transfer schema 2020-10-22 14:35:52 +02:00
Leo f872d0be44 bridge: improve VAA submission logging 2020-10-22 13:36:08 +02:00
Leo 187355b0c8 solana: fix devnet_setup.sh sleep 2020-10-22 13:09:05 +02:00
Leo d877e975fc devnet: disable dlv by default 2020-10-22 12:55:24 +02:00
Leo 174003f879 devnet: fix dlv command line 2020-10-22 12:39:07 +02:00
Leo 9753cee14f tools.go: . -> _ import 2020-10-22 12:28:21 +02:00
Leo 096d048703 bridge: log submission for cross-submissions to Solana
ghstack-source-id: 1cf9ff2244
Pull Request resolved: https://github.com/certusone/wormhole/pull/54
2020-10-22 12:20:14 +02:00
Leo 58dcc43f17 bridge: do not resubmit submitted VAAs during aggregation
Fixes #49

ghstack-source-id: 8e03ec38f6
Pull Request resolved: https://github.com/certusone/wormhole/pull/53
2020-10-22 12:20:14 +02:00
Leo d3875ba523 bridge: do not log errors for duplicate VAA submissions
No functional change, just nicer log output.

ghstack-source-id: f946cbe71d
Pull Request resolved: https://github.com/certusone/wormhole/pull/52
2020-10-22 12:20:13 +02:00
Leo e5e6690f35 bridge: have all nodes submit VAAs to Solana
VAAs are deduplicated by the on-chain contracts. For Ethereum,
submission happens outside of the bridge anyway, and for Solana, the
first tx to be confirmed wins. Subsequent attempts to submit it
will fail in preflight, so the fee won't be spent multiple times.

This eliminates the need for leader selection and fixes #20.

ghstack-source-id: 60388d532c
Pull Request resolved: https://github.com/certusone/wormhole/pull/51
2020-10-22 12:20:13 +02:00
Leo 91241ee852 bridge/pkg/solana: retry VAA submission on transient errors
In particular, this fixes a race condition where the Solana devnet would
take longer to deploy than the ETH devnet to deploy and we'd end up
with an outdated guardian set on Solana.

We currently create a Goroutine for every pending resubmission, which
waits and blocks on the channel until solwatch is processing requests
again. This is effectively an unbounded queue. An alternative approach
would be a channel with sufficient capacity plus backoff.

Test Plan: Deployed without solana-devnet, waited for initial guardian
set change VAA to be requeued, then deployed solana-devnet.

The VAA was successfully submitted once the transient error resolved:

```
[...]
21:08:44.712Z	ERROR	wormhole-guardian-0.supervisor	Runnable died	{"dn": "root.solwatch", "error": "returned error when NODE_STATE_HEALTHY: failed to receive message from agent: EOF"}
21:08:44.712Z	INFO	wormhole-guardian-0.supervisor	rescheduling supervised node	{"dn": "root.solwatch", "backoff": 0.737286432}
21:08:45.451Z	INFO	wormhole-guardian-0.root.solwatch	watching for on-chain events
21:08:50.031Z	ERROR	wormhole-guardian-0.root.solwatch	failed to submit VAA	{"error": "rpc error: code = Canceled desc = stream terminated by RST_STREAM with error code: CANCEL", "digest": "79[...]"}
21:08:50.031Z	ERROR	wormhole-guardian-0.root.solwatch	requeuing VAA	{"error": "rpc error: code = Canceled desc = stream terminated by RST_STREAM with error code: CANCEL", "digest": "79[...]"}
21:09:02.062Z	INFO	wormhole-guardian-0.root.solwatch	submitted VAA	{"tx_sig": "4EKmH[...]", "digest": "79[...]"}
```

ghstack-source-id: 1b1d05a4cb
Pull Request resolved: https://github.com/certusone/wormhole/pull/48
2020-10-22 12:20:12 +02:00