Commit Graph

2285 Commits

Author SHA1 Message Date
Stanisław Drozd 7202b9339e
wormhole-attester: Add a previous attestation timestamp field (#488)
* wormhole-attester: Add a previous attestation timestamp field

This change bumps price batch format to v3.1 with a new backwards
compatible field - prev_attestation_time. This is the last time we've
successfully attested the price. If no prior record exists, the
current time is used (the same as attestation_time).

The new field is backed by a new PDA for the attester contract, called
'attestation state'. In this PDA, we store a Pubkey -> Metadata
hashmap for every price. Currently, the metadata stores just the
latest successful attestation timestamp for use with the new field.

* wormhole-attester: Use publish_time instead of attestation_time

* wormhole_attester: use prev_publish_time for non-trading prices
2023-01-19 14:38:45 +01:00
Dev Kalra 1f4c0ba9cc
update key to v4 (#513) 2023-01-19 16:46:26 +05:30
Dev Kalra 5d0acc1a76
[cosmwasm] update contract (#509)
* contract updated

* add tests for the logic
2023-01-19 15:27:59 +05:30
guibescos f3f28b4214
[tilt] make multisig approvals easy (#512)
* For convinience

* Fix comment
2023-01-18 22:05:16 -06:00
Ali Behjati 59b0efbf6c
[price-service] Hotfix cache (#508) 2023-01-18 19:20:48 +01:00
guibescos 0812994745
[tilt] Bump pyth-client to 2.20 (#505)
* Bump to 2.20

* Rename to pyth_oracle.so

* Cleanup
2023-01-18 11:35:02 -06:00
Dev Kalra ff89f36c46
[cosmwasm] Add osmosis testnet config (#499)
* add osmosis testnet config

* empty commit
2023-01-18 15:23:37 +05:30
Ali Behjati e4963f4df3
[price-service] Hotfix leading 0x problem (#507) 2023-01-18 10:39:59 +01:00
Ali Behjati 0eac7246bd
[price-service] Hotfix a serde problem (#503)
* Fix linting error
* Bump patch version
* Revert seqNum to number
2023-01-18 09:51:29 +01:00
guibescos 1940a0bb2e
[xc-admin] Add wormhole logic to the crank-executor (#504)
* Add wormhole and fix some bugs

* Export WormholeMultisigInstruction

* Restore some unrelated parts of the code

* Cleanup

* Don't change this file
2023-01-17 17:19:13 -06:00
guibescos 1f64ce52b7
[xc-admin] multisig hook (#496)
* Fix next config

* Checkpoint

* Checkpoint

* Cleanup

* Cleanup
2023-01-17 12:12:29 -06:00
Ali Behjati 5e8b9f868a
[price-service] Add get_vaa_ccip endpoint (#500)
* [price-service] Refactor + bugfix

* [price-service] Add get_vaa_ccip endpoint

* [price-service] Refactor + add retry

* [price-service] Address feedback + handle api error
2023-01-17 18:14:07 +01:00
Ali Behjati 9d2bd87f95
[ethereum] Update receiver guardian set (#493)
* [ethereum] Update receiver guardian set

* Remove the test vaa

* Add docs + reformat

* Empty commit to trigger CI
2023-01-17 16:25:45 +01:00
Stanisław Drozd 99246c24d4
Drozdziak1/refactor p2w autoattest py (#502)
* p2w_autoattest.py: Stop using non-daemon mode

* wormhole_attester: Remove non-daemon mode and its uses, v3.0.0

We used to need non-daemon mode to run a manual healthcheck on the
attester process and its configuration. Currently, we're able to
handle this much better with the build-in healthcheck HTTP
endpoint. For production, we should be able to get rid of
p2w_autoattest.py entirely.

Co-authored-by: Stan Drozd <stan@pyth.network>
2023-01-17 16:01:16 +01:00
Ali Behjati 9cbdeb3588
[price-service] Handle WS error (#501) 2023-01-17 15:42:59 +01:00
Daniel Chew 47c9993675
[xc-admin] permission accounts (#494)
* Rework pyth hooks

* xc admin/add min pub page (#492)

* add min pubs page

* add wallet

* update connect wallet button

* fix header

* add ClusterSwitch

* fix header css

* add update permissions tab

* fix default tab

* show default value when permission account does not exists

* use table and add copy text function

* update package-lock.json

* update package-lock.json

* trigger deployment

* remove unused icon

* capitalize tabInfo

* remove -1 index check

* refactor

* refactor TabInfo to TAB_INFO

* trigger deployment

* remove unused icon

Co-authored-by: Guillermo Bescos Alapont <gbescos@stanford.edu>
2023-01-17 11:04:42 +09:00
guibescos d2d82136c9
Sort mapping accounts (#497) 2023-01-16 19:40:25 -06:00
guibescos e55a3bbb96
[xc-admin] rework pyth hook (#490)
* Rework pyth hooks

* Delete unused files

* Checkpoint

* xc admin/add min pub page (#492)

* add min pubs page

* add wallet

* update connect wallet button

* fix header

* add ClusterSwitch

* fix header css

* Cleanup

Co-authored-by: Daniel Chew <cctdaniel@outlook.com>
2023-01-16 13:14:18 -06:00
Ali Behjati b05845ede5
[price-service] Update wormhole sdk package (#495)
* [price-service] Update wormhole sdk package

Wormhole new sdk does not use wasm and is cleaner. It makes our code one
step closer to no wasm too.

* trigger ci

* Fix pre-commit errors
2023-01-16 19:07:08 +01:00
guibescos c10ed691da
Title (#491) 2023-01-14 14:26:58 -06:00
Ali Behjati daad5c6dc5
[governance] move governance related components under this directory (#489)
* [governance] bring related stuff in governance dir

* [governance] fix changes
2023-01-13 18:58:44 +01:00
guibescos 7cc5123a53
Cleanup local environment (#487)
* Cleanup local environment

* Default Pyth address to match Pythnet

* Cleanup

* Make vault the same as on mainnet

* Fix mesh

* Pyth owner address updated

* Revert some changes lol

* Revert more changes

* Restore oracle address

* Add comment to create key
2023-01-13 11:18:48 -06:00
Reisen 98db3eca10
[near] Fix governance inconsistencies. (#453)
* near: update governance inconsistencies
* near: add small script for automated testing
* near: address feedback and update tests
* near: cannot trust outcome(), use failure len
2023-01-13 16:20:32 +00:00
Ali Behjati 0e55d0808d
[price-service] Move to top (#474)
* Move price service to top

* Update the paths and docs

* A little cleanup
2023-01-13 16:26:43 +01:00
Daniel Chew ad864c697a
[price-service] add /get_vaa endpoint that serves cache and db vaas (#482)
* add /get_vaa endpoint that serves cache and db vaas

* update env vars

* fix precommit errors

* fix precommit errors

* rename removeExpiredValuesFromVaasCache to runCacheCleanupLoop

* move initialized envOrErr to constructor or func arg

* use setInterval

* update pyth-price-service env vars on tilt devnet

* use undefined instead of null

* use status code

* make web-api an env var

* update env var

* fix precommit

* fix precommit

* fix changes

* remove env vars from tilt-devnet

* address changes

* fix lint issues

* fix linting issues again

* bump package version

* remove unused imports
2023-01-13 16:08:27 +01:00
Daniel Chew 8b9682ccac
[xc-admin] setup frontend template (#480)
* add xc-admin-frontend template

* add more placeholder stuffs

* update placefolders

* fix precommit

* add package-lock.json

* address comments

* fix type

* add package-lock.json

* Fix CI (#483)

* fix ci

Co-authored-by: guibescos <59208140+guibescos@users.noreply.github.com>
2023-01-13 13:23:49 +09:00
guibescos bab75170f9
[xc-admin] Decoders can't throw (#486)
* Push code

* Format
2023-01-12 20:35:19 -06:00
guibescos 411ed32859
[xc-admin] Header becomes class (#484)
* Header becomes class 2

* Revert test

* Cleanup

* Cleanup
2023-01-12 13:36:06 -06:00
guibescos 31ab162168
[xc admin] Pyth parser (#477)
* Pyth parser

* Bump pyth-client-js
2023-01-12 11:53:20 -06:00
guibescos 8ef49e6128
[xc-admin] Refactor wormhole messages as classes (#478)
* Refactor wormhole messages as classes

* Type error

* Export ExecutePostedVaa

* Rename to UnknownGovernanceAction

* Improve interface
2023-01-12 11:47:56 -06:00
Ali Behjati fedb92e446
Remove unused components/projects (#481)
* Remove unused components/projects

* --amend
2023-01-12 13:52:43 +01:00
Dev Kalra e169da0a93
[cosmwasm] Deploy tool: Add new commands (update contract admin + get contract info) (#473)
* add terra local config

* terra update admin and contract info

* osmosis update admin and contract info

* update deployer interface

* injective update admin and contract info

* refactor yargs structure

* update injective sdk ts library

* update readme.md

* error handling for update admin code

* fix typo

* move logging to the calling function

* comment the update admin method
2023-01-12 18:06:37 +05:30
Ali Behjati 5da094f864
[xc-tool] remove (#475) 2023-01-12 09:35:56 +01:00
guibescos 5641008356
Fix constructor for multisig transaction (#476) 2023-01-11 13:06:42 -06:00
guibescos d1f5e5955a
xc-admin/MultisigParser for wormhole instructions (#470)
* Checkpoint

* Refactor

* Unrecognized instruction -> unrecognized program

* Shorten tests

* Rename test

* Rename WormholeInstruction to WormholeMultisigInstruction

* Refactor into constructor and builder method

* Rename file
2023-01-11 12:50:22 -06:00
Jayant Krishnamurthy 7c2e02ea0b
[price-service] Document the spy filters in .env.sample (#472)
* document the filters

* better doc

Co-authored-by: Jayant Krishnamurthy <jkrishnamurthy@jumptrading.com>
2023-01-11 18:58:33 +01:00
guibescos 92c17ad7cc
Xc admin/change error handling (#471)
* Switch from undefined to not undefined

* Update tests
2023-01-11 09:01:37 -06:00
guibescos 80fe230563
Xc admin/add executor (#466)
* Add encoder

* Update test

* Cleanup

* More cleanup

* Add executor

* Update comment

* Update package lock

* Cleanup

* Fix bug and error handling
2023-01-10 14:02:14 -06:00
guibescos 1153abe6ff
[xc-admin] Start cli and add accept transfer for upgrade authorities (#467)
* Checkpoint

* Add global options
2023-01-10 12:53:57 -06:00
Dev Kalra 670fc23d2f
Osmosis deployment code (#469)
* Osmosis deployment code

* extract out pyth sources
2023-01-10 21:33:37 +05:30
guibescos 3d8638ab3c
[xc-admin] fix instructions indexes (#468)
* Fix bug

* Remove console

* Revert change
2023-01-10 08:32:36 -06:00
Dev Kalra 627edaa62a
Injective deployment code (#465)
* make it all typescript

* what the hell

* injective - store, instantiate, and migrate works

* terra, injective refactored

* update compiler in build.sh

* update package.json

* deploy.ts

* pre-commit run

* replace helper functions call with actual call

* correct case of RaiseCLError

* update deployer factory to take in config

* add comment to gas for injective store code

* extract raw log logic

* remove comment from injective config

* update deploy script for tilt

Co-authored-by: Jayant Krishnamurthy <jkrishnamurthy@jumptrading.com>
2023-01-10 15:45:35 +05:30
guibescos 2a961d5853
Xc admin/propose instructions (#463)
* Add encoder

* Checkpoint

* Refactor

* Cleanup

* Add comment

* Cleanup
2023-01-09 21:46:03 -06:00
guibescos 097943f657
[xc-admin] Add encoder for governance messages (#462)
* Add encoder

* Cleanup

* Update test

* Ci

* CI

* Cleanup

* More cleanup
2023-01-09 15:54:54 -06:00
guibescos 5efa611a97
Xc admin/add wormhole message header deser (#461)
* Checkpoint

* Checkpoint

* Fix tests

* Revert changes to remote executor

* Fix precommit

* Add comments

* Solve typo

* MetaData -> Metadata

* Address feedback

* Fix imports
2023-01-06 14:47:30 -06:00
guibescos e12567c544
Move rust-toolchain (#460)
* Move rust-toolchain

* update tilt

* Make CI run everytime

* Revert "Make CI run everytime"

This reverts commit e5b008a83728a4ae996b00d2697ee0742bca5682.
2023-01-06 09:35:26 -06:00
guibescos 6e1328f98e
Scaffolding for xc-admin (new crosschain admin tool) (#457)
* First commit

* Add typescript

* Add tsconfig
2023-01-06 08:41:11 -06:00
Stanisław Drozd 2a0350bb5f
attester-image-push: Fix container tag naming (#456) 2023-01-05 16:59:01 +01:00
Stanisław Drozd 682e97c61c
pyth-wormhole-attester: v1.3.1, use different manual buckets (#452)
* pyth-wormhole-attester: v1.3.1, use different manual buckets

* Update description in metric registration
2023-01-05 15:45:30 +01:00
Stanisław Drozd 0a93d47391
wormhole-attester: port the v1.3.0 healthcheck hotfix (#454)
* wormhole-attester: port the v1.3.0 healthcheck hotfix

This PR fixes a missing assignment to HealthCheckState's enable
flag. This would cause the attester to ignore all settings (including
defaults) and keep the enable flag set to false because we would never
bother setting it from attestation_cfg that came at runtime.

The bug is fixed and the healthcheck behavior is hardened. Currently,
the lazy_static block will explicitly initialize the global with
default values from attestation_cfg (enable is true, window size is
100). This prevents a similar human error from disabling the
healthcheck. Secondly, main.rs overwrites the default values using the
HealthCheckState::new() constructor, instead of individual struct
member assignments. This ensures that all necessary values or their
defaults are passed as the desired healthcheck state.

* p2w_autoattest.py: Get debug output from first attestation

* wormhole-attester: fix ()-less function bug, harden usize convertion

This change fixes a bug that would cause a gigantic allocation to
happen, after the attestation_cfg::default_healthcheck_window_size
function is taken without being called and converted to a very large
usize value. This would result in a big allocation which would crash
the attester. At the core it's a misunderstanding about "Fn() as
usize" conversion which unfortunately is safe Rust.

* Trigger build

* wormhole-attester: Fix a misuse of a mutex guard

This commit changes the `let hc = <lock the mutex>` into a direct
assignment to the locked mutex guard. Rust mutices are typically
scope-based which makes using them in variables more error prone.

* Dockerfile.client: Remove unused ADD wormhole-attester.

This speeds up the build of the container, and prevents useless
triggers from the attester codebase

* p2w_autoattest.py: simplify log filtering to just info
2023-01-05 15:27:15 +01:00