Commit Graph

140 Commits

Author SHA1 Message Date
guibescos f6ad2d6544
Refactor (#431) 2022-12-19 13:20:32 +01:00
guibescos 51754457a6
[multisig-cli] Add support for json (#430)
* Draft

* Add verify for instruction payload

* Typos

* Refactor json parsing
2022-12-15 21:45:58 +08:00
guibescos e484f5cbb7
Check duplicates (#427)
* Check duplicates

* Cleanup

* Multisig/refactor wormhole to avoid many rpc calls (#428)

* Refactor wormhole

* Fix wasm bug

* hasWormholePayload becomes sync
2022-12-15 01:38:13 +08:00
Ali Behjati 09f8af74ed
[eth] Complete syncPythState.js (#425) 2022-12-13 17:54:15 +01:00
Jayant Krishnamurthy 024d73a8a8
[cosmos] Implement set fee governance instruction (#423)
* cosmos stuff

* it builds

* fix existing tests

* adding tests

* adding tests

* tidy

* cleanup

* fix

* update deploy script

* doh

* gr

* mabye

* mabye

* pr comments

Co-authored-by: Jayant Krishnamurthy <jkrishnamurthy@jumptrading.com>
2022-12-13 08:46:07 -08:00
Ali Behjati f45d6757e2
[price-service] Make gap metrics more accurate (#426)
* [price-service] Make gap metrics more accurate
* Bump version to 2.2.3
2022-12-13 15:52:02 +01:00
Stanisław Drozd f69a91d97c
Add the Squads Mesh program to Tilt and initialize a Vault for it (#421)
* solana-devnet: Deploy a copy of the Mesh multisig program

* solana/keys: Add keys for multisig testing

* *.py: Remove airdrop, use devnet_setup.sh keypair instead

* Dockerfile.p2w-attest: Improve caching

- Move cheap Python script additions after the expensive rust build
- Cache Cargo's package cache to shorten the "updating crates.io registry" build steps

* Add a multisig Tilt resource, k8s yaml and runtime script

This contains most of the work on Tilt/testing harness side.

* multisig-wh-message-builder: Add init-vault subcommand

This new subcommand enables the runtime Python script to create a
multisig vault on the fly on the mock Solana devnet.

* multisig-wh-message-builder: findProgramAddress -> getMsPDA

* mutlisig-wh-message-builder: apply review advice

- Use default mesh program address
- remove unused program.json
- remove redundant null checks
- hardcode vault address (it is deterministic against the constant
mesh program pubkey)
- Start depending on solana-devnet in Tilt
- Add carol to vault and set threshold to 2
2022-12-13 14:05:06 +01:00
Ali Behjati 20abde050b
Fix Vaa key for cache/metrics (#424) 2022-12-09 18:19:39 +01:00
Ali Behjati 6e279c84bb
Update the VAA hash to use payload hash (#422)
* Update the VAA hash to use payload hash

* Bugfix
2022-12-09 14:53:01 +01:00
Ali Behjati b1aea626e9
[eth] Add new networks and their configurations (#418)
* Add new networks RPCs

* Update governance sdk to support Wormhole receiver

* Fix receiver deployment script bugs

* Add new network configurations

* Add a comment about merging wh and receiver chains
2022-12-08 18:14:18 +01:00
guibescos a0d2422cf4
[multisig] Improve verify, add localnet (#420)
* Improve verify, add localnet

* Restore something

* Format

* Remove option
2022-12-08 22:27:31 +08:00
Ali Behjati e536b3a61e
[attester] Remove mapping from testing config (#419) 2022-12-08 14:03:27 +01:00
guibescos 90a9037ae1
Add some function to fetch the multisig state (#416)
* Add fetchers

* Cleanup

* Cleanup

* Restore index

* Format

* Typo

* Fix for loop

* Add offset option
2022-12-07 19:07:32 +08:00
guibescos a17e5b0cc0
Fix typo (#417) 2022-12-07 11:33:06 +08:00
Jayant Krishnamurthy a3199b7d28
Integration test for attestations (#413)
* integration test ???

* update

* better logging

* hm

* convert ids

* fix conversion

* what

* speed things up

* handle dynamic symbols properly

* pr comments

Co-authored-by: Jayant Krishnamurthy <jkrishnamurthy@jumptrading.com>
2022-12-06 09:57:43 -08:00
Ali Behjati 4821b877e3
[eth] Improve and automate deployment process (#412)
* Bump contract version

* Some refactoring to add types with JSDoc

* Use better RPCs for some networks

* Remove unneeded migration files

* Add initial syncPythState script that does upgrade

* Update truffle-config for new gas values
2022-12-06 17:56:21 +01:00
Jayant Krishnamurthy 15708d552d
Fix formatting for new nightly rust (#415)
Co-authored-by: Jayant Krishnamurthy <jkrishnamurthy@jumptrading.com>
2022-12-05 10:02:58 -08:00
Ali Behjati df3297e430
[attster] Remove while true and wait instead (#411) 2022-12-05 18:34:31 +01:00
Jayant Krishnamurthy 3beffdfe46
Configure symbol groups by name (#403)
* Refactor to make this change easier

* stop mutating AttestationConfig

* get the product names also

* ok

* refactor

* cleanup

* more cleanup

* more cleanup

* comment

* i think this works

* fix stuff

* clippy

* more cleanup

* main

* main

* fix formatting

* blah

* test

* cleanup

* fix python

* config

* fix test

* grr

* grr

* comments

Co-authored-by: Jayant Krishnamurthy <jkrishnamurthy@jumptrading.com>
2022-12-02 09:35:33 -08:00
Ali Behjati 06b24609e1
[price-service] Bump version to v2.2.0 (#409) 2022-12-01 19:33:35 +01:00
Ali Behjati 27f9f75b79
[price-service] Fine-tune metrics (#401)
- Remove nodejs default metrics. We don't use them.
- Remove response time metric.
- Remove freshness metric and add gap metric for attestationTime and publishTime.
  They are similar; however, freshness was measured upon user request but gap is
  measured upon receiving the next update.
- Change receivedVaa to actually represent distinct vaa received. Prior
  to this, the older vaas, or vaas with same attestation time were
  not counted in this metric. This will also improve the performance.
- Refactors the code a little. `vaaBytes` type was not string and was
  Buffer. It is fixed now.
2022-12-01 18:37:02 +01:00
Ali Behjati 8d9a707b48
Remove seq output log and py server for that (#408)
Co-authored-by: Stanisław Drozd <stan@nexantic.com>
2022-12-01 18:30:34 +01:00
Ali Behjati 33f5b8a5bf
[eth] Remove ownership entirely in favor of governance (#405) 2022-11-30 12:13:46 +01:00
Ali Behjati 51514dcd9b
Add clippy to all rust projects (#400) 2022-11-28 18:22:48 +01:00
Ali Behjati becc216853
Abehjati/repo-improvement (#395)
* Use a new rustfmt file

* Run cosmwasm action only when needed

* Remove pre-commit from remote-executor action

* Fix formatting

* Run precommit for all files

As previous PR was merged without pre-commit
2022-11-25 11:16:58 +01:00
Ali Behjati d6e25d9209
Add pre-commit globally (#393)
* Add pre-commit globally

* Fix CI errors
2022-11-24 14:14:29 +01:00
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