Commit Graph

48 Commits

Author SHA1 Message Date
Leo 67793cd144 node/pkg/p2p: add per-chain error counters
Change-Id: I47700ccb2dc93aefefa8ab6b6f0659f30912e142
2021-08-10 13:24:43 +00:00
Leo b2495ca43e node/pkg/solana: fix solanaConnectionErrors panic
Change-Id: I75889897e47902abe54cc45153934e73f1f3dcd4
2021-07-30 22:46:20 +02:00
Leo d37375e9a3 node/pkg/solana: simplify client method signatures
Change-Id: Ic317c78d7415dc11baf39d696ebdd57336b219bc
2021-07-30 09:06:25 +00:00
Leo 493b7ee855 node/pkg/solana: filter by requested consistency level
certusone/wormhole#248

Change-Id: Ib40b6016bda19e17c4700db6b39dbf340dfc0f4c
2021-07-29 15:55:57 +00:00
Leo 5bfa3b0055 node/pkg/solana: run one Solana watcher per consistency level
certusone/wormhole#248

Change-Id: I98abc6b4e635b8b5679fcda5342c90b0e5c96077
2021-07-29 14:27:04 +00:00
Leo b9633d6d65 node/pkg/solana: fork solana-go to add GetConfirmedTransactionWithOpts
certusone/wormhole#248

Change-Id: I093d619cb82b35b963447cf4a5dc18ef6be1a0f5
2021-07-29 14:14:09 +02:00
Leo cd8d2f68ed node/pkg/solana: verbose logging for observations
certusone/wormhole#248

Change-Id: Iae4b4d187e8d6728de9087e43c5f8a7b4d821540
2021-07-29 14:14:09 +02:00
Leo d5e6c844e3 node/pkg/solana: add initial logic for block-by-block requests
CPI part is untested.

Commitment level is hardcoded to "finalized", but can be refactored
to use both "committed" and "finalized" later.

certusone/wormhole#248

Change-Id: I5ae7711c306b33650367e6f7a417ab9d88753612
2021-07-29 12:14:01 +00:00
Leo b70466d185 node/pkg/solana: use gagliardetto/solana-go fork
This fork is up to date on latest Solana changes, while the dfuse
origin appears to be abandoned:

https://github.com/dfuse-io/solana-go/compare/master...gagliardetto:main

Change-Id: I5d2999ec7e26bd79a8302e2a5a6dddfd5e2bcbee
2021-07-28 16:34:24 +00:00
Leo 514560f52c node: use promauto to auto-register metrics
Fixes certusone/wormhole#188

Change-Id: I26c0e3f05993e44185b6ee2531b7673f7fbc0eb6
2021-07-26 13:01:55 +00:00
Leo 052d922036 Clean up docs and packages for v2
Change-Id: I1020e648f4a8bd51412cf06196e78665308efdac
2021-07-21 19:46:10 +02:00
Hendrik Hofstadt 98810080cc Fix readiness probe in guardian
Change-Id: Ia83ba29a7facf687d1765bf45fe012969a9835dc
2021-07-21 14:05:13 +00:00
Hendrik Hofstadt c0228415f8 Fix devnet
Change-Id: I1d62e6323cc2169cce43581f9aeefb537bc84a76
2021-07-20 23:34:37 +02:00
Leo d509693367 node: remove Solana VAA submitter and agent connection
Change-Id: I6201b00f3cbf9f0fee0cc14ce8fdc8ca8583ce97
2021-07-20 23:17:47 +02:00
Hendrik Hofstadt af4e29978d Add commitment level to VAAs
This allows requesting attestations for various commitment/confirmation levels. This is helpful for low-latency applications like Pyth.

Change-Id: Ib49ace163365106b227613d2f66b787b3e5f5461
2021-07-19 07:11:45 +00:00
Hendrik Hofstadt 0f854dc08b Track optional persistence in guardian and terra
Also reformatting

Change-Id: Ibdc426aa09a74a6f564090bb838be1b037a9fce1
2021-07-05 18:02:04 +00:00
Hendrik Hofstadt d9fde6d7cc Implement optional persistence in Solana wormhole
Also reformatted the token_bridge

Change-Id: I195d7e2e13295c8b28e2a0b63620e3d306dc07e6
2021-07-05 18:02:04 +00:00
Hendrik Hofstadt b85cbacd3b fix message attestation for Solana
Change-Id: Iaf79984980affe64f268c2eed9f61d5058cea0dd
2021-07-02 16:05:06 +00:00
Hendrik Hofstadt 79d846eed1 Update guardian software chain watcher and VAA submitter
Change-Id: I10c05c57e934662ff005e6b50067195502d23c0f
2021-06-29 13:55:44 +02:00
Leo c1d0f165d6 Merge branch 'main' into dev.v2
# Conflicts:
#	bridge/pkg/solana/submitter.go

