Commit Graph

2312 Commits

Author SHA1 Message Date
Jayant Krishnamurthy f82c87e37d
Fix path to CW sdk (#823)
Co-authored-by: Jayant Krishnamurthy <jkrishnamurthy@jumptrading.com>
2023-05-18 11:27:01 -07:00
Ali Behjati e283b15d20
[price-service] Improve vaa validation (#814)
* [price-service/server] Improve Vaa Validation

* [price-service/server] Improve performance

* Update wormhole guardian version
2023-05-17 20:20:17 +02:00
guibescos f70f163f72
Build proposer server (#820) 2023-05-16 16:59:11 -05:00
guibescos e243e6734b
[Xc admin] proposer server (#816)
* Proposer server

* Add package-lock.json

* Add rpc as enviornment variables
2023-05-16 13:15:08 -05:00
swimricky c23fc8dbad
[message-buffer 17/x] separate payer from admin (#819)
* feat(message-buffer): add payer to all contexts requiring lamports for rent

separate admin from payer of account creation/resize/deletion

* test(message-buffer): add test for same admin & payer

* feat(message-buffer/scripts): keep payer & admin the same in init-buffer script for simplicity
2023-05-16 13:57:09 -04:00
swimricky a115d88b09
[message-buffer 16/x] - integration repo scripts (#818)
* feat(message-buffer/scripts): add init-buffer script for integration repo

* feat(message-buffer/scripts): fix init-buffer scrtips
2023-05-16 12:33:45 -04:00
swimricky f0888549d7
[message-buffer 15/x] - audit fixes (#817)
* fix(message-buffer): set payer as admin in initialize (TOB-PYTH-5)

* fix(message-buffer/delete_buffer): remove auth validation in delete_buffer & add test (TOB-PYTH-7)

* fix(message-buffer): fix non-security-related findings

use constant for seeds, cap max target size, add more tests

* refactor(message-buffer): use seed consts in initialize, remove unused errors

* refactor(message-buffer): address PR comments

refactor missed consts, make initialize more readable
2023-05-16 12:08:36 -04:00
Dev Kalra 3b03f9eddc
[cosmwasm] instantiate contracts on multiple chains (#799)
* instantiate contracts on multiple chains

* deploy to neurtron

* function not being used anymore

* rename file dir

* better logs

* wormhole guardian upgrade

* set default wormhole contract

* add all to stages to one file

* add extended chain config

* bug fix

* juno deployment

* removed unused parameter

* resolve bug add comments

* typo

* rename to vaa mainnet

* comment

* remove T

* hardcode checksum

* update download method comment

* update package-lock

* update package-json
2023-05-16 13:13:43 +05:30
Dev Kalra 3fc996d6f9
[price-pusher] support for aptos (#815)
* aptos price listener

* price pusher aptos

* add comment

* update package lock

* remove eslint disable comments

* bump version

* npm i at root

* update readme

* address feedback

* update readme

* json fix
2023-05-15 21:14:28 +05:30
Ali Behjati 1dbc592836
[eth] Fix oracle-swap example frontend bugs (#813)
* [eth] Fix oracle-swap example frontend bugs

* [eth] Fix build warnings

* remove test

* add passWithNoTests to amm example

---------

Co-authored-by: Daniel Chew <cctdaniel@outlook.com>
2023-05-11 12:53:50 +02:00
swimricky 78d3c5c4ca
[message-buffer 14/x] - Message buffer/zero copy fixes (#811)
* test(message-buffer): add rust integration tests

add rust-toolchain.toml to pin rust version, add integration tests, update cpi caller auth seeds

* refactor(message-buffer): remove unused test ix

* chore(message-buffer): clean up

* refactor(message-buffer): simple refactor

* test(message-buffer): refactor integration test structure

* refactor(message-buffer): rename

* fix(message-buffer): fix min size check when shrinking msg buffer

* chore(message-buffer): cleanup

* fix(message-buffer): resize borrow bug fix

* test(message-buffer): refactor test util methods into MessageBufferTestContext for less duplication

* test(message-buffer): resolve merge conflicts from repo restructure

* chore(message-buffer): delete commented out code

* feat(message-buffer): use AccountLoader for zero-copy for resize/delete & put_all

* chore(message-buffer): clean up

* style(message-buffer): clean up

* fix(message-buffer): address PR feedback

revert to old put_all impl of using bytemuck for deserializing header, update tests add back old
check

* chore(message-buffer): clean up
2023-05-09 17:18:40 -04:00
swimricky 2e32a22725
[message-buffer 13/x] Rust Integration Tests (#794)
* test(message-buffer): add rust integration tests

add rust-toolchain.toml to pin rust version, add integration tests, update cpi caller auth seeds

* refactor(message-buffer): remove unused test ix

* chore(message-buffer): clean up

* refactor(message-buffer): simple refactor

* test(message-buffer): refactor integration test structure

* refactor(message-buffer): rename

* fix(message-buffer): fix min size check when shrinking msg buffer

* chore(message-buffer): cleanup

* fix(message-buffer): resize borrow bug fix

* test(message-buffer): refactor test util methods into MessageBufferTestContext for less duplication

* test(message-buffer): resolve merge conflicts from repo restructure

* chore(message-buffer): delete commented out code
2023-05-09 13:57:55 -04:00
swimricky 16baae6c99
fix(pythnet-sdk): fix modifiers (#809) 2023-05-09 09:22:12 -04:00
swimricky dab04d639b
[pythnet-sdk]: fix addresses & programIds in pythnet-sdk (#808)
* fix(pythnet-sdk): fix addresses & programIds in pythnet-sdk

* fix(pythnet-sdk): pin solana dev-dependency versions, fix visibility
2023-05-08 15:02:57 -04:00
Reisen 1902dbaa30
pythnet: replace pythnet_sdk with the right files (#803) 2023-05-05 21:04:49 +01:00
guibescos 71bab7a9fd
[evm] Make comment match the function below (#804)
* Make comment match the function below

* Fix precommit
2023-05-05 12:49:14 -05:00
Ali Behjati 1d59e9052b
[tilt] Fix issues (#801) 2023-05-05 15:31:57 +02:00
Reisen 677343c339
pythnet: move `pyth/` from pythnet and colocate other pythnet libs (#802) 2023-05-04 18:47:35 +01:00
njk-64 2f0ff1235a
Update SECURITY.md (#800) 2023-05-04 10:39:02 +01:00
optke3 b609b17fdf
[sui 7/x] - contract upgrades, version control (#762)
* state getters and setters, change Move.toml dependency to sui/integration_v2

* finish state.move

* add new line to pyth

* use deployer cap pattern for state module

* sui pyth

* update price feeds, dynamic object fields, Sui object PriceInfoObject

* register price info object with pyth state after creation

* sui governance

* some newlines

* error codes

* update and comment

* unit tests for pyth.move, add UpgradeCap to Pyth State (will be used for contract upgrades)

* updates

* test_get_update_fee test passes

* fix test_get_update_fee and test_update_price_feeds_corrupt_vaa

* test_update_price_feeds_invalid_data_source

* test_create_and_update_price_feeds

* test_create_and_update_price_feeds_success and test_create_and_update_price_feeds_price_info_object_not_found_failure

* test_update_cache

* update

* test_update_cache_old_update

* update_price_feeds_if_fresh

* comment

* contract upgrades start

* contract upgradeability

* update clock stuff

* edits

* use clone of sui/integration_v2 for stability

* make contract_upgrade::execute a public(friend) fun, remove clock arg

* E_INCORRECT_IDENTIFIER_LENGTH

* comment and edit

* add a single comment
2023-05-03 12:29:29 -04:00
Dev Kalra 079828f8ac
Wormhole stub (#789)
* add

* add sei to wormhole chains

* add wormhole code to the repo

* add lib to gitignore

* cosmwasm bug fix

* add tmp to gitignore

* no need for simulation

* add wormhole deployment stuff

* better comments

* resolve build errors

* trying a fix

* fix

* rename compiled code

* address feedback

* remove gitignore

* sei deployment

* complete sentences

* address comments
2023-05-03 20:48:00 +05:30
Ali Behjati f94dceb1bc
[eth] Add Pyth Accumulator (#776)
This PR adds the support WormholeMerkle accumulator message to the ethereum contract while still supporting the old message format. The code is not optimized yet and with more optimizations we can achieve a better gas usage. Currently based on the gas benchmark below it has a 18% improvement with a single price feed. Although the cost of updating 5 feeds in the same batch is higher than the current approach but in reality the chances that all 5 feeds be in the same batch is very low.
2023-05-03 16:08:53 +02:00
drptbl e7b72bf5c3
docker: add restart `on-failure` (#792)
* docker: restart on-failure

Signed-off-by: Jakub Mucha <jakub.mucha@icloud.com>

* Fix precommit

---------

Signed-off-by: Jakub Mucha <jakub.mucha@icloud.com>
Co-authored-by: Guillermo Bescos <g.bescos@yahoo.com>
2023-05-02 11:15:05 -05:00
Dev Kalra e248be526f
fix (#793) 2023-05-02 20:27:57 +05:30
guibescos 71632fa848
[docs] improve oracle amm (#791)
* Add address to Polygon clontract and cleanup

* Add url

* Typo

* Typo

* Improve writing

* Add comma

* Fix precommit

* Revert package-lock.json
2023-05-02 09:41:50 -05:00
guibescos 61a66eecaa
Build packages before publishing (#790) 2023-05-01 13:00:41 -05:00
Ali Behjati 8a5a74ec34
[hermes] Add WS (#773)
* [hermes] Add WS

* Address Jayant comments

* Update hermes/src/network/rpc/ws.rs

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

* Address David comments

---------

Co-authored-by: Reisen <Reisen@users.noreply.github.com>
2023-05-01 19:05:15 +02:00
guibescos facc2b6ff3
Pin axios (#787) 2023-05-01 08:45:06 -05:00
optke3 d8c69a63d0
[sui 6/x] - Pyth unit tests (#757)
* state getters and setters, change Move.toml dependency to sui/integration_v2

* finish state.move

* add new line to pyth

* use deployer cap pattern for state module

* sui pyth

* update price feeds, dynamic object fields, Sui object PriceInfoObject

* register price info object with pyth state after creation

* sui governance

* some newlines

* error codes

* update and comment

* unit tests for pyth.move, add UpgradeCap to Pyth State (will be used for contract upgrades)

* updates

* test_get_update_fee test passes

* fix test_get_update_fee and test_update_price_feeds_corrupt_vaa

* test_update_price_feeds_invalid_data_source

* test_create_and_update_price_feeds

* test_create_and_update_price_feeds_success and test_create_and_update_price_feeds_price_info_object_not_found_failure

* test_update_cache

* update

* test_update_cache_old_update

* update_price_feeds_if_fresh

* comment
2023-04-30 15:46:09 -04:00
optke3 f541ffa698
[sui 5/x] - Sui clock, error codes, fee computation (#740)
* state getters and setters, change Move.toml dependency to sui/integration_v2

* finish state.move

* add new line to pyth

* use deployer cap pattern for state module

* sui pyth

* update price feeds, dynamic object fields, Sui object PriceInfoObject

* register price info object with pyth state after creation

* sui governance

* some newlines

* error codes

* update and comment
2023-04-30 15:39:02 -04:00
optke3 2bbeb03ca9
[sui 4/x] - governance modules, update to sui `0.29.0` (#732)
* state getters and setters, change Move.toml dependency to sui/integration_v2

* finish state.move

* add new line to pyth

* use deployer cap pattern for state module

* sui pyth

* update price feeds, dynamic object fields, Sui object PriceInfoObject

* register price info object with pyth state after creation

* sui governance

* some newlines
2023-04-28 15:28:09 -04:00
guibescos 3e5600508b
Fix axios bug by downgrading, bump all dependents (#786) 2023-04-28 10:19:40 -05:00
swimricky df409c5633
feat(message-buffer): udpate program id (#785) 2023-04-26 14:17:30 -07:00
swimricky 04576df743
fix(message-buffer): address PR feedback from 779, update tests (#784)
* fix(message-buffer): address PR feedback from 779, update tests

Add new unit test for reading with cursor, update test setup

* refactor(message-buffer): refactor test methods, add big endian doc on MessageBuffer
2023-04-26 14:16:50 -07:00
guibescos d16594ca6b
[xc-pusher] Fix docker compose (testnet) (#781)
* Fix docker compose

* Fix typo

* Fix typo
2023-04-26 13:36:21 -05:00
Stanisław Drozd c210bf0f8b
message_buffer: Add Dockerfile with caching (#778)
* message_buffer: Add Dockerfile with caching

This dockerfile ensures as little cache invalidation as possible
through layer-caching and BuildKit cache mounts.

* dockerignowe -> dockerignore

* message_buffer/Dockerfile: Fix the final cached target move
2023-04-26 16:57:00 +02:00
Jayant Krishnamurthy 2bc98b426e
Use the right key for the message buffer (#782) 2023-04-25 13:29:32 -07:00
guibescos 350f8fa089
Fix comment (#780) 2023-04-25 12:57:54 -05:00
swimricky 794bd84c6f
[message-buffer 10/X] - Message Buffer Admin IXs & variable length (#779)
* ok

* ok

* it runs

* add this stuff

* working on tests

* feat(message-buffer): finish create_buffer ix, update put_all

* feat: rename bufferheader to messageBuffer, add delete_buffer impl

* feat(message-buffer): remove unused code, add additional checks, update unit tests

* style(message-buffer): fix pre-commit, run fmt & clippy

* fix(message-buffer): add verification checks, fix ts test

* refactor(message-buffer): rename update_whitelist_authority to admin

* fix(message-buffer): address PR comments

---------

Co-authored-by: Jayant Krishnamurthy <jayantkrishnamurthy@gmail.com>
2023-04-25 08:45:16 -07:00
swimricky 6a5b1c434a
[message-buffer 9/X] - Rename "accumulator" to message (#777)
* refactor(message-buffer): rename accumulator-input to message-buffer

refactor any names with accumulator to message

* refactor(message-buffer): change accumulator seed to message
2023-04-21 11:56:51 -07:00
swimricky 5a90ad96a5
accumulator-updater 8/x] - whitelist verification pda auth (#775)
* feat(accumulator-updater): change whitelist verification to use a signed PDA

* feat(accumulator-updater): address PR feedback

remove "auth" as seed
2023-04-21 08:03:25 -07:00
swimricky 7b0851f9b8
[accumulator-updater 7/x] - cpi max limit (#772)
* feat(accumulator-updater): add funding account for AccumulatorInput creation

* feat(accumulator-updater): add ix for testing cpi max size

add steps to notes.md on how to test against solana-test-validator with features deactivated

* test(accumulator-updater): fix max num of msgs to send

* refactor(accumulator-updater): address PR feedback from 771

update fund pda seeds, update consts, cleanup

* feat(accumulator-updater): address PR comments

Update cpi max test ix to take vec of msg sizes, clean up commented out code
2023-04-20 13:34:23 -07:00
Dev Kalra 259f0124f1
[cosmwasm] wormhole stub (#770)
* docker file to build wormhole contracts

* move to wormhole stub

* add comment

* update readme
2023-04-20 16:22:06 +05:30
guibescos d42b48972d
Improve README (#774) 2023-04-20 08:36:24 +02:00
Thomaz Leite 04b1a21dfe
[hermes] Pass Wormhole arguments from command line or env. vars (#769)
* Format p2p.go

* Pass Wormhole arguments from command line or env. vars

* Remove forget calls and let memory be freed (also remove confusing comment)

* Use proper types on command line arguments
2023-04-19 17:04:30 -03:00
swimricky 9fea461174
feat(accumulator-updater): add funding account for AccumulatorInput creation (#771) 2023-04-19 09:51:27 -07:00
swimricky 0ac771266c
[accumulator-updater 5/x] Single PDA (#760)
* feat(accumulator-updater): write accumulator messages into one account

* chore(accumulator-updater): clean up commented out code

* chore(accumulator-updater): remove unused feature for cargo

* chore(accumulator-updater): minor comment fix

* feat(accumulator-updater): update implementation of AccumulatorInput header

Removed InputIndex in header, updated to use end_offsets & include header_len

* feat(accumulator-updater): add MessageHeader to all PriceMessages and include in serialization

* fix(accumulator-updater): fix AccumulatorInput size & unit tests

* feat(accumulator-updater): update put_all to write as much data as possible

put_all will write up to the limit of the accumulator_input.data.len(). this ix must not fail even
when the data being written exceeds the size of the account. in this situation, we will write as
many *COMPLETE* messages as possible

* docs(accumulator-updater): update put_all ix documentation

* chore(accumulator-updater): addressed PR feedback

fixed comments, added test, renamed accumulatorInput.data to messages

* fix(accumulator-updater): fix ts test
2023-04-18 12:48:28 -07:00
Ali Behjati c951ff634a
[hermes] Improve latest feeds rest api (#752)
* [hermes] Improve latest feeds rest api

This change adds verbose and binary option to latest_price_feeds
endpoint. Unfortunately it exposes many internal information which
required touching different components to expose batch_vaa specific
information. The code is now coupled to batch_vaa and we need to
refactor it when we add other proof types (and eventually remove it when
it get deprecated).

* Update hermes/src/network/rpc/rest.rs

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

* Update hermes/src/network/rpc/rest.rs

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

* Fix merge

---------

Co-authored-by: Reisen <Reisen@users.noreply.github.com>
2023-04-18 18:14:07 +02:00
Ali Behjati 3ad3a46b1d
[hermes] add get price feed ids + refactor (#747)
* [Hermes] Add get price feed ids + refactor

* Address feedbacks
2023-04-18 17:50:34 +02:00
Ali Behjati 32596d5d4e
[hermes] Add more rest api methods (#746)
* [hermes] Add more rest api methods

Add many of the price service apis. Per David suggestion, we do
validation in parsing instead of doing it later. I didn't find
any suitable library to deserialize our hex format so I created
a macro to implement it because we use it in a couple of places.
I tried making a generic HexInput but couldn't make it working
(and I need other crates like generic_array for it which makes
the code more complex)

* Address feedbacks
2023-04-18 17:20:11 +02:00