Commit Graph

1992 Commits

Author SHA1 Message Date
Ali Behjati 59ac319305
Abehjati/rename-terra-to-cw (#239)
* Rename terra folder to cosmwasm

* Update dockers and tilt

* Update gh action
2022-07-19 16:26:41 +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
Ali Behjati 1f785d5a7f
Add watcher base files and structures (#237)
* Add watcher base files and structures

* Add missed files!

* Update package.json info

* Update PythUpdateEvent

* Restructure the code

* Fix division
2022-07-15 14:37:48 +02:00
Stanisław Drozd 9dbfbd4174
[WIP] p2w-client: Implement a migrate command and instruction generator (#232)
* p2w-client: Implement a migrate command and instruction generator

* Fix minor bug in gen_migrate_tx

* Fix migration test and add a test for success

Co-authored-by: Ali Behjati <bahjatia@gmail.com>
2022-07-13 15:57:16 +02:00
Stanisław Drozd 3d62f2b4f5
guardiand: Bump wormhole sources (#236)
Before this change, a fresh build from scratch would cause a guardian
software compilation error ("Failure: empty digest") that would
normally be hidden by caching in CI.
2022-07-13 13:39:38 +02:00
Tom Pointon 8f8eee7c92
Make Pyth contract abstract (#234) 2022-07-13 11:02:37 +01:00
Tom Pointon b062cd51fa
Remove unnecessary payable marker from wormhole address (#235) 2022-07-13 11:02:22 +01:00
Jonathan Claudius b7331ad10a
Add bug bounty and audits (#233) 2022-07-12 18:02:47 -04:00
Ali Behjati c69d372ea5
Update Deploying.md (#231) 2022-07-07 18:37:31 +02:00
Ali Behjati 6a46dfcb6e
Use single server for both ws and http (#230)
* Use single server for both ws and http

* Format code
2022-06-30 12:51:06 +02:00
Stanisław Drozd da1f19bf0b
ethereum: Add support for multiple emitter/chain ID pairs (#228)
* ethereum: Add support for multiple emitter/chain ID pairs

* ethereum: Simplify data source methods, add tests, fix flag bug

* ethereum: Fix incorrect removeDataSource condition, harden its test

* ethereum: Add the multi-source migration to prod-receiver

* PythState.sol: rephrase comment about new data source API

* ethereum/test/pyth.js: run prettier formatting

* ethereum: replace multi-source migration with addDataSource call

* ethereum: mark older chain/emitter ID state as deprecated
2022-06-29 15:10:53 +02:00
Ali Behjati 21dfc32e43
Abehjati/pyth-evm-contract-fire-event (#229)
* Use new solidity sdk

* Emit events in contract

* Fix max gas issue that caused error

* Add tests for PriceUpdate event

* Delete a test network file
2022-06-27 17:41:55 +02:00
Ali Behjati 4667c5fd12
Fix wrong branch names (#227)
* Fix wrong branch names

* add logging

* Add more log and test buildkit

* Remove loggings
2022-06-23 18:41:13 +02:00
Ali Behjati 4d5664a79f
Add image push ci for price service (#225)
* Add image push ci

* Update image-push.yml
2022-06-23 12:48:47 +02:00
Stanisław Drozd bbad8fb544
pyth2wormhole: Add an is_active flag to on-chain config (#224)
* pyth2wormhole: Add an is_active flag to on-chain config

This new flag will help enable/disable attester contracts between deployments

* p2w-client: typo

* p2w-client: add is_active to init

* pyth2wormhole config.rs: mention removing old structs, reword

* pyth2wormhole: remove unused config data struct from migrate()

* pyth2wormhole migrate(): leave a note about AccountState::Uninitialized

* Update solana/pyth2wormhole/program/src/migrate.rs

Co-authored-by: Reisen <Reisen@users.noreply.github.com>

* Update solana/pyth2wormhole/program/src/migrate.rs

Co-authored-by: Reisen <Reisen@users.noreply.github.com>

* Update solana/pyth2wormhole/program/src/migrate.rs

Co-authored-by: Reisen <Reisen@users.noreply.github.com>

* p2w program: missing deref typo

Co-authored-by: Reisen <Reisen@users.noreply.github.com>
2022-06-22 13:37:15 +02:00
Ali Behjati 1a12005fbf
Use attestationTime instead of seqnum (#226)
SeqNum is not suitable for multiple sources, attestationTime is good
but we should be careful of solana clock falling behind

Also use this time for freshness metric because it's more useful.
2022-06-22 13:31:54 +02:00
Ali Behjati a0d47178bf
Add aurora_testnet deploy data (#223)
* Add aurora_testnet deploy data

* Add wasm as dependency to tilt

As Stan figured out in another PR
2022-06-20 10:22:25 +02:00
Ali Behjati df1854752c
Add Websocket to price service (#221)
* Add initial working ws

* Add tests

* Add prom metrics + improve logging

* Handle ids with leading 0x

* Add a multi client test

* Minor code format

* Fix Typo

* rename PriceFeedPriceInfo to PriceStore

It is because in the future we might have multiple spies and this
will be a middleware store

* format the code
2022-06-17 17:32:50 +02:00
Ali Behjati b5555b80f7
Deploy Pyth to testnet networks (#218)
* Deploy Pyth to testnet networks

Deploys to:
- Goerli and Ropsten (eth testnet)
- Fuji (Avalanche testnet)
- Fantom Testnet
- Mumbai (Polygon testnet)
- BNB Testnet

* Update deploying doc for testing

* Improve docs

* Add manual verification process
2022-05-24 13:28:02 +02:00
Reisen 2eb0ed7d12
P2W Focused README/DEVELOP.md (#220)
* readme: Update README to reflect P2W structure

* readme: fix URLs
2022-05-23 08:48:34 +02:00
Ali Behjati 2c1e987b31
Add networks configs (#217)
* Add networks configs

Wormhole addresses are available here:
https://github.com/certusone/wormhole/blob/dev.v2/sdk/js/src/utils/consts.ts

* Fix typo

* Fix a bug in ropsten env
2022-05-20 15:16:24 +02:00
Ali Behjati 09fcb158dd
Add wormhole receiver + docs on how to use it (#216)
* Add wormhole receiver + docs on how to use it

* Fix a mistake in comment

* Update docs + add wormhole receiver address to the registry
2022-05-20 13:12:50 +02:00
Ali Behjati b2becab951
Abehjati/cleanup again (#215)
* Remove unneeded and unused stuff

* removes guardian + use fixed version release of it

* Remove more stuff
2022-05-20 12:43:31 +02:00
Ali Behjati a1507952f6
Cleanup Ethereum from unused stuff (#214)
Also moves wormhole stuff to a separate directory
2022-05-18 15:12:26 +02:00
Ali Behjati 4dc863abc9
Update contract (#213) 2022-05-18 12:53:20 +02:00
Ali Behjati 75e354f0f6
Update deployment doc (#212) 2022-05-18 10:40:48 +02:00
Stanisław Drozd c613271a93
Bump Solana to v1.10.13, bump borsh to v0.9.3, bump clap to v3.18 (#210)
* Bump Solana to v1.10.13, bump borsh to v0.9.3, bump clap to v3.18

commit-id:519b2a6d

* p2w-sdk/rust: update Cargo.lock

commit-id:b7945666
2022-05-17 08:53:30 +02:00
Ali Behjati cabb5e08f5
Remove unneeded logging (#211) 2022-05-16 17:00:24 +02:00
Ali Behjati ce56351c3e
Abehjati/pyth-evm-update-method (#209)
* Add updatePriceFeeds to eth contract

* update gitignore

* Update typos

* Use calldata instead of memory for gas efficiency
2022-05-16 13:44:43 +02:00
Stanisław Drozd c9ef5ec365
p2w-client: Implement basic unwindowed stats + change SOL commitment to Confirmed (#208)
This commit adds TPS, success/error rates and average same-batch
resend delays.

commit-id:e73abcf5
2022-05-16 13:40:30 +02:00
Jonathan Claudius 1af5eda656
Add SECURITY.md (#206) 2022-05-16 09:22:55 +02:00
Tom Pointon 4f4bec508e
EVM deployment scripts and documentation (#141)
* Make Migrations contract Ownable

* Add prod deployment migrations

* Add BSC Testnet deployment configuration

* Add documentation for deploying contracts to production

* Fix test environment script for deployment to development network

* Fix tilt issues + refactor

Co-authored-by: Ali Behjati <bahjatia@gmail.com>
2022-05-13 10:25:35 +02:00
Stanisław Drozd 941017de4b
p2w-client: Implement additional trigger conditions (#207)
* p2w-client: Implement additional trigger conditions

From now on, we support price change by a given percentage as well as
publish time changes for triggering attestations.

commit-id:9bd145e1

* p2w-client: Harden price_pct_change for negative values

commit-id:cb679208

* p2w-client: Make sure we always update each symbol's state

commit-id:27f276dc

* p2w-client: include resend state lookups in the RPC interval setting

commit-id:68de125f

* p2w-client: Improve local symbol state handling, min interval=60s

With this change, we update local state only if we meet a
condition. Additionally, the publish_time change becomes a
configurable minimal delta.

commit-id:f8139cd6

* p2w-client: Fix a state update bug for state updates

commit-id:29f44a39
2022-05-12 14:39:49 +02:00
Stanisław Drozd 7b1dbc1938
p2w-client: Move batch state to a new module, harden status access (#205)
* p2w-client: Move batch state to a new module, harden status access

commit-id:8265cb5b

* Trigger CI

commit-id:be75d126
2022-05-11 18:02:59 +02:00
Ali Behjati 1a3d8f211e
Make query parameters required (#204)
Apparently default is optional
2022-05-11 10:38:07 +02:00
Ali Behjati d997a9bcf2
Accept hex addresses with 0x in price service (#203) 2022-05-09 11:41:28 +02:00
Stanisław Drozd a1e50ae636
Drozdziak1/p2w client sym groups (#199)
* pyth2wormhole-client: Implement and use daemon mode

commit-id:7001bdf7

* pyth2wormhole-client: harden CLI, simplify attestation loop

commit-id:ad5e4857

* pyth2wormhole-client: Refactor symbol config into groups

This commit implements the notion of a symbol group - a collection of
symbols that are attested according to the specified set of
condition. Currently, only an attestation frequency is supported. In
the future, this value will serve as a fallback for symbols that
rarely trip other conditions.

commit-id:cf19cc41

* p2w_autoattest.py: Use symbol groups in config

commit-id:1153c5f7

* Dockerfile.client: bump toolchain version to mitigate compiler error

The previous compiler version encountered a bug when building
pyth2wormhole-client for testing. The error message mentioned serde,
which is tested inside the `attestation_cfg.rs` module.

commit-id:61c12427

* p2w_autoattest.py: Add another test group

commit-id:2e29583c

* p2w-client: Get rid of sent_at, clarify messages, add status setter

commit-id:87653ab1
2022-05-06 18:29:47 +02:00
Ali Behjati 6ce60e5ba6
Refactor Price Service + Add tests (#202)
* Add Rest Exception

* Add tests

* Update endpoint names and query params
2022-05-06 12:27:59 +02:00
Stanisław Drozd 35912e874e
p2w-attest contract: disambiguate set-config types (#201)
* p2w-attest contract: disambiguate set-config types

commit-id:999f3954

* p2w-attest set-config: also print the same mismatched value

commit-id:732e2773
2022-05-05 13:40:02 +02:00
Ali Behjati 11e15c96b0
On not found price id return list of not found ids (#200) 2022-05-05 13:10:35 +02:00
Stanisław Drozd 7b9d5b1c22
ethereum/: use publishTime instead of attestationTime for queries (#196)
commit-id:b3c87e4e
2022-05-04 21:29:35 +02:00
Ali Behjati ec7dcf7817
Price Service: Add support for multiple price id in vaa request (#198)
* Add support for multiple price id in vaa request
2022-05-04 10:00:24 +02:00
Eran Davidovich 5be5576f0c
fix: minor fixes to wasm and price dockerfiles (#197)
CU-2frzq03

Co-authored-by: Eran Davidovich <edavidovich@jumptrading.com>
2022-05-03 13:41:36 +03:00
Ali Behjati e13b146dfd
Abehjati/refactor-pyth-terra-contract (#195)
* rename query_price_info to query_price_feed

It's more consistent with schema and sdk

* Resolve clippy warnings

* Format contract code

- Also changes our formatting rules to our standard in pyth-sdk-rs

* Remove unused UpgradeContract

* Remove duplicate test code
2022-05-02 14:47:58 +02:00
Stanisław Drozd 97ebef0c6c
pyth2wormhole-client: Implement and use daemon mode (#192)
* pyth2wormhole-client: Implement and use daemon mode

commit-id:7001bdf7

* pyth2wormhole-client: harden CLI, simplify attestation loop

commit-id:ad5e4857

* pyth2wormhole-client: Use requires_if for batch_interval/daemon

commit-id:0da03fd5
2022-05-02 13:08:03 +02:00
Ali Behjati 8635668417
Use publish time instead of attest time (#194)
* Use publish time instead of attest time

This is for the logic of price freshness.
2022-05-02 10:12:08 +02:00
Ali Behjati 60a69d3e83
Update terra contract to use new pyth sdk + new wiring format (#193)
* Update terra contract and terra relayer
2022-04-28 16:33:52 +02:00
Stanisław Drozd a4c749b99c
pyth2wormhole: implement wire format v3rev0 (#189)
* pyth2wormhole: implement wire format v3rev0

commit-id:c106d3b3

* pyth.js: Run prettier formatting

commit-id:fc9fb160

* ethereum: Fix tab indentation in Pyth contracts

commit-id:3d2ab7d8

* p2w-terra contract: fix formatting

commit-id:685dd14f

* p2w-sdk: Use wasm in the JS package, detect bundler/node via `window`

This commit makes sure that our wasm usage is more robust. We ensure
that the JSON representation renders all important numbers in their
string decimal form. b

commit-id:75f9c224

* p2w-sdk: review suggestions: field ranems, limit serde attributes

commit-id:9f596b80

* p2w-sdk/rust: Remove utils.rs and the helper type

commit-id:e72c6345
2022-04-25 18:32:25 +02:00
Ali Behjati 5b13be3bbf
Add logging & prom middlewares to Price Service (#191) 2022-04-25 16:05:43 +02:00