Commit Graph

2348 Commits

Author SHA1 Message Date
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
guibescos 4796516209
Fix modal for delete product (#768) 2023-04-17 21:34:54 -05:00
Dev Kalra ec65d3ca81
[cosmwasm] osmosis release (#767)
* update contract version

* update script to build for osmosis

* update pyth sdk cw version

* update release pipeline

* fix pipeline
2023-04-17 18:25:09 +05:30
Jayant Krishnamurthy 6126db74fc
[price_service] Let callers specify VAA encoding (#766)
* Callers can specify encoding

* lint

* changed my mind about this one

* cleanup

* cleanup

* bump version
2023-04-14 11:29:41 -07:00
Dev Kalra 15060d6a5e
[cosmwasm] Osmosis multiple fee token support (#763)
* osmosis txfee supoort

* add get update fee for denom

* query for tx fee support

* add fee checker

* add comment

* implement osmosis code

* correct err response

* fix bugs

* cargo update

* disable rust feature

* return bool instead of result

* add wormhole comment

* tests added

* address feedback

* improve comments

* cargo update
2023-04-14 12:19:57 +05:30
Jayant Krishnamurthy 42ddfb6466
Get price feed endpoint (#764)
* Add get price feed endpoint

* fix stuff

* lint

---------

Co-authored-by: Jayant Krishnamurthy <jkrishnamurthy@jumptrading.com>
2023-04-13 20:00:50 -07:00
Jayant Krishnamurthy 85b00ff800
Move cosmwasm sdk into standard tree structure (#761)
* move cosmos sdk into standard tree structure

* fix typo

---------

Co-authored-by: Jayant Krishnamurthy <jkrishnamurthy@jumptrading.com>
2023-04-13 12:28:05 -07:00
Jayant Krishnamurthy 91dfc36e85
Move cosmwasm sdk into standard tree structure (#761)
* move cosmos sdk into standard tree structure

* fix typo

---------

Co-authored-by: Jayant Krishnamurthy <jkrishnamurthy@jumptrading.com>
2023-04-13 12:27:34 -07:00
guibescos 3aa953e153
[xc-admin] Add support for arbitrary wormhole payloads (#759)
* Add vaa

* Remove the command from multisig_wh_message_builder

* Add comment to the multisig addresses
2023-04-13 11:51:57 -05:00
guibescos 99ed193764
[xc-admin] Add ser/de for Cosmos Upgrades (#758)
* Add ser/de for Cosmos Upgrades

* Add comment

* Fix print
2023-04-13 11:51:47 -05:00
Jayant Krishnamurthy c2484b1514
Gas usage experiments (#756)
* add gas usage experiments

* add proof verification

* extend existing contract

* update struct

* cleanup

* add threshold comparison

* ok this mostly works

* fix

* comment

* rename

* use rand utils
2023-04-11 07:07:45 -07:00
guibescos f5d11c248d
Rename init price (#755)
* Rename init price

* Set exponent
2023-04-10 20:30:58 -05:00
Dev Kalra 1371f18e84
add injective mainnet (#754) 2023-04-10 17:08:19 +05:30
Jayant Krishnamurthy 843a30c2c7
[solana] Add pre-commit for solana target chain contract (#753)
* precommit

* format
2023-04-09 19:38:29 -07:00
Ali Behjati 85b9c80e2a
[eth] Add Canto mainnet (#751)
* [eth] Add Canto mainnet

This deployment also enables contract rewards on canto. Since the
changed code is only specific to the Canto network and is used only
in initialization, only the diff is added as a file.

* Remove ds store

* Add some doc to deploying.md
2023-04-07 17:49:01 +02:00