Commit Graph

16 Commits

Author SHA1 Message Date
Ali Behjati ce68b8e043
[wormhole-attester] Fix rate_limit logic (#721)
* [wormhole-attester] Fix rate_limit logic

* Address comments

* Trigger CI
2023-03-28 18:06:00 +02:00
Jayant Krishnamurthy e995a2b89e
Add CI workflow to publish javascript packages (#707)
* workflows

* try private

* private

* more private

* update files

* fix workflow

* hm

* hm

* bump version

* bump version

* another bump

* text

* update readme

* update package lock
2023-03-21 12:25:30 -07:00
Jayant Krishnamurthy a9f5cfcced serial tests 2023-03-20 13:07:01 -07:00
Stanisław Drozd bbc140f2e4
[wormhole-attester] Increase accuracy and improve logging (#653)
* Tiltfile: TILT_DOCKER_REGISTRY def behavior, re-add namespace_create

* wormhole_attester/client v5.0.0: accuracy and logging opimisations

* [BREAKING CHANGE] min_interval_secs switches to milliseconds under
  min_interval_ms
* attestation jobs no longer use preflight checks - this includes a
custom variant of send_and_confirm_transaction(), see util.rs for details
* attestation error logging no longer pretty-prints the error
  structs ({:#?} became {:?})
2023-03-03 13:34:39 +01:00
Stanisław Drozd 3106adec39
wormhole_attester client: Change "not enough data" HTTP code to 503 (#643)
Previously, we used 307 Internal Redirect to tell k8s that we're still
waiting for the healthcheck window to fill up. Unfortunately, k8s
assumes 3XX as a success, which wrongly tells it that the service is
ready. Changing to 503 causes the expected probe failure to appear
when the healthcheck state is not yet determined.
2023-02-28 16:49:33 +01:00
Stanisław Drozd 0f3975f28e
pyth-wormhole-attester-contract-v2.0.0 (#641) 2023-02-28 14:50:29 +01:00
Ali Behjati b644b7f395
[wormhole-attester] Bump client v to 4.0.0 (#640) 2023-02-28 14:15:54 +01:00
Stanisław Drozd 1978d73b94
attester: Add an on-chain last attestation timestamp and rate limit arg (#622)
* attester: Add an on-chain last attestation timestamp and rate limit

In consequence, attester clients are able to rate-limit attestations
among _all_ active attesters - because the new last attestation timestamp is kept up
to date on chain. Ultimately, this value being shared by concurrent clients,
this feature limits our tx expenses while fulfilling our preferred attestation rates.

* attester: Use custom error code instead of log for rate limit

* attester: Add defaults for default attestation conditions

* attester: Use a dedicated function for rate limit default

* attester: Option<u32> -> u32 rate limit interval

This lets users pass 0 to disable the feature (0-rate limiting means
no rate limiting at all), which was not possible with the Option type.
2023-02-24 15:03:57 +01:00
Stanisław Drozd 8e11caa1ee
Bump wormhole rust crates to v2.14.8, remove rent adjustment (#601)
This change upgrades our wormhole dependency to the current latest
release. It introduces a fix in rent calculation logic, making Solitaire compatible with
PythNet. This lets us get rid of dedicated rent adjustment logic,
which we also remove in this change.
2023-02-20 11:06:57 +01:00
Ali Behjati 2a906b6d90
[wormhole-attester/sdk/js] Fix Status Enum case (#598) 2023-02-14 16:11:41 +01:00
Stanisław Drozd d52f4d406e
wormhole_attester: per-symbol PDAs for attestation state (#567)
* wormhole-attester: Add a last trading publish timestamp field

This change bumps price batch format to v3.1 with a new backwards
compatible field - last attested trading publish time. This is the last time we've
successfully attested a trading price. If no prior record exists, the
current publish time is used.

The new field is backed by a new PDA kind for the attester contract, called
'attestation state'. In these PDAs, we store metadata for every price, seeded by its pubkey. Currently, the metadata stores just the
last tradind timestamp for use with the new field.

* wormhole-attester: Use publish_time instead of attestation_time

* wormhole_attester: use prev_publish_time for non-trading prices

* wormhole_attester: per-symbol state PDAs, stop using prod accounts

* attester: Use Option to detect if previous state exists

Using Option<> for this makes fallback to latest value more convenient

* wormhole_attester: client AccountMeta typo

* wormhole_attester: fix mutability error

* wormhole_attester: stop using Option<> for on-chain state

* wormhole_attester: remove unused realloc logic for attestation state
2023-02-08 17:04:55 +01:00
Ali Behjati 481c61bc2c
[refactor] Improve typescript codebase (#553)
* Use base tsconfig

* Add lint check

* Fix tilt
2023-02-01 11:26:23 -06:00
Ali Behjati 4c5d0d5e1b
[refactor] Add global lerna (#546)
* Move lerna to the top

* Set version to independent

Packages are versioned independently

* Update packages and the lock

* Add build cache and better reference

* Add lerna docker base

* Add wormhole_attester sdk and some minor impr

* Update tsconfig to fix outDir impact by composite

* Update eth package

* Update p2w to use solidity-sdk

* Change xc-admin CI to lerna CI action

* Add more packages to the list + bugfixes

* Update dockerfiles to have tilt working

* Format the code

* Fix some issues

* Fix the change of usePyth.ts

* lerna build fix

* Fix foundry
2023-01-31 17:09:31 +01:00
Ali Behjati f9e0145352
[wormhole-attester] Remove wasm in js sdk (#537)
* [wormhole-attester] Remove wasm in js sdk

* Cleanup dependencies and unused codes

* Cleanup rust

* Add tests + minor improvements

* Add ignored price status

* Revert cargo lock
2023-01-27 17:11:00 +01:00
Ali Behjati 70fd0a6c15
[wormhole-attester] Move p2w-sdk inside wormhole_attester directory (#534)
* Move p2w-sdk to wormhole_attester

* Update references to the sdk
2023-01-25 18:14:02 +01:00
Ali Behjati 084acdb57e
[refactor] Convert hyphen to underscore in the directory tree (#524)
* Move price-service to price_service

* Update references to price-service

* Rename target-chains to target_chains

* Update references to target-chains

* Rename tilt-devnet to tilt_devnet

* Update references to tilt-devnet

* Rename wormhole-attester to wormhole_attester

* Update references to wormhole-attester

* Rename multisig-wh-message-builder

* Update references to wh-msg-bldr

* Fix dockerfile issue

* Rename remove-executor to remote_executor

* Update references to remote-executor

* Rename xc-governance-sdk-js

* Update references to the governance sdk

* Move docker-images to docker_images

* Update references to docker-images
2023-01-24 19:06:22 +01:00