* 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
* 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
* Add the implementation with tests and benchmark
* Refactor the contract to reduce redundancy
* Reduce optimization runs as the contract was huge
It has 177 more gas usage on some benchmark tests
* [eth]: Gas improvement: Increase optimizer runs to 1_000_000
Increasing optimizer runs will optimize the gas usage of methods more and will increase the contract size, hence the deployment cost.
Snapshot difference:
```
testBenchmarkGetUpdateFee() (gas: -101 (-0.076%))
testBenchmarkUpdatePriceFeedsIfNecessaryNotFresh() (gas: -334 (-0.189%))
testBenchmarkUpdatePriceFeedsNotFresh() (gas: -1312 (-0.416%))
testBenchmarkUpdatePriceFeedsIfNecessaryFresh() (gas: -1626 (-0.430%))
testBenchmarkUpdatePriceFeedsFresh() (gas: -1576 (-0.441%))
testBenchmarkGetPrice() (gas: -259 (-0.969%))
```
p.s: I read one place that `runs` is an estimate of how many times the contract is expected to be called as opposed to number of optimization passes through the code!
* Change optimizer_runs to 10000
* Update pyth-sdk-solidity version
* Add parsePriceFeedUpdates as an empty method
To be implemented in the future
* Update events
* Fix tests
* Address Tom review comment
* Fix Pyth forge test
* Copy BytesLib.sol to OptimizedBytesLib.sol
* Remove `require`s from OptimizedBytesLib
* Use OptimizedBytesLib
* revert to use BytesLib for governance
* Rename to UnsafeBytesLib + use it explicitly
* Remove middle structs
* Parse and process attestation in place
It helps a lot because we won't expand memory anymore
* Update comments
* Remove unusued PriceAttestation struct
* Make Pyth.initialize private
* Make contract upgrade more resillient + add fail test
* Remove deployCommitHash
The deployCommitHash process is error-prone and it's alternatives
require changing many parts of the code.
And as it is not used anywhere. I believe it is not
worth the effort.
* Improve price not found log
* Remove celo conf files as we are not there
* Remove some unused files
* Move common variables to cluster env
Also rename mainnet to ethereum
* Update migration scripts
* Remove ropsten, it's decommissioned
* Update template
* Create deployment script
* Add set fee migration step
* Comment out old upgrade process with good comments
* Address Tom comments
* Use a helper function for loading env
* Disable storage collision check on some migrations
Some changes after them have storage collision and this requires them to
disable it too
* Add new implementation memory layouts
* Update sdk version
* Update the contract according to the sdk changes
- Change some memory modifiers to improve gas efficiency
- Implement getValidTimePeriod() and remove old staleness logic
- Update the tests
* Update latest migration descriptions
* Add version
* Update Deploying.md
* Add test to validate version of the contract
* Add deploy commit hash
* Rename the placeholder
* Fix placeholder
* 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