Commit Graph

42 Commits

Author SHA1 Message Date
Leo e98463cfe3 node: rename bridge/ to node/
Calling guardiand a bridge dates back to v1 and no longer makes sense.

Change-Id: I27d24a5d7a64c3e37d6a5ce9c402c6248ad9c59e
2021-08-26 11:36:36 +02:00
Leo 63b77714ec proto: add strict linting and fix up existing protos
Passing the strict lint checks requires a number of backwards-
incompatible changes:

- Rename the NodePrivileged service to NodePrivilegedService.
  This is only used in CLI tooling, which are upgraded at the same
  time as the server binary.

- The Publicrpc service was renamed to PublicRPCService.

- The EmitterChain type is renamed to ChainID.

- The default value for the ChainID type is renamed to
  CHAIN_ID_UNSPECIFIED. This value wasn't referenced anywhere.

- The response and request types for GetLastHeartbeats were updated
  to match the rpc method name.

Change-Id: I3954130d3b25ab1f859390407bba3d3c02ffe03c
2021-08-25 14:26:33 +00:00
Leo 3ec4ad6ad3 node: remove raw heartbeat stream
As discussed with Justin, we no longer need this endpoint.

Removing it means we no longer have to worry about
long-lived connections.

Change-Id: I75020652d383a6b5f79a3cad1b52ae87d323f012
2021-08-23 10:51:09 +00:00
Leo e9491d25f8 node/pkg/publicrpc: add GetCurrentGuardianSet RPC call
This is required for network explorers to know about missing guardians
(the GetLastHeartbeats call won't contain those nodes at all).

Change-Id: I28d8621023d79e6fa94c40f36a239c34aa12f1b0
2021-08-10 17:35:33 +02:00
Leo 67793cd144 node/pkg/p2p: add per-chain error counters
Change-Id: I47700ccb2dc93aefefa8ab6b6f0659f30912e142
2021-08-10 13:24:43 +00:00
Leo 61a90136ca proto: add boot_timestamp to Heartbeat
Allows for precise uptime calculation.

Change-Id: I57d022ec10a56df57a4a1f79ae892eb8899f7154
2021-08-09 13:16:55 +00:00
Leo c7662d611e node: store heartbeats for multiple nodes per guardian
It's safe to break the proto API at this point.

Change-Id: I235100c5fef3abc9259d28f68d9bb7bf2be0ae5e
2021-08-09 13:16:55 +00:00
Leo 82731c22c0 node: add GetLastHeartbeats RPC call
This aggregates verified guardian heartbeats server-side so they
can be fetched via unary calls.

Change-Id: I8458b139bb5d75f87ed700b50684a5ff8ca594fa
2021-08-04 14:26:26 +00:00
Leo 2ebf473531 node: introduce SignedHeartbeat
Bug: certusone/wormhole#267
Change-Id: Ia34fa053240d7b340287cc4cc1e15556d3ff2893
2021-07-31 16:21:38 +02:00
Leo 723cf5fe95 node: add GetSignedVAA endpoint
Works:

$ curl 'http://localhost:7071/v1/signed_vaa/1/1268b2bf4a[...]/0'
{"vaaBytes":"AQAAAAABACbK50nrmgWPtTmRlYf/[...]"}

Bug: certusone/wormhole#282
Change-Id: I09eade00c4649c550f06a2efe350d6d9ff9da3ae
2021-07-31 03:03:37 +02:00
Leo 8da1eaa6b1 node: add REST proxy for publicRPC service
Bug: certusone/wormhole#282
Change-Id: I2aebd60b8839c59705ad1ab3425462ccaefc7e13
2021-07-31 03:03:37 +02:00
Leo 9c9c48ef3b Migrate proto generation to buf
Bug: certusone/wormhole#282
Change-Id: Ib20d8b9bcf19a26b12a586532281d83e95f0653e
2021-07-31 03:03:36 +02:00
Leo ee34086c39 proto: remove fee payer from heartbeat
This wasn't implemented in v1

Change-Id: I271c8abe2b3bb79462e54d6fa37afd235e310df8
2021-07-21 19:52:51 +00:00
Leo 052d922036 Clean up docs and packages for v2
Change-Id: I1020e648f4a8bd51412cf06196e78665308efdac
2021-07-21 19:46:10 +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 6d1b3d2651 Adapt solana agent for v2
Change-Id: I81fc8b959f33a157371d1c59b1d5323dfc11f1ce
2021-06-30 06:46:56 +00:00
Justin Schuldt 3b294c586a Use full import path in proto's go_package
Change-Id: I1f3592512804ad92506914eda67d9ce59effdc0e
2021-06-01 19:04:49 +00: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
jschuldt 16157d339d Add publicrpc endpoint for external clients.
- Distribute raw heartbeats via new proto package publicrpc

- Manage channel subscription on client req/close.

- Expose publicprc endpoint in devnet Service.

Change-Id: Ic96d624733961aa56e00b03c3b5cff6af11523a4
2021-05-24 13:38:58 -05:00
Leo 9c1d6ee00c bridge: add network heights and guardian address to heartbeat message 2021-02-10 01:57:54 +01:00
Leo 5256d2025a bridge: refuse to use deterministic keys in production 2021-01-29 12:40:55 +01:00
Leo 6d555789d6 Add version stamp to binary and include in heartbeat 2021-01-28 21:46:09 +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
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
Hendrik Hofstadt 12a6ae31bc
Watch slots for Solana liveness monitoring (#141)
* add slot notifications to the agent

* fix proto field naming
2021-01-11 12:43:05 +01:00
Leo 70eddbee6e Document our security assumptions 2020-11-27 18:51:32 +01:00
Leo 471417cd6e bridge: use GPG-armored binary protobufs for keys 2020-11-20 22:40:42 +01:00
Leo 0152a00114 all: rename LockupObservation to SignedObservation
We observe things other than lockups, account for it.
2020-11-20 22:35:00 +01:00
Leo 66430cb5be bridge: implement guardian set update submission node admin service
Tested on a live devnet via `scripts/test-injection.sh 0`.

ghstack-source-id: 92489c2455
Pull Request resolved: https://github.com/certusone/wormhole/pull/104
2020-11-19 12:57:21 +01:00
Leo d9f8174d76 bridge: implement bridge key serialization
ghstack-source-id: f218021514
Pull Request resolved: https://github.com/certusone/wormhole/pull/90
2020-11-19 12:57:21 +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
Hendrik Hofstadt f6750a3762 all: consider decimals on wrapped assets, fix VAA posting, fix solana account parsing 2020-08-28 15:10:42 +02:00
Leo 72289be8ee Wire up Solana lockup watcher 2020-08-21 20:49:33 +02:00
Hendrik Hofstadt 549f7ad69c solana: track time on lockups 2020-08-21 19:51:45 +02:00
Hendrik Hofstadt e0c2fbf990 agent: add lockup_address 2020-08-21 17:58:35 +02:00
Leo b663e2dc56 Generalize token lockup processor 2020-08-21 13:00:44 +02:00
Leo eca9f6214a Add consensus height to gossipv1 2020-08-21 10:36:08 +02:00
Hendrik Hofstadt 8f4127f781 Add slot to agent 2020-08-20 19:20:11 +02:00
Leo d6ef9c932c bridge: listen to eth lockups and aggregate signatures from all nodes
Improved devnet setup to generate deterministic node and guardian keys.

Devnet setup routine that configures a dynamic guardian set on Ethereum.

Configurable number of nodes in Tiltfile.
2020-08-19 14:24:38 +02:00
Leo bc3714fc73 Add nodeName to override hostname in gossip 2020-08-17 19:22:12 +02:00
Leo d8c9b41a01 Add builds for protos and the Solana agent
- Build buf and protoc-gen-go and use it to build Go proto packages
- Rename agent proto package to agent.v1 (to prevent namespace collisions and conform to buf's standards)
- Default to DOCKER_BUILDKIT=1 for CI setup
- Add incremental Docker build for solana/agent
- Move build machinery to top level
2020-08-15 22:15:26 +02:00