Commit Graph

86 Commits

Author SHA1 Message Date
Stanisław Drozd b1afaacabf
drozdziak1/pyth attester rpc timeout fix (#391)
* pyth2wormhole-client: Stagger attestation sched jobs

* pyth2wormhole-client 1.0.0-rc1

This is an initial semver release for the pyth2wormhole-client package.

* p2w_autoattest.py: Add env for atteser --timeout option

* pyth-attesster v1.0.0-rc2

* pyth-attester-v1.0.0-rc3

This fixes a typo in p2w_autoattest.py

* pyth-attester-v1.0.0
2022-11-18 14:00:44 +01:00
Ali Behjati 61b84c84ac
[test-publisher]: Set cap on dyn added symbols (#371)
* [test-publisher]: Set cap on dyn added symbols

Currently the test publisher creates a new symbol every two minutes
without any cap and running tilt for a
long time will eventually drain all the resources.

This change sets a cap of PYTH_TEST_SYMBOL_COUNT
on the dynamically added symbols. It means that the publisher
starts with PYTH_TEST_SYMBOL_COUNT and will add at most
PYTH_TEST_SYMBOL_COUNT new symbols after that

* Update third_party/pyth/pyth_publisher.py

Co-authored-by: Stanisław Drozd <stan@nexantic.com>

* Update third_party/pyth/pyth_publisher.py

Co-authored-by: Stanisław Drozd <stan@nexantic.com>

* Update third_party/pyth/pyth_publisher.py

Co-authored-by: Stanisław Drozd <stan@nexantic.com>

Co-authored-by: Stanisław Drozd <stan@nexantic.com>
2022-11-03 13:58:44 +01:00
Ali Behjati 044a867e11
Add verify command for wormhole msg (#363) 2022-10-27 10:02:38 +02:00
Ali Behjati eea42578b0
Abehjati/simplify-multisig-cli (#361)
* Move some configs to a config file inside code

* Remove redundant ledger logs

* Use getSquads for execute too

* Refactor ledger logging removal

* update Readme
2022-10-25 14:45:26 +02:00
Ali Behjati 4629f689e4
Add receive time to the price service (#360)
* Add receive time to the price service

* Bump version to 2.1.0
2022-10-24 19:16:56 +02:00
Stanisław Drozd 3eb2beabe7
Drozdziak1/p2w attest cont mapping reload (#330)
* pyth2wormhole-client: automatically crawl mapping based on interval

* Make the mapping crawl automation seamless

* pyth2wormhole-client: Make mapping crawling routine more robust

This change takes care of recoverable mapping crawling
errors (e.g. malformed single price on single product is no longer
dropping otherwise good different prices and products in the mapping
in favor of a warn message)

* pyth2wormhole-client: Move mapping crawl sleep near logic it affects

* pyth2wormhole-client: remove stray comment

* pyth2wormhole: Fix faulty merge with master

* pyth2wormhole-client: Fix mapping crawl price counting

* pyth2wormhole-client: split daemon/non-daemon, improve readabi[...]

...lity and remove most warnings

* pyth2wormhole-client: parts-per-thousand -> base points

* pyth2wormhole-client: inaccurate comment

* p2w-client: review advice - bp -> bps, std hasher -> sha256

* pyth2wormhole-client: reuse message queue across mapping lookups
2022-10-24 17:19:25 +02:00
Daniel Chew b784abd144
add change-threshold, add-member, and remove-member (#358) 2022-10-20 17:25:53 +08:00
Ali Behjati bdc492f919
[eth] Some contract improvements (#356) 2022-10-19 19:47:09 +02:00
Ali Behjati 398b18743d
[eth] Make governance transfer less error-prone (#355) 2022-10-19 19:46:26 +02:00
Ali Behjati d3d10f2ce2
Add set fee to tests + add some sanity checks (#350)
* Add set fee to tests + add some sanity checks

* Add fee to evm relayer
2022-10-18 19:07:37 +02:00
Tom Pointon 079f8cc0b7
Add AptosAuthorizeUpgradeContractInstruction to xc-governance-sdk-js (#328) 2022-10-17 16:20:23 +02:00
Ali Behjati f77987df70
Fix logging of vaa as hex (#345) 2022-10-13 11:08:02 -05:00
Stanisław Drozd b3dbc96086
pyth_publisher.py: Add a new symbol every 2 minutes (#331)
This change will help us verify the correctness of the mapping
crawling logic in p2w-attest.
2022-10-11 13:46:26 +02:00
Stanisław Drozd 44559109f0
p2w-client: Remove --log-level, rely on RUST_LOG, provide default (#333) 2022-10-10 13:25:19 +02:00
Stanisław Drozd ef37c86b32
p2w-client: move rpc_interval to config, test fast rate accuracy (#334) 2022-10-06 17:44:26 +02:00
Ali Behjati d7f436a856
Cascade Pyth SDK JS update to downstream packages (#326)
* Fix annoying ethereum problem

* Update p2w-sdk

* rename + lint + format + bump to 1.0.0

* Update price service

* Bump version + format + add lint

* Fix price service linting issues

* Fix package rename issue

* Update package lock of dependencies

local dependency is aweful!

* Fix exclusion bug
2022-10-06 09:21:04 +02:00
Ali Behjati 983813d2f8
Use sdk getIxAuthorityPDA + format (#324) 2022-09-30 19:49:58 +02:00
Jayant Krishnamurthy 575199f724
set is-active fixes (#323)
* merge

* use the right command here

* fix handling of boolean

* cleanup

Co-authored-by: Jayant Krishnamurthy <jkrishnamurthy@jumptrading.com>
2022-09-30 09:00:48 -07:00
Daniel Chew 29f53df71c
add support to execute tx through squads ui (#322) 2022-09-30 21:24:16 +08:00
guibescos 3a56d0a8d9
Fix error (#321) 2022-09-29 23:03:03 -05:00
Jayant Krishnamurthy 0d3f030ad2
update staleness check (#319)
Co-authored-by: Jayant Krishnamurthy <jkrishnamurthy@jumptrading.com>
2022-09-29 13:36:39 -07:00
guibescos 16bdc0f4c3
Guibescos/cli for attester admin (#314)
* Add payload generators

* Executor cli no longer a lib

* Expose instructions in client

* Format

* Cli

* Fix CI

* Fix CI, second try

* Fix CI, second try

* Fix CI, third try

* Fix CI, foruth try

* Remove pythnet from dockerfile wasm

* Test

* Revert "Test"

This reverts commit ffa702b249f821aee0a781b680bdf51d038859cf.
2022-09-29 15:24:47 -05:00
Jayant Krishnamurthy 89cc35d3a0
Run prettier (#318)
Co-authored-by: Jayant Krishnamurthy <jkrishnamurthy@jumptrading.com>
2022-09-29 13:22:14 -07:00
Jayant Krishnamurthy 863a983a1a
Add set-is-active instruction and some minor tweaks (#317)
* add set-is-active instruction and some minor tweaks

* stuff

* whoops

Co-authored-by: Jayant Krishnamurthy <jkrishnamurthy@jumptrading.com>
2022-09-29 12:57:35 -07:00
guibescos c4238c7a91
Guibescos/expose attester instructions (#313)
* Add payload generators

* Executor cli no longer a lib

* Expose instructions in client

* Format
2022-09-29 09:15:42 -05:00
Daniel Chew 0a1f31a952
use squads mesh package instead (#310) 2022-09-28 15:24:13 +08:00
Daniel Chew 6d528ffbe2
update solidity package version (#304) 2022-09-26 23:43:47 +08:00
Jayant Krishnamurthy bf032f07c2
Delete one more noisy log message (#296)
Co-authored-by: Jayant Krishnamurthy <jkrishnamurthy@jumptrading.com>
2022-09-21 11:24:14 -07:00
Jayant Krishnamurthy 71a6ae687e
Make this log message less noisy (#285)
* make this log message less noisy

* build

Co-authored-by: Jayant Krishnamurthy <jkrishnamurthy@jumptrading.com>
2022-09-21 11:06:13 -07:00
Stanisław Drozd fdafbe32a4
Drozdziak1/p2w client use mapping crawl (#294)
* p2w-client: Add attestation config merging logic

This change adds code to append new symbols to an existing attestation
config. In conjunction with the mapping crawling logic, this will aid
in hot reloading attestation configs in runtime

* pyth2wormhole-client: Use the crawled mapping symbols
2022-09-21 16:49:37 +02:00
Stanisław Drozd 163fa44f24
Drozdziak1/p2w client mapping crawl (#286)
* pyth2wormhole-client: Add a mapping crawling routine

* pyth2wormhole-client: Add mapping_addr for attestation config

* pyth2wormhole-client: cargo fmt
2022-09-21 10:38:17 +02:00
Ali Behjati 2ad991f4ab
Abehjati/add-eth-governance (#279)
Also add governance-sdk-js to generate messages (both in testing and in multisig)
2022-09-20 18:24:57 +02:00
Ali Behjati b86a9d1b38
Use hex payload instead of string (#284) 2022-09-19 15:38:49 +02:00
Jayant Krishnamurthy bfb3b7bab3
Move staleness check to new endpoint (#278)
* move staleness to new endpoint

* actually send the response

* Add schema

* Fix freshness metric to use publish time instead of attestation Time

* Rename endpoint to /api/ + small fix

* Bump version

Co-authored-by: Jayant Krishnamurthy <jkrishnamurthy@jumptrading.com>
Co-authored-by: Ali Behjati <bahjatia@gmail.com>
2022-09-14 19:57:38 +02:00
Daniel Chew f3e17ad307
add ledger support (#277)
* add ledger support

* address feedbacks
2022-09-15 01:26:39 +08:00
Daniel Chew 1c6977ec96
add pyth multisig cli program (#276) 2022-09-14 10:36:52 +08:00
Daniel Chew 8c0e9b6e2e
add new freshness check to price-service /ready endpoint (#275) 2022-09-12 15:57:45 +08:00
Daniel Chew 303385bfbd
enable verbose property to return metadata for ws endpoint (#271)
* enable verbose property to return metadata for ws endpoint

* remove console log

* fix test cases failing

* fix spelling errors

* update callback and listener to use PriceInfo

* isolate verbose flag to each client and add tests

* isolate verbose flag from clients
2022-09-07 23:27:44 +08:00
Stanisław Drozd 15f3175f91
p2w: Make commitment usage consistent (#270)
This changeset adjusts p2w_autoattest.py commitment to confirmed and
fixes a get_transaction() failure that happened due to the upstream
default finalized commitment setting (RpcClient's set value is not
used). This is fixed by using the chosen commitment explicitly via
get_transaction_with_config()
2022-09-06 16:21:02 +02:00
Daniel Chew b846fc3c84
add new latest_price_info endpoint (#264)
* add new latest_price_info endpoint

* add verbose query param to latest_price_feeds

* add back logging statement for VAA

* trigger CI
2022-09-06 00:02:57 +08:00
Stanisław Drozd aa7be4d1be
Drozdziak1/p2w client error logging and docker caching (#268)
* p2w-client: Fix silent logs, restore program log printing

For some time now, p2w-client error reporting would fail to show
daemon mode errors. The logs would only mention resends without ever
showing failed attempts.

with solana-program 1.10.31 came a newer, inferior program log
reporting which only says "N program logs" instead of saying what they
are. This changeset prints errors verbatim using formatted debug
"{:#?}" syntax.

* Docker: Improve p2w-attest/solana-devnet caching

This commit speeds up caching in two ways:

1. By severing the dependency on bridge-client in
Dockerfile.p2w-attest - mainly because of unnecessary `cargo install`
builds which even with target dir caching can take ~1 minute. The
bridge/token-bridge client binaries are not useful to p2w-client anyway.

2. By attaching cargo-install commands to a target dir cache via the
--target-dir option in cargo
2022-09-05 17:00:24 +02:00
Ali Behjati b4c8f2e470
Refactor our CW contract + cleanups (#262)
* Use the cw sdk

* Fix clippy warnings

* Use Addr instead of String

* Format the code (cargo +nightly fmt)

* Depend on wormhole git instead of local dependency

* Add error enum

* refactor

* Refactor errors

* certusone->wormhole-foundation rename

It will fix some compile problems

* Build wormhole contract from their repo

* remove wormhole package

* Remove memmap2 patch

It was not needed anymore with the newer
verison of solana (wormhole removed it too)

* Rename pyth-bridge to pyth-cosmwasm
2022-09-02 12:39:51 +02:00
Stanisław Drozd 6382f540db
Wormhole message reuse via post_message_unreliable (#261)
* pyth2wormhole: Implement reusable message PDAs

This changeset converts attest() to use a new PDA for
reusable/unreliable wormhole message account. Each PDA is tied to a
given attest() payer with an index that lets them rotate a number of
message accounts. Keeping the appropriate timing of the reuses is up
to the message owner, who should rotate a number of PDAs.

* pyth2wormhole-client: Add a message acc rotation impl

* p2w attest(): Integrate with bumped wormhole and fix call issues

* p2w-client: Format code, fix test_attest, refactor message index

* Dockerfile.client, Dockerfile.p2w-attest: Improve caching

The main improvement comes from running cargo-install from within a
workspace which lets us cache target/

* p2w-client: Make reusable messages configurable in yaml

* p2w on-chain: refactor to unreliable-only, adjust msg balance, nits

* p2w-client: P2WMessageIndex -> P2WMessageQueue, queue tests

* p2w-client: Add a hard limit to the message account queue
2022-09-01 18:47:24 +02:00
Stanisław Drozd a2a0f6e15b
Start depending on the upstream out-of-tree Wormhole (#258)
* Add out-of-tree dependency on wormhole v2.8.9

This lets us outsource all wormhole/solitaire code to the upstream
certusone repo

* Docker.client: Use cargo-install to install binaries from github

* p2w: fix solana-program wasm-bindgen

* pyth2wormhole: Fix code-level errors against newer solitaire

* p2w: Use upstream wormhole rust code, bump guardian to 2.8.9

* guardian: ensure solana is on, spy: bump image to 2.8.9

Co-authored-by: Reisen <reisen@morphism.org>
2022-08-29 16:18:41 +02:00
Daniel Chew 3100ab9e53
add api endpoint to get all supported price feed ids for price service (#259)
* add new /price-feed-ids rest endpoint

* add docker-compose.yaml and update README

* Update third_party/pyth/price-service/README.md

Co-authored-by: Ali Behjati <bahjatia@gmail.com>

Co-authored-by: Ali Behjati <bahjatia@gmail.com>
2022-08-26 07:27:03 +08:00
Ali Behjati 586eba0eb9
Abehjati/release-price-service (#251)
* npm audit fix

* Update package name

* Remove guardian image and use official ones

* Update README

* Fix config file name

* Use aws public repo
2022-08-22 10:05:22 +02:00
Ali Behjati bf021010cc
evm-watcher: Add logic to group events for dispatch (#242)
* Add logic to group events for dispatch

* Add comment about one important assumption

* Address review comments
2022-07-28 16:04:57 +02:00
Ali Behjati 07bf9dbee2
Abehjati/use-cw-1-for-contracts (#240)
* Bump version of cw packages from 0.16.0 to 1.0.0

* Fix build

* Update wormhole details

* Update js packages

* Update dockers, configs, to use cosmwasm 2 in tilt

* Update wormhole and pyth addresses everywhere

The migration file is probably not necessary for us.
To be deleted later.

* Update gh action name
2022-07-20 16:35:01 +02:00
Stanisław Drozd f0552e5f1b
pyth2wormhole-client: refactor into fully-async futures-based approach (#219)
* pyth2wormhole-client: refactor into fully-async futures-based approach

commit-id:2ed35045

* p2w-client: Change inconsistent rpc constructor

commit-id:cb3b2ff2

* p2w-client: Move job creation to a function, simplify comment

commit-id:35328b38

* pyth2wormhole-client: Use get_multiple_accounts

commit-id:7fc85157

* Implement a rate-limited mutex for RPC client

commit-id:1a243063

* pyth2wormhole-client: only guard beginning new requests in RLMutex

commit-id:d8251474

* pyth2wormhole-client: RLMutex: ensure the inner guard is not dropped

commit-id:c3513f5e

* pyth2wormhole-client: Clarify attestation_sched_futs comment

commit-id:97033670

* pyth2wormhole-client: Use CommitmentConfig's native FromStr parsing

commit-id:835d7125

* pyth2wormhole-client: doc comment typo

commit-id:5ee388de

* pyth2wormhole-client: move closures to their own async functions

This makes the main.rs async attestation routines easier to read.

commit-id:3565a744

* pyth2wormhole-client: fix merge typo

* pyth2wormhole-client: Apply Tom's readability advice

* pyth2wormhole-client reword attestation_sched_job() comment

* pyth2wormhole-client: expand attestation_sched_job() comment

* pyth2wormhole-client:   e  x  p  a  n  d   the comment

* Trigger CI

* p2w-client/main.rs: correct missing awaits after merge
2022-07-18 14:40:03 +02:00
Ali Behjati e76181ace6
Add pyth-evm-watcher to tilt (#238) 2022-07-15 17:37:58 +02:00