Commit Graph

349 Commits

Author SHA1 Message Date
bruce-riley 7d956818f0
node: governor tweaks (#1422)
* Non-critical tweaks for the next scheduled deploy

* Make tests fail if mainnet config is invalid

* Make the test pass

* Add test to verify testnet config

* Add support for included token list to script

* Initial include list and algorand token addresses

* Fix typo in algorand token

* Lowering min notional to zero
2022-08-16 15:22:24 -05:00
Paul Noel eae0b51d37
Algorand mainnet deploy (#1434)
* algorand mainnet deploy

* Changes to sdk/js

* Update sdk changlog

Co-authored-by: Bruce Riley <briley@jumptrading.com>
2022-08-16 10:14:48 -05:00
bruce-riley 99fb46d549
Don't allow obs reqs if the queue is full (#1429)
Change-Id: Ifb0d038fa3adeddc6226e2289fe9dbfc8e39b4e7
2022-08-15 07:33:45 -05:00
Jonathan Claudius 7a96b7de67
Add new sections to SECURITY.md and CONTRIBUTING.md (#1408)
* Add testing to SECURITY.md

* Add White-hat Bootstrap

* Add node Makefile

* Add chain integrator guidance

* Small tweaks to language

* Tweaks to test coverage and security.md

* Add cosmwasm tests to CONTRIBUTING.md

* Fix typo

* Add deep link to CONTRIBUTING.md

* Update CONTRIBUTING.md

Co-authored-by: Jeff Schroeder <jeffschroeder@computer.org>

* Update SECURITY.md

Co-authored-by: Jeff Schroeder <jeffschroeder@computer.org>

* Update SECURITY.md

Co-authored-by: Jeff Schroeder <jeffschroeder@computer.org>

* Update SECURITY.md

Co-authored-by: Jeff Schroeder <jeffschroeder@computer.org>

* Update SECURITY.md

Co-authored-by: Jeff Schroeder <jeffschroeder@computer.org>

* Update SECURITY.md

Co-authored-by: Jeff Schroeder <jeffschroeder@computer.org>

* Update SECURITY.md

Co-authored-by: Jeff Schroeder <jeffschroeder@computer.org>

* Update SECURITY.md

Co-authored-by: Jeff Schroeder <jeffschroeder@computer.org>

* Update SECURITY.md

Co-authored-by: Jeff Schroeder <jeffschroeder@computer.org>

* Add newline to node Makefile

Co-authored-by: Jeff Schroeder <jeffschroeder@computer.org>
2022-08-11 15:33:24 -04:00
Bruce Riley 7da21a60b6 Should not govern algorand yet 2022-08-10 14:31:19 -04:00
Bruce Riley 5ca2faa9a3 Governor should handle duplicate coin gecko ids 2022-08-10 12:59:32 -04:00
Josh Siegel 7e958c1643 near/backwards: RPC jumping causes us to think the chain went backwards 2022-08-10 10:10:05 -05:00
Bruce Riley edfd9987aa Initial gonvernor mainnet config
Change-Id: Ia84a9bd79bb15a4915e54cf019be23f8eee0fdcf
2022-08-10 10:28:24 -04:00
bruce-riley 8557b6d232
More governor code review rework (#1404)
* More code review rework

Change-Id: I0ae094b16a8e0469f83f711e7118936abf70b109

* Fix lint error

Change-Id: Ie3bdcc61a8c475018a8f72c9cc84678779447d16

* Code review rework

Change-Id: Ief1119e7c9687db855fbee90d32f631630380e60

* Add features list to gossip heartbeat message
2022-08-09 23:22:14 -04:00
jumpsiegel 3f965da33b
node: add near support (#1397)
* node: add near support

* Tweaks suggested in zoom review

Co-authored-by: Bruce Riley <briley@jumptrading.com>
2022-08-05 13:49:16 -04:00
bruce-riley 126c9dcf57
Add is_enqueued_vaa query to governor (#1395) 2022-08-04 11:51:04 -05:00
Evan Gray e0fd3e788f
node: pythnet testnet support (#1380) 2022-07-28 12:30:00 -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
Chirantan Ekbote 7a1b1344a1 node: processor: Make observation state generic
We need to reuse almost all of the gossip infrastructure for accounting
transactions, with the only difference being that accounting will use a
`Transfer` message rather than a `VAA`.

Make the observation stored in the processor state generic so that it
can be either a VAA or a Transfer.  The rest of the code is shared.
2022-07-19 10:51:15 +09:00
Chirantan Ekbote 508d140aa4 node/pkg/common: Refactor KnownEmitters
Create separate variables for the known tokenbridge and nft bridge
emitters and dynamically build KnownEmitters from those lists.  Having
separate variables for the tokenbridge and nft emitters will make it
easier to look them up without having to iterate over the whole emitter
list every time.

Also add a devnet_consts file to list the known emitters in the
development network.
2022-07-15 10:34:27 -04:00
Jeff Schroeder deeabc096d
Update injective url/s (#1350)
* node/pkg/terra: remove setEvents

The guardian set should only be authoritative from ethereum, so having
this code in the terra watcher is unnecessary. Getting this information
on injective requires a few more hoops to jump through but it is never
used. It is easier to maintain less code, so remove it.

* node/cmd/guardiand: remove setEvents from cosmwasm

This removes the set events from:

* terra 2
* injective
* terra classic

* node/pkg/terra: don't query guardianset from cosmwasm

* node/pkg/terra: support injective

* node/pkg/terra: update queryLatency metric

To show the query latency of fetching the latest block height from rpc
2022-07-14 13:41:31 -04:00
claudijd 8221708ef0 Move from ADD to COPY on Dockerfiles 2022-07-13 09:27:15 -04:00
Jonathan Claudius 38a2aba318
Add unit tests for db (#1062)
* Add unit tests for db

* Fix error checks and clean up tempdirs

* Add string explainer in the absence of a panic

* Remove unnecessary comment

* Fix NoError suggestion

* Add linter exception for panic test
2022-07-11 11:36:32 -04:00
Evan Gray 59fd0d36c7 node: optional chains in tilt 2022-07-11 10:35:00 -04:00
Csongor Kiss f856240792
node: Prepare development binary release (#1332)
* node: Shrink final docker image size

* Tiltfile: guardiand should run the build stage

* node: allow building without -race

* node: Support development builds

A development build must use the --unsafeDevMode flag.

* CI: build docker image

Co-authored-by: Csongor Kiss <ckiss@jumptrading.com>
2022-07-06 19:27:49 +01:00
bruce-riley d7b7cefa99
Guardian support for Injective (#1327) 2022-07-06 10:19:57 -04:00
Jonathan Claudius 0c22d6c3d6
Add unit-test coverage for marshaling (#1205)
* Add unit-test coverage for marshalling

* Add test to see if Unmarshal will panic on a > 1000 payload

* Error instead of truncate on payloads over 1000 bytes

* Clarify intents and tests for vaa.Unmarshal
2022-06-28 14:25:13 -04:00
Csongor Kiss 3328a86778 node: Allow "msu" in node 2022-06-28 16:41:43 +01:00
Hendrik Hofstadt f1dba4adfe
Allow account reuse for message posting (#1077)
* Implement message posting with account reuse

Change-Id: I195f493f6816048f5f8f76e1f0f6e561fa0fe692

* Use different magic for unreliable messages

* guardiand: Ignore solana instructions with empty data

Co-authored-by: Csongor Kiss <ckiss@jumptrading.com>
2022-06-27 09:57:25 +01:00
Jeff Schroeder cb73b7b718 node/pkg/ethereum: fix a bug discovered in testnet 2022-06-24 23:40:24 -04:00
bruce-riley cdc6edd425
Guardian eth nil event check (#1300)
* Guardian eth nil event check

* Check for number being nil in watcher
2022-06-23 09:40:04 -05:00
Bruce Riley b96ba36d25 Terra2 Mainnet Guardian Changes 2022-06-22 11:12:30 -04:00
Leo 8c60a83b54 node/pkg/supervisor: document upstream repository
commit-id:1b6b7f2e
2022-06-21 22:32:45 -04:00
tbjump 4575fe05d9
Better lint and formatting (#1263)
Enforce goimports, add tooling and documentation, and run it on the repo.
2022-06-21 12:18:16 -07:00
bruce-riley 57fe302314
Add emitter type to guardian mainnet consts (#1293)
* Add emitter type to guardian mainnet consts

* Add stringer to fix lint errors
2022-06-21 14:13:44 -05:00
Evan Gray 5931368ed7 node: terra2 support 2022-06-21 10:47:16 -04:00
bruce-riley f07b5dfbfb
Guardian parse transfer VAA payload (#1232)
* Parse transfer VAA payload

Change-Id: I23136807e5101ae823e9d198ac52d3446a94b0f2

* Enhance StringToAddress()

Change-Id: If7721c991443443cd811cc5b3ee070224aa6c2ce

* Code review rework

Change-Id: I75ae8c5386d9bcde1cfdd6b1e666bfefbe9852fe

* Payload length can be shorter

Change-Id: I459a180d7a54faf96b72943c9485696eb08b3d61

* Ran go fmt

Change-Id: Ia6ba3aaa13eb7c4e573c263a2d7868bf3e9937a4

* Decoding payload should not require a VAA

Change-Id: I143119e8667f340c43c7662488d909f087b9d1cc

* Fix comment typo

* Refactor StringToAddress tests to table pattern

* Refactor DecodeTransferPayloadHdr tests

* Add unit-tests for IsTransfer and fix array out of bounds bug

* Make sure length checking handles sub-byte hex strings appropriately

* Add empty string negative cases for TestStringToAddress and TestDecodeTransferPayloadHdr

* Fix nil ptr error in unit-tests

* Fix parenthesis in IsTransfer()

* More rework

Co-authored-by: claudijd <jclaudius@jumptrading.com>
2022-06-15 15:45:21 -05:00
bruce-riley 24c5b17267
Neon to testnet (#1262)
* WIP: neon

* Watcher support

* Use eth_getLogs for Neon

* bridge_ui: update sdk version

* Setting WETH address for Neon

* Portal bridge support for WNEON

* relayer: update sdk

Co-authored-by: Evan Gray <battledingo@gmail.com>
2022-06-14 10:22:49 -04:00
Chirantan Ekbote 7454c26f19 node: Update terra.go to latest version
This is necessary to use a more recent version of cosmos-sdk (v0.39.1 ->
v0.44.5).
2022-06-09 12:40:27 +09:00
Bruce Riley cf8c97082b Minor tweak to finalized check 2022-06-07 10:36:12 -04:00
Bruce Riley d6f4740136 Undo formatting changes 2022-06-07 10:36:12 -04:00
Bruce Riley 0ac89c3c06 Move polygon stuff to a different branch 2022-06-07 10:36:12 -04:00
Bruce Riley cf4722a546 Refactor to generalize polling
Change-Id: Ie30056486ec86f6dceffed231ac227fa9c3499a7
2022-06-07 10:36:12 -04:00
Bruce Riley bc7834448e Enhance error handling
Change-Id: Ied2521c0ebfc6bc8cf76ea90be6bc40dc0d811a3
2022-06-07 10:36:12 -04:00
Bruce Riley 9d423422c4 Rework the code
Change-Id: Id0aed3e3bce8f1e5332479132fab9437252909db
2022-06-07 10:36:12 -04:00
Bruce Riley 80512c0350 Initial rough draft
Change-Id: Ic2c8b15438162fd097e866f9a0ca1f6adf6a3f55
2022-06-07 10:36:12 -04:00
Josh Siegel 594674db5e algo/watcher: Fixes for testnet 2022-06-07 08:57:27 -05:00
Bruce Riley 5562141599 Only require 64 confs in polygon testnet 2022-06-06 12:49:44 -04:00
Bruce Riley dcce155f43 Acala mainnet deploy 2022-06-03 14:44:22 -04:00
tbjump ba5fcc4ad8 apply gofmt and enforce it for new commits 2022-06-02 07:57:49 -04:00
Jonathan Claudius f32e6c4aa8
Reorder quorum and verifysignatures (#1166) 2022-05-25 08:35:08 -04:00
Jonathan Claudius 1e6611ebb6
Add comments on vaa min length (#1206)
* Add proof of work on minVAALength

* Change minVAALength to 57
2022-05-24 10:42:30 -04:00
tbjump 67c39e71c0
enable additional linters, including gosec (#1215)
enable additional linters, including gosec
2022-05-23 16:21:10 +02:00
tbjump 8c1e571724
fix getUniqueClientId to actually return unique ID (#1127)
fix getUniqueClientId to actually return unique ID
2022-05-23 15:05:55 +02:00
tbjump 1c2a70554b
supress gosec issue (#1216)
supress gosec issue
2022-05-23 11:25:24 +02:00
tbjump d87ae5a272
gosec fixes (#1201)
* nosec linter surpression in nodekey_test.go

* Mark DeterministicEcdsaKeyByIndex as Insecure

* nosec - surpress warning

* simplify range expression

Co-authored-by: tbjump <>
2022-05-20 08:09:48 -07:00
bruce-riley 018908a420
Klaytn mainnet deploy (#1185)
* Klaytn mainnet deploy
2022-05-16 10:06:17 -04:00
Csongor Kiss 4d54fee0b9
node: New default current guardian set index (#1101)
The current guardian set index is 2, so the `guardiand` template command
should generate prototxt files accordingly.

Co-authored-by: Csongor Kiss <ckiss@jumptrading.com>
2022-05-13 19:47:45 -04:00
Jeff Schroeder da0fb0ddf7 node/hack/repair_terra: token bridge messages only
Ensure that the sequence numbers are just for the terra token bridge.
2022-05-13 15:26:14 -04:00
Jeff Schroeder f1d28915f8 node/hack/repair_terra: add a rate limiter
Otherwise the terra fcd tells us to gfy after too many requests.
2022-05-13 15:26:14 -04:00
Csongor Kiss 68693689cf node/repair: allow multiple sequences in a tx 2022-05-13 15:26:14 -04:00
Jeff Schroeder e70830002e repair_eth: work better when messages are skipped
Otherwise there can be a nil pointer deref for polygon when it skips
the VAA.
2022-05-13 13:22:55 -04:00
Bruce Riley d266438654 Celo mainnet deploy changes 2022-05-13 13:11:28 -04:00
Josh Siegel ac9b4a5d05 algo/rollback: handle rollbacks gracefully @ gusc1a-ossdev-jsl5 2022-05-12 09:10:10 -05:00
Josh Siegel c9d7a617ee Rewrite algorand guardian watcher to directly hit the node instead of depending on indexer 2022-05-12 06:50:07 -05:00
bruce-riley c7ba459de8
Moonbeam to testnet (#1150)
* Moonbeam to testnet

* Fix typo

* Shouldn't touch the CLI with this PR

* Update SDK version
2022-05-10 11:23:07 -04:00
Leo 2a83ea406b node/pkg/ethereum: move up nil check for TransactionReceipt
This fixes a null pointer dereference for a nil tx.

commit-id:a6a356b8
2022-05-05 09:04:54 -04:00
Leopold Schabel eb3b777520 node/cmd/guardiand: improve send-observation-request arg parser
Accept chain names (i.e. "solana") and base58 tx hashes.

commit-id:d7114740
2022-05-02 14:41:55 -04:00
bruce-riley a94a3cf2fb
Karura mainnet deploy (#1142)
* Start of move to mainnet

* Rework to safe mode check

* Update truffle-config

* Should not check safe mode in dev mode
2022-05-02 14:28:17 -04:00
bruce-riley 49f4a98cb2
Add missing aurora address references (#1117)
* Add missing aurora address references

Change-Id: I57a7dc7450d8527ab1ee6710dfbd6eda6da93f07

* Fix copy and paste error in comment

Change-Id: Ie7fc3cdbeab76518aad0f0220798cd1788d4be45
2022-05-02 13:06:56 -04:00
Evan Gray 1229ca5cff algo: guardian 2022-04-29 20:56:46 -04:00
Jeff Schroeder 0981dc19bc node/hack/repair_eth: skip missed message
Otherwise, the script will run until the max number of times and
never complete.
2022-04-29 07:21:03 -04:00
Jeff Schroeder 542acdf0d6 node/hack/repair_eth: more cat & mouse for polygon
* Added the `User-Agent` header to all requests to the block explorer
  so cloudflare's browser check is happier.
* Add an option to sleep between loops hitting the block explorer. More
  than 1 / second on polygonscan gets you blocked temporarily.

These changes are required to repair missed messages on polygon.
2022-04-29 07:21:03 -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
justinschuldt 4ae277f264 shutdown auth proof template 2022-04-28 02:32:04 -05:00
Jeff Schroeder a4c91d8f1b
Minor updates to repair_eth (#1120)
* node/hack/repair_eth: use a cookiejar for http

Otherwise, explorers like polygonscan, which implement a cloudflare WAF,
will block all requests.

* node/hack/repair_eth: add -showError flag

When an explorer is having problems or blocks a repair http request, it returns an error like:

    Failed to get current height: failed to decode response: invalid character '<' looking for beginning of value

This allows showing the actual response body to better troubleshoot the problem.
2022-04-27 14:33:43 -04:00
bruce-riley 87b36399d3
Add safe mode check (#1108)
Change-Id: Ida10e1ab0c056b4ed1ce2317800235843763a7ac
2022-04-26 07:51:10 -05:00
bruce-riley 05d84b4d6f
Add fantom to repair script (#1109)
Change-Id: Ic81b1082b72bb0cd66d9f15e951f6df2b92972ad
2022-04-26 07:50:07 -05: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
Jonathan Claudius b18a6c8c2f
Fix segfault from empty GetSignedVAARequest (#1069) 2022-04-11 19:16:59 -04:00
Jonathan Claudius bad4f7061b
Adds unit-tests and functional improvements to guardian signature verification (#1068)
* Add more comprehensive structs unit-tests

* Make VerifySignatures fail on duplicate addresses

* Adjust duplicate detection to guard on signatures instead of addresses

* Add monotonic check in VerifySignatures

* Move logic into VerifySignatures and add more test cases

* Add a paranoid check for duplicate signers

* Make VerifySignatures unit-tests less contrived

* Add more verify signature test cases

* Refactor VerifySignatures tests

* Add VerifySignature fuzz tests

* Add tc.result checking instead of hardcoded true

* Change comparison so it throws debug on failure for fuzz tests

* Add unit-tests for observation signature logic

* Fix comment typos

* Refactor observation tests

* Add missing test case

* Fix VAAInvalidSignatures test case label

* Clean up unit-tests for observation and structs

* Change errorString convention in test

* Format Signature Verification Test Cases

* Remove unnecessary casting

* Add multi-signer same key cases

* Fix err usage in test cases

* Remove duplicate getVAA
2022-04-11 19:14:41 -04:00
Leopold Schabel 1fd6e14885 node/pkg/ethereum: fix unreachable nil check
The program would've crashed on `l.Address` before it
could reach the nilness check.

commit-id:17b64899
2022-04-11 17:10:14 -04:00
Bruce Riley 10f00b934b Promote Aurora to Mainnet 2022-04-11 17:05:07 -04:00
Paul Noel 763f80b45d
Repair eth for Aurora (#1065)
* node/hack/repair_eth: update for Aurora

Change-Id: Ic073cb7806ce611a0d0c742b864dfa5cd57f39da

* bridge_ui/utils: update for Aurora

Change-Id: I19089355910d1252d139267ce1398e1dcdd46095

* node/hack/repair_eth: add comments

Change-Id: I2361d317e24446590334d39bc2e52f68d75932c5

* node/hack/repair_eth: fix comments

Change-Id: I4fd3e04d74f4f0b1c3731c556a106663bb36b66d
2022-04-11 16:27:20 -04:00
Leopold Schabel 97aedff9f0
node/pkg/ethereum: restart watcher if guardian set update fails (#1010) 2022-04-11 21:07:19 +02:00
Leopold Schabel d68232c447
hack/repair_solana: improve sequence guessing (#1003) 2022-04-11 21:07:09 +02:00
Jonathan Claudius 8dd3536fb2
Add README and crypto/rand for encrypt.go tool (#1057) 2022-04-08 19:37:53 -04:00
Jonathan Claudius 36cabf0e6a
Remove dead code path (#1056) 2022-04-08 19:37:23 -04:00
bruce-riley 879670c0e5
Klaytn testnet support (#1038)
* Klaytn support for testnet

Change-Id: Id0647fd6c603ab298f860c2cae20481555467315

* token_bridge client changes

Change-Id: If49ba994a67041044bdec054f19e69b4cfc2785b

* Get rid of special handling

* More cleanup

* Need to add Klaytn to structs tests

* Update SDK version

* Add SDK version

* fix klaytn bridge chain id

Co-authored-by: Evan Gray <battledingo@gmail.com>
2022-04-04 18:11:03 -04:00
bruce-riley eb898b0555
Aurora and Fantom handled wrong in a couple cases in guardian (#1044)
* Aurora and Fantom handled wrong in a couple cases

Change-Id: I09b7d2da46507e219bd99d945256e63fefad529c

* Original test covered upper / lower case

Change-Id: I0384b0aac6f63bf9782d393fcd4e4e67f353775a
2022-04-04 15:08:16 -04:00
Jonathan Claudius b7ec3ac0d3
Add unit-tests for nodekey (#1035)
* Add unit-tests for nodekey

* Move to deferred file clean up
2022-03-30 09:41:27 -04:00
Jonathan Claudius 5e00027a18
Add unit-tests for registry (#1026)
* Add unit-tests for registry

* Tweaks to registry unit-tests

* Remove duplicate unit-test

* Remove duplicate test case
2022-03-30 09:38:37 -04:00
Jonathan Claudius 3ceec1833f
Add more comprehensive structs unit-tests (#1006)
* Add more comprehensive structs unit-tests

* Abstract the vaa generation test logic
2022-03-29 12:24:56 -04:00
Jonathan Claudius 5921150f93
Add unit-test for ethereum utils (#1022) 2022-03-29 12:24:16 -04:00
Jonathan Claudius a709d6f283
Add unit-tests for deterministic devnet keys (#1032)
* Add unit-tests for deterministic devnet keys

* Extend unit-tests to do full deterministic key checks
2022-03-28 10:43:37 -04:00
Jonathan Claudius 5355f87206
Add unit test for 0 case and move to testify (#1023) 2022-03-28 09:54:18 -04:00
Jonathan Claudius b7a95484f9
Refactor Symmetric Unit-tests to Testify (#948)
* Refactor Symmetric Unit-tests to Testify

* Isolate tests for more durability

* Remove duplicate test case
2022-03-25 16:17:33 -04:00
justinschuldt b73ebd1b9c fix digest string represenation
commit-id:617ade15
2022-03-18 10:49:34 -05:00
justinschuldt d2dcb57e61 send guardian set data to prometheus
commit-id:87ec83e0
2022-03-18 10:49:34 -05:00
justinschuldt 99a02a41ea fix devnet GS upgrade path
commit-id:3a2fa5aa
2022-03-18 10:49:34 -05:00
bruce-riley b718225e45
Testnet support for Aurora (#947)
* Testnet support

* Upgrade contract for 1conf

* Formatting changes

Change-Id: Id06481d77d770a04eb200aadb82574e23cddcd36
2022-03-15 10:41:10 -04:00
Jonathan Claudius fa237c7bb4
Add some unit-test coverage for GuardianSet (#951)
* Add some unit-test coverage for GuardianSet

* Remove mu check to fix CI run

* Remove unnecessary copy paste
2022-03-11 11:31:10 -05:00
claudijd ff62a2c7f4 Add unit-tests for payloads 2022-03-09 20:58:04 -05:00
Jonathan Claudius 991f8fdb4b
Add struct tests2 (#978)
* Add unit-tests for structs

* Remote commented imports

* Add tweaks per review feedback
2022-03-09 19:40:36 -05:00
Leopold Schabel c9ae0880fa
node/hack/repair_eth: add max retries to skip over broken entries (#977)
commit-id:b1119b32
2022-03-08 20:51:55 +01:00
Leo 011987867a pkg/ethereum: check receipt status code
commit-id:0b2539be
2022-03-07 17:53:42 -05:00
bruce-riley d1da11785f
Karura and Acala support (#862)
* Karura and Acala support

Change-Id: I74c88b9b7a220e419e31a11cf77931343c9a8159

* env files got dropped

Change-Id: If330887782a4e38f3419dff2efcc100a5949d3f2

* Updates for latest parameters

Change-Id: Ie25f377f6d70dfb7d4b28efabd4064088e001c0a
2022-03-03 16:40:32 -05:00
Leopold Schabel d40a70a37f
node/pkg/ethereum: log blockhash for new message publications (#910) 2022-03-03 21:31:15 +01:00
Leopold Schabel 3e51512aec
node/pkg/common: fix guardian set state cleanup (#891) 2022-03-03 21:18:41 +01:00
Hendrik Hofstadt 4bc5daa8d1
Hardening against governance message spoofing (#938) 2022-03-03 17:55:02 +01:00
Jeff Schroeder fd96dced3a
Fantom updates (#928)
* node: Add fantom to guardiand admin list-nodes

* node: check fantom readiness for mainnet
2022-03-01 20:32:31 -05:00
Evan Gray 695dcac26c support custom root ca 2022-03-01 12:35:27 -05:00
bruce-riley 60363dd3d1
Fantom deploy (#920)
* Truffle changes

* Always require fantomRPC
2022-02-28 16:32:22 -05:00
Paul Noel 3b10f124a1
node/hack/repair_terra re-observation (#871)
* node/hack/repair_terra added file

Change-Id: Ie015cb3364c56211ba51550cfae307836071532a

* node/hack/repair_terra code inspection fixes

Change-Id: I91dfeeedf7d7f04591cc8ef47fde52f933a45d0a
2022-02-21 17:43:40 -05:00
Jonathan Claudius d47089741c
Add unit-test for governance (#867)
* Add unit-test for governance

* Gofmt governance_test.go

* Use structs for testing governance VAA

Co-authored-by: claudijd <jclaudius@jumptrading.com>
2022-02-21 17:23:34 -05:00
Leo a9e36ea7fb node/cmd: remove an extra err check
commit-id:e3096e20
2022-02-18 09:00:26 -05:00
Paul Noel 7af9d22221 node/hack/repair: oasis support
Change-Id: I2b7b825ab49dad68e7072a4f488bbc411cbaabd6
2022-02-15 17:20:03 -05:00
Leo d2d6128c12 node/hack/repair_eth: add tx replay via Etherscan API
commit-id:023a6afb
2022-02-15 16:47:20 -05:00
Leo 799c1e9942 node/hack/repair: rename to repair_solana
commit-id:9cf72c8a
2022-02-15 16:47:20 -05:00
Leo de7cfe6cc7 node/hack/findmissing: add simple script to find all missing messages
This is different from "admin find-missing-messages" insofar as
having a hardcoded list of emitters.

commit-id:b934f672
2022-02-15 16:47:20 -05:00
Leo 8bf1176401 node/pkg/common: add list of known mainnet emitters
commit-id:f4d2389f
2022-02-15 16:47:20 -05:00
Leo 93ee5f3d31 node: remove duplicated public RPC node definitions
commit-id:452deba7
2022-02-15 16:47:20 -05:00
Leo 632e8acbee node/hack/repair: remove state directory
commit-id:74906ad4
2022-02-15 16:47:20 -05:00
Jeff Schroeder b54b7e1183 node: add fantom support
Only run in testnet until the contracts are deployed to mainnet.
2022-02-15 13:51:11 -05:00
Evan Gray 9ed71c0038 node: terra reobservation 2022-02-12 15:03:32 +01:00
Leo c28b492e03 node: add reobservation requests for Eth chains
commit-id:e4fa6adf
2022-02-12 01:06:06 +01:00
Leo 8f63e123a5 node/pkg/ethereum: add MessageEventsForTransaction
This retrieves a single transaction's MessagePublication events. This
has the same security assumptions than listening to the log events -
namely, ensuring the right contract has emitted them.

Tested locally with a mainnet transaction.

commit-id:64347ecc
2022-02-12 01:06:06 +01:00
Leo 7ae4b3d6aa node: increase Polygon minimum confirmation to 512
It appears that in spite of exceeding the recommended value by 2x,
256 offers insufficient safety margin given that we saw two reorgs
of depths 178 and 187 recently: https://polygonscan.com/blocks_forked

This will increase confirmation delay from ~10 minutes to ~20 minutes.

commit-id:cf2b1503
2022-02-08 17:39:53 +01:00
Leo 6c02299f2b node/pkg/solana: skip failed transactions
Avoid unnecessary RPC calls/retries.

Makes no difference for safety, which relies on VAA accounts rather than
any transaction metadata.

commit-id:0cd82ed4
2022-02-08 12:41:48 +01:00
Leo 7144d6b538 node/hack: add repair script
Fetches the list of missing Solana messages, finds the corresponding
on-chain transactions, sends an ObservationRequest to the network
and waits for consensus.

Hacky one-off script with a couple of edge cases (doesn't filter
failed txs, crashes if the boundary is not a valid tx). We can later
refactor this and add it to the find-missing-messages admin command
if we keep needing it.

commit-id:9b338dfa
2022-02-08 12:41:48 +01:00
Leo 95fea79276 node/pkg/db: add db.VaaIDFromString and vaa.StringToAddress helpers
commit-id:1fb9f998
2022-02-08 12:41:10 +01:00
Leo 29cd5a3934 cmd/guardiand: fix governance VAA serialization
And add some extra debug logging for governance-vaa-verify.

commit-id:10deaff4
2022-02-03 04:14:29 +01:00
justinschuldt 763c62b73e supply credentials file to PubSub
commit-id:563f6718
2022-02-01 10:32:58 +01:00
Leo f200a6bd23 node/pkg/solana: fix context memory leak
commit-id:69632fa8
2022-01-27 12:43:03 +01:00
Leo f829195ea5 node/pkg/solana: kill recovery feature
This is no longer needed with SignedObservationRequest.

commit-id:9a3fbf4e
2022-01-26 13:00:23 +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
justinschuldt 79f489bd28 code review update
commit-id:55c28b21
2022-01-26 12:16:16 +01:00
justinschuldt 054d800f19 improve logging around GCP PubSub message path
commit-id:04012992
2022-01-26 12:16:16 +01:00
Leo 07c599ab68 node/pkg/telemetry: reduce log level to INFO
It appears that GCP Cloud Logging cannot handle the volume of logs
we're throwing at it... full text search slows to a crawl (LOL)

Reduce log level until we can move to something else.

commit-id:b71c3467
2022-01-25 22:36:24 +01:00
Leo 68bdd4b0b6 node/pkg/processor: expire late observations
Fixes https://github.com/certusone/wormhole/issues/685.

Example occurrence this fixes: https://i.imgur.com/gZWKf1n.png

Possible future optimizations include:

- Ignore late messages in the processor (but we can only ignore
  them post settlement time, so we need the cleanup logic regardless).

- Ignoring late observations from other nodes.

- Using the stored VAA to calculate misses.

- Drop incomplete local observations. However, this is not trivial
  since we do not know the message ID for those.

commit-id:47e1e59f
2022-01-25 22:36:24 +01:00
Leo b8c30314b5 node: avoid clobbering terminal with binary data
commit-id:222d1f31
2022-01-25 22:36:24 +01:00
Leo aff369ff4d node/pkg/solana: push recovery date
commit-id:a3c51648
2022-01-11 15:10:12 +01:00
Leo 1c0815e107 node/pkg/ethereum: increase log levels
commit-id:8ec48eb6
2022-01-11 15:10:12 +01:00
Leo af2bd5be36 node/cmd: add public telemetry for logs
commit-id:582fc943
2022-01-11 15:10:12 +01:00
Leo 870afc5193 node/pkg/ethereum: do not override outer scope's cancel function
Otherwise, we might end up cancelling the root context by accident.

commit-id:09a5287e
2022-01-11 15:10:12 +01:00
Leo a5223c074a node/pkg/ethereum: reduce timeout for TransactionReceipt
We should spend as little time holding pendingMu as possible.
Ideally, we would refactor the component to do non-blocking I/O.

commit-id:b464c384
2022-01-11 15:10:12 +01:00
Leo 146c08d5af node/pkg/ethereum: correctly log "not found" error
commit-id:23a5fd80
2022-01-11 15:10:12 +01:00
Leo 81d1e821c0 node/pkg/ethereum: minimum confirmations for Polygon
commit-id:0d95a63c
2022-01-11 15:10:12 +01:00
Leo ab18f278fe node/cmd: use plain global root logger
Get our own root logger and pass that to ipfslog. Prerequisite for
getting fancy about using Zap plugins.

commit-id:ad22324d
2022-01-11 15:10:12 +01:00
Leo 26a946fef7 node/pkg/solana: update recovery.cfg
commit-id:facc30f4
2022-01-11 15:10:12 +01:00
Leo 33717ebcc9 node/pkg/ethereum: check for rpc.ErrNoResult with non-nil tx
This cannot currently happen the way TransactionReceipt is implemented,
but make sure to check the tx != nil case anyway in case the API
is changed in future releases of go-ethereum.

commit-id:b721f0be
2022-01-11 15:10:12 +01:00
Leo 5de9d11b51 node/pkg/ethereum: improve confirmation logging
Makes the log slightly nicer to grep when looking for a tx.

commit-id:dc7cd00a
2022-01-11 15:10:12 +01:00
Hendrik Hofstadt 409b5ca5bf Properly check for orphaned txs
Change-Id: I2c3d1f638f6e6ab22c4dfcbbe0a0f5f6fd62f730
2022-01-07 10:31:37 -05:00
Evan Gray e1257f123a node: eth watcher multi-message fix 2022-01-04 10:44:46 -05:00
Hendrik Hofstadt cc2c310ba6 Refactor terra guardian component
This allows multi-message emission in a single call.

Change-Id: Ief28e91646362506453fe48b5489fd4ee0d35682
2022-01-04 16:21:10 +01:00