Commit Graph

26 Commits

Author SHA1 Message Date
Hendrik Hofstadt fc64658ce8
node: add admin command to sign existing VAAs (#2183)
* node: add admin command to sign existing VAAs

Change-Id: Ia59c077db1817a3f35ec30544c307448e01455ca

* node: add tests for signing of existing VAAs

Change-Id: I16fca1181fc9d96abb4ebdfad91bc686da517090
2023-01-10 17:54:35 +01:00
Nikhil Suri 0e7c085d71
node: inject wormchain cosmwasm governance messages (#2057)
* node: inject wormchain cosmwasm governance messages

* Use nested hash for defense in depth

* Use keccak.Reset() instead of creating new hash objects

* fix msg_server_wasmd_test

* Updated based on jynnantonix comments

* Check return value of binary.Write

* Include actual error in binary.Write panic case
2022-12-06 11:10:32 -08:00
bruce-riley fb9f93e892
node: add command to purge pythnet VAAs (#1636)
* Add command to purge pythnet VAAs

* Add test for purging a single emitter address

* Fix lint error

* Using the wrong delete primative

Change-Id: I80d5294c17279d4e49220d81807e5964a5591721
2022-09-26 09:04:30 -05:00
bruce-riley bfeaa93716
node: governor auto release (#1452)
* Initial code

* Add test cases

* Get rid of excessive logging of price updates

* Add big tx size to available notional query

* Add tool to verify  price query still works

* Fix lint error

* Rename check_query.go

* Set big transaction sizes

* More rework

* Add unit-test for big transfer config

* Fix unit tests after updates for Near

* Add a couple more test cases

Co-authored-by: claudijd <jclaudius@jumptrading.com>
2022-08-30 11:28:18 -05:00
bruce-riley 7402259fc7
Chain governor (#1277)
* Rebase

* Reload from db on start up

Change-Id: I1deac9db28ad1157ea7e0c84af41c35b38497f4e

* Console commands

Change-Id: Ic242038312b7c837443a2df8823f100b3cdffd77

* Query prices from CoinGecko

Change-Id: I9a8c282ba374d32ef7045d11979a27ede3c52827

* Move chain config to separate file

Change-Id: I6a790eca765bce1f2caf48134e225df5c4daff15

* More code cleanup

Change-Id: Id12affa78cdc2d394d6dab0c53bb7ad06df8007e

* Few minor tweaks

Change-Id: I6cb511599d669e0b3d716d9f314ac0f26935ee92

* Create separate tests for different packages

Change-Id: Idb4da6817c9daad2a7420abc11bdaa702ae056dc

* Fix lint errors

Change-Id: I137c9e7e4574aee9c9fec22e91e19eee0e86a349

* Simplify chainlock message tests

* Add more governor db test coverage

* Next batch of review rework

Change-Id: Ife54852fca6c6990d1ffb3d60a8dd7f49d526f0a

* Still more rework

Change-Id: I43a8aa7fa4e1a7cea4d7fde68c963123c1ca8d53

* More rework

Change-Id: I9382412af4ffeda74967a834a6b0195a9d28b720

* Fix lint errors

Change-Id: Idaafce9b0314192557b7207911375d000bac5ae2

* Add rest and prometheus support

Change-Id: Ib870ed7eb305ef1ebbf6a7cedabc665c37c19171

* Add separate configs for testnet and devnet

Change-Id: I76b11d8940a8dc9935b3f276a008ed20ef60b850

* Update mainnet tokens to fix decimals

Change-Id: Iab018827766bc7748038b7be2f51342afb79b87c

* Let small enqueued VAAs go out when big ones can't

Change-Id: I7d3ef88d4579702d0c6ff4eaf5a8524799610ff6

* Tweak testnet config parameters

Change-Id: Id2c54151a7183ab3fb4af8060929198f6021ba4e

* Rework / enhancements from testnet testing

Change-Id: I1387b1d22667fa6ffe0bb1832dbc0b31196505d3

* Use known emitter maps

Change-Id: If330ee9d30ac3c2d1c6dca674f7777dc759de230

* Fix typo and out of date comments

Change-Id: I54a19792104ccc6ca023020303a710ef3ba18f74

Co-authored-by: claudijd <jclaudius@jumptrading.com>
2022-07-19 14:08:06 -04:00
Csongor Kiss 0f6c1e2d98 Allow specifying the timestamp in governance inject
The 'timestamp' field is now allowed in a governance prototxt, which
applies to all the messages in the struct. If the timestamp is not
specified, then it defaults to 0, which is identical to the existing
behaviour.
2022-04-19 17:52:05 +01:00
Leo 73a5b72857 node: implement observation requests via gossip
Limitations:

- Only supported for Solana and for confirmation level Finalized,
  which the token/NFT bridges use. Need to take a close look before
  enabling it for both (since we're bypassing the tx fetcher and would
  fetch and process accounts of the "wrong" confirmation levels).

- Rate limiting not implemented yet, will be done in a future release
  when things are not currently on fire.

Test: https://gist.github.com/leoluk/bab3a18e922057109facea1cf1f26b2f

commit-id:6a0d4c32
2022-01-26 13:00:23 +01:00
Leo 6260d5a148 node: add support for backfilling via RPC
commit-id:5cad9f7b
2021-12-20 16:05:22 +01:00
Leo 2396adc2c5 node/cmd/guardiand: batched submission of governance messages
Change-Id: I1f8541a89fb1ef3b5bafaede43a8481634cd3451
2021-10-29 19:08:45 +00:00
Leo 1d1422e416 node/cmd: hex-encoded address for ContractUpgrade
For consistency

Change-Id: Ife43c1381ad3933524d895145c5bdb865ef9f1e7
2021-10-12 21:48:44 +00:00
Leo 6fd6cb9f02 node: add BridgeUpgradeContract governance VAA
Example VAA produced by the template:

	(*vaa.VAA)(0xc0004f4510)({
	 Version: (uint8) 1,
	 GuardianSetIndex: (uint32) 0,
	 Signatures: ([]*vaa.Signature) (len=1 cap=1) {
	  (*vaa.Signature)(0xc0003b0370)({
	   Index: (uint8) 0,
	   Signature: (vaa.SignatureData) (len=65 cap=65) 0f97ec9093c21ccc4ce544898ed5c21b66ab4c90be894642fbb43474ed9fb48a26d6e12f3397b9fdab160fee64e797d26599a2a9d81a4bf4bc98970b5fa5122501
	  })
	 },
	 Timestamp: (time.Time) 1970-01-01 00:00:00 +0000 UTC,
	 Nonce: (uint32) 1375049878,
	 Sequence: (uint64) 3557202656914991802,
	 ConsistencyLevel: (uint8) 32,
	 EmitterChain: (vaa.ChainID) solana,
	 EmitterAddress: (vaa.Address) (len=32 cap=32) 0000000000000000000000000000000000000000000000000000000000000004,
	 Payload: ([]uint8) (len=67 cap=1000) {
	  00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
	  00000010  00 00 00 00 00 54 6f 6b  65 6e 42 72 69 64 67 65  |.....TokenBridge|
	  00000020  02 00 05 00 00 00 00 00  00 00 00 00 00 00 00 02  |................|
	  00000030  90 fb 16 72 08 af 45 5b  b1 37 78 01 63 b7 b7 a9  |...r..E[.7x.c...|
	  00000040  a1 0c 16                                          |...|
	 }
	})

Change-Id: Ibe95db01e1bc0a9c36e1be06920a389db886fdd1
2021-10-11 12:54:51 +00:00
Leo c253f769fa node: add FindMissingMessages admin RPC method
Change-Id: I57c1227c1a591e10f5e77b3553216915df247d65
2021-10-04 23:31:00 +02:00
Leo 8979ccbeae node: configurable module for BridgeRegisterChain
Change-Id: If2685e9fee4997c80a00895c244793c52f30214c
2021-10-01 12:26:05 +02:00
Leo 2022b55fd4 node: add token bridge governance VAA support
Change-Id: I731161f03590ce73145a1686eb2e62cfe19c8223
2021-10-01 09:43:18 +00:00
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 9c9c48ef3b Migrate proto generation to buf
Bug: certusone/wormhole#282
Change-Id: Ib20d8b9bcf19a26b12a586532281d83e95f0653e
2021-07-31 03:03:36 +02:00
Leo 052d922036 Clean up docs and packages for v2
Change-Id: I1020e648f4a8bd51412cf06196e78665308efdac
2021-07-21 19:46:10 +02: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 5256d2025a bridge: refuse to use deterministic keys in production 2021-01-29 12:40:55 +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 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 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
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