* wormhole-attester: Add a previous attestation timestamp field
This change bumps price batch format to v3.1 with a new backwards
compatible field - prev_attestation_time. This is the last time we've
successfully attested the price. If no prior record exists, the
current time is used (the same as attestation_time).
The new field is backed by a new PDA for the attester contract, called
'attestation state'. In this PDA, we store a Pubkey -> Metadata
hashmap for every price. Currently, the metadata stores just the
latest successful attestation 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
* p2w_autoattest.py: Stop using non-daemon mode
* wormhole_attester: Remove non-daemon mode and its uses, v3.0.0
We used to need non-daemon mode to run a manual healthcheck on the
attester process and its configuration. Currently, we're able to
handle this much better with the build-in healthcheck HTTP
endpoint. For production, we should be able to get rid of
p2w_autoattest.py entirely.
Co-authored-by: Stan Drozd <stan@pyth.network>
* [price-service] Update wormhole sdk package
Wormhole new sdk does not use wasm and is cleaner. It makes our code one
step closer to no wasm too.
* trigger ci
* Fix pre-commit errors
* Cleanup local environment
* Default Pyth address to match Pythnet
* Cleanup
* Make vault the same as on mainnet
* Fix mesh
* Pyth owner address updated
* Revert some changes lol
* Revert more changes
* Restore oracle address
* Add comment to create key
* add /get_vaa endpoint that serves cache and db vaas
* update env vars
* fix precommit errors
* fix precommit errors
* rename removeExpiredValuesFromVaasCache to runCacheCleanupLoop
* move initialized envOrErr to constructor or func arg
* use setInterval
* update pyth-price-service env vars on tilt devnet
* use undefined instead of null
* use status code
* make web-api an env var
* update env var
* fix precommit
* fix precommit
* fix changes
* remove env vars from tilt-devnet
* address changes
* fix lint issues
* fix linting issues again
* bump package version
* remove unused imports
* add terra local config
* terra update admin and contract info
* osmosis update admin and contract info
* update deployer interface
* injective update admin and contract info
* refactor yargs structure
* update injective sdk ts library
* update readme.md
* error handling for update admin code
* fix typo
* move logging to the calling function
* comment the update admin method
* make it all typescript
* what the hell
* injective - store, instantiate, and migrate works
* terra, injective refactored
* update compiler in build.sh
* update package.json
* deploy.ts
* pre-commit run
* replace helper functions call with actual call
* correct case of RaiseCLError
* update deployer factory to take in config
* add comment to gas for injective store code
* extract raw log logic
* remove comment from injective config
* update deploy script for tilt
Co-authored-by: Jayant Krishnamurthy <jkrishnamurthy@jumptrading.com>
* Move rust-toolchain
* update tilt
* Make CI run everytime
* Revert "Make CI run everytime"
This reverts commit e5b008a83728a4ae996b00d2697ee0742bca5682.
* wormhole-attester: port the v1.3.0 healthcheck hotfix
This PR fixes a missing assignment to HealthCheckState's enable
flag. This would cause the attester to ignore all settings (including
defaults) and keep the enable flag set to false because we would never
bother setting it from attestation_cfg that came at runtime.
The bug is fixed and the healthcheck behavior is hardened. Currently,
the lazy_static block will explicitly initialize the global with
default values from attestation_cfg (enable is true, window size is
100). This prevents a similar human error from disabling the
healthcheck. Secondly, main.rs overwrites the default values using the
HealthCheckState::new() constructor, instead of individual struct
member assignments. This ensures that all necessary values or their
defaults are passed as the desired healthcheck state.
* p2w_autoattest.py: Get debug output from first attestation
* wormhole-attester: fix ()-less function bug, harden usize convertion
This change fixes a bug that would cause a gigantic allocation to
happen, after the attestation_cfg::default_healthcheck_window_size
function is taken without being called and converted to a very large
usize value. This would result in a big allocation which would crash
the attester. At the core it's a misunderstanding about "Fn() as
usize" conversion which unfortunately is safe Rust.
* Trigger build
* wormhole-attester: Fix a misuse of a mutex guard
This commit changes the `let hc = <lock the mutex>` into a direct
assignment to the locked mutex guard. Rust mutices are typically
scope-based which makes using them in variables more error prone.
* Dockerfile.client: Remove unused ADD wormhole-attester.
This speeds up the build of the container, and prevents useless
triggers from the attester codebase
* p2w_autoattest.py: simplify log filtering to just info