This commit resolves a runtime problem in migrate() which occurred on devnet, as
well as invalid mutability for the old config and misuse of the
checked_sub() method.
The runtime problem came from a non-zero balance existing on
not-yet-used PDA. Effectively, this means permissionless
initialization of PDAs on Solana. Anyone can send lamports to any
account on Solana (existing or not), and it doesn't take much funds to
keep an empty account exempt. While it is possible to recover from it,
this case is relatively rare and takes a lot of code to
automate. Instead, we settle for a dumb bump of the config PDA
seed (see config.rs).
This measure is best used sparingly, as it imposes the same static
seed on all SOL networks. This will cause headaches if the attester
tooling grows a third-party user base.
* Set prev* to current* when price gets stale
* Add new solidity sdk
* Add migration files for this update
* rename diff to absDiff
Strangely, although you cannot use parent private method, you cannot
define a method with same name
* Add a comment to explain the prevPrice replacement
* Upgrade testnet contracts
And fixes some issues for it. Specially it uses
unsafeSkipStorage to skip OZ collision check
as they are very conservative and doesn't
cover our valid memory changes.
We should be very careful in memory
changes now that we cannot use
OZ collision check.
* Address Tom comments
* Implement the new IPyth events and methods
* Check contracts gets the fees in tests
* Fix the fee variable position to avoid conflict
* Add migration files.
* Add events to migration names and docs
* Fix pyth contract address in tests
Very strangely after adding migration steps the old address
used in evm relay became wormhole implementation address
I looked at eth-0/tests container logs and saw the
address is entirely different (before and after the change)
* Fix previous migration bug.
* rename instance to proxy to be more clear
* Update Deploying.md
* Bump version of cw packages from 0.16.0 to 1.0.0
* Fix build
* Update wormhole details
* Update js packages
* Update dockers, configs, to use cosmwasm 2 in tilt
* Update wormhole and pyth addresses everywhere
The migration file is probably not necessary for us.
To be deleted later.
* Update gh action name
* pyth2wormhole-client: refactor into fully-async futures-based approach
commit-id:2ed35045
* p2w-client: Change inconsistent rpc constructor
commit-id:cb3b2ff2
* p2w-client: Move job creation to a function, simplify comment
commit-id:35328b38
* pyth2wormhole-client: Use get_multiple_accounts
commit-id:7fc85157
* Implement a rate-limited mutex for RPC client
commit-id:1a243063
* pyth2wormhole-client: only guard beginning new requests in RLMutex
commit-id:d8251474
* pyth2wormhole-client: RLMutex: ensure the inner guard is not dropped
commit-id:c3513f5e
* pyth2wormhole-client: Clarify attestation_sched_futs comment
commit-id:97033670
* pyth2wormhole-client: Use CommitmentConfig's native FromStr parsing
commit-id:835d7125
* pyth2wormhole-client: doc comment typo
commit-id:5ee388de
* pyth2wormhole-client: move closures to their own async functions
This makes the main.rs async attestation routines easier to read.
commit-id:3565a744
* pyth2wormhole-client: fix merge typo
* pyth2wormhole-client: Apply Tom's readability advice
* pyth2wormhole-client reword attestation_sched_job() comment
* pyth2wormhole-client: expand attestation_sched_job() comment
* pyth2wormhole-client: e x p a n d the comment
* Trigger CI
* p2w-client/main.rs: correct missing awaits after merge
* p2w-client: Implement a migrate command and instruction generator
* Fix minor bug in gen_migrate_tx
* Fix migration test and add a test for success
Co-authored-by: Ali Behjati <bahjatia@gmail.com>
Before this change, a fresh build from scratch would cause a guardian
software compilation error ("Failure: empty digest") that would
normally be hidden by caching in CI.
* ethereum: Add support for multiple emitter/chain ID pairs
* ethereum: Simplify data source methods, add tests, fix flag bug
* ethereum: Fix incorrect removeDataSource condition, harden its test
* ethereum: Add the multi-source migration to prod-receiver
* PythState.sol: rephrase comment about new data source API
* ethereum/test/pyth.js: run prettier formatting
* ethereum: replace multi-source migration with addDataSource call
* ethereum: mark older chain/emitter ID state as deprecated
SeqNum is not suitable for multiple sources, attestationTime is good
but we should be careful of solana clock falling behind
Also use this time for freshness metric because it's more useful.
* Add initial working ws
* Add tests
* Add prom metrics + improve logging
* Handle ids with leading 0x
* Add a multi client test
* Minor code format
* Fix Typo
* rename PriceFeedPriceInfo to PriceStore
It is because in the future we might have multiple spies and this
will be a middleware store
* format the code
* Make Migrations contract Ownable
* Add prod deployment migrations
* Add BSC Testnet deployment configuration
* Add documentation for deploying contracts to production
* Fix test environment script for deployment to development network
* Fix tilt issues + refactor
Co-authored-by: Ali Behjati <bahjatia@gmail.com>
* p2w-client: Implement additional trigger conditions
From now on, we support price change by a given percentage as well as
publish time changes for triggering attestations.
commit-id:9bd145e1
* p2w-client: Harden price_pct_change for negative values
commit-id:cb679208
* p2w-client: Make sure we always update each symbol's state
commit-id:27f276dc
* p2w-client: include resend state lookups in the RPC interval setting
commit-id:68de125f
* p2w-client: Improve local symbol state handling, min interval=60s
With this change, we update local state only if we meet a
condition. Additionally, the publish_time change becomes a
configurable minimal delta.
commit-id:f8139cd6
* p2w-client: Fix a state update bug for state updates
commit-id:29f44a39
* pyth2wormhole-client: Implement and use daemon mode
commit-id:7001bdf7
* pyth2wormhole-client: harden CLI, simplify attestation loop
commit-id:ad5e4857
* pyth2wormhole-client: Refactor symbol config into groups
This commit implements the notion of a symbol group - a collection of
symbols that are attested according to the specified set of
condition. Currently, only an attestation frequency is supported. In
the future, this value will serve as a fallback for symbols that
rarely trip other conditions.
commit-id:cf19cc41
* p2w_autoattest.py: Use symbol groups in config
commit-id:1153c5f7
* Dockerfile.client: bump toolchain version to mitigate compiler error
The previous compiler version encountered a bug when building
pyth2wormhole-client for testing. The error message mentioned serde,
which is tested inside the `attestation_cfg.rs` module.
commit-id:61c12427
* p2w_autoattest.py: Add another test group
commit-id:2e29583c
* p2w-client: Get rid of sent_at, clarify messages, add status setter
commit-id:87653ab1