Change-Id: I45b6e8f398b879915793987c5db38c839e8d1cc9
2021-06-22 18:54:15 +02:00
Hendrik Hofstadt 02d7257ff5 Implement PostedMessage fetching in the client
Change-Id: I8b59cdbfaf37212e187257cf46674086ad96d19d
2021-06-18 18:50:06 +02:00
Leo 79cc6a9f46 bridge: allow specifying skip_preflight in debug VAA submission
This allows forcibly submitting a failing VAA on-chain in cases where
the preflight check would hinder debugging.

It does not change behavior of guardiand.

Co-authored-by: Hendrik Hofstadt <hendrik@nexantic.com>
Change-Id: I63df22049ad27f659dc0638190edd20628b7a338
2021-05-31 13:33:43 +00:00
Leo 45639b18fb bridge/pkg/solana: fix package name and remove unused lockChan
Increase VAA submission timeout.
Change-Id: I5e774f2930e2f0d865d733eee2f0bb01da1b82f3
2021-05-31 13:33:32 +00:00
Hendrik Hofstadt c7c94441a5 implement new Solana account parsing
Change-Id: I2f59dae3950b2f95e8c0578c4f56c460f7166d2e
2021-04-20 09:48:23 +00:00
Hendrik Hofstadt 9f514e2786 rename ChainLock to MessagePublication
Change-Id: If74e74c00957c202c7de1cc61204b6cc12ad3a8a
2021-04-19 14:27:06 +02:00
Leo 9c1d6ee00c bridge: add network heights and guardian address to heartbeat message 2021-02-10 01:57:54 +01:00
Leopold Schabel b0a9e98648
Asynchronously fetch Terra block height (#177) 2021-02-05 15:16:31 +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 b23f43ed1e bridge: add metrics for ethereum, p2p and solana 2021-01-27 14:46:01 +01:00
Leo 14441680d0 bridge: add initial set of basic Prometheus metrics 2021-01-25 20:17:58 +01:00
Hendrik Hofstadt fd6c54de83
bridge/pkg/solana: use polling GetProgramAccounts watcher (#156)
This mitigates https://github.com/solana-labs/solana/issues/9909 by
polling GetProgramAccounts with a server-side filter. It also removes
the agent dependency for the lockup observation logic - the agent is now
used for transaction construction only.
2021-01-21 11:31:32 +01:00
Leo 120dfab49e bridge: type alias for readiness components 2020-11-29 17:07:15 +01:00
Leo 561852d499 bridge: simple readiness check 2020-11-29 17:07:15 +01:00
Leopold Schabel 8306a83833
solana/agent: listen on UNIX socket (#122)
This allows us to use UNIX filesystem permissions for access control.

Previously, any process in the network namespace could connect to it,
which is insecure for obvious reasons.

Verified that correct permissions are set:

```
# ls -lisa /run/bridge/
total 8
31996269 4 drwxrwxrwx 2 root root 4096 Nov 23 21:58 .
14676759 4 drwxr-xr-x 1 root root 4096 Nov 23 21:58 ..
31996306 0 srwx------ 1 root root    0 Nov 23 21:58 agent.sock
```

Fixes #119
2020-11-24 09:48:44 +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 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 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
Leo cb757192b3 bridge: wrap agent recv errors 2020-08-28 17:12:16 +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 1eef0b3bce bridge: use full token address 2020-08-28 08:35:59 +02:00
Leo 5a72d9029a VAA guardian devnet submission 2020-08-27 17:46:40 +02:00
Leo 30d921ec25 Always cancel contexts to avoid leaking goroutines 2020-08-21 23:48:02 +02:00
Leo 4b24a74547 agent: use max commitment and fix nonce type
It appears that single confirmation level is not useful
for transactions that depend on each other.
2020-08-21 22:53:31 +02:00
Leo 72289be8ee Wire up Solana lockup watcher 2020-08-21 20:49:33 +02:00
Leo b663e2dc56 Generalize token lockup processor 2020-08-21 13:00:44 +02:00
Leo 9bb44eb0f5 Enable VAA submission to Solana 2020-08-21 00:06:38 +02:00
Leo f1f2d0c8b8 Solana VAA submission stub 2020-08-20 21:48:58 +02:00
Hendrik Hofstadt 8f4127f781 Add slot to agent 2020-08-20 19:20:11 +02:00