Commit Graph

1928 Commits

Author SHA1 Message Date
Ali Behjati 9c5425d829
Optimize updatePriceFeedsIfNecessary (#388) 2022-11-17 20:41:02 +01:00
Ali Behjati 2597596022
[eth] Gas improvement: Optimize events (#387)
* 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
2022-11-17 17:44:21 +01:00
njkumr 3b80bda833
updating security.md (#385) 2022-11-14 13:07:06 +00:00
Ali Behjati ca7441fd68
[eth] Gas improvement: Use optimized version of BytesLib (#380)
* 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
2022-11-10 17:17:16 +00:00
Turbo-Gus 1a5b31f41a
test: use proper aptos addresses for tests (#384) 2022-11-09 21:54:58 +00:00
Turbo-Gus 0f42b66438
fix: use correct struct in update_cache_for_test (#382) 2022-11-09 08:37:03 +00:00
Ali Behjati 9d5cc533ea
Change internal storage layout and order (#379) 2022-11-07 13:01:49 +01:00
njkumr 81325a5a0d
njkumr/audit report (#369)
* updating SECURITY.md with audit reports

* adding Zellic's pyth-evm report

* adding OtterSec's pyth-aptos reports
2022-11-07 10:42:57 +00:00
Ali Behjati b0a2b13e22
[eth] Wrap parsing method with unchecked (#378)
* Move parsing method to unchecked

There is no overflow possible there

* Update another for loop to be unchecked
2022-11-04 17:48:20 +01:00
Ali Behjati 8db2af6ee5
Use latestPriceInfoPublishTime when possible (#377) 2022-11-04 17:16:14 +01:00
Ali Behjati b23258112d
Remove middle structs (#375)
* 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
2022-11-04 16:44:07 +01:00
Ali Behjati 61651a10f2
Modify PriceInfo struct for gas optimization (#373)
This PR removes unneeded PriceInfo fields and rearranges the struct in a way that it takes less storage.
2022-11-04 11:41:01 +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 1a9dfb6c0d
[eth]: Fix gas benchmark to generate useful gas snapshot (#372)
* [eth]: Fix incorrect gas usage problem

* Make gas report more accurate

* Update readme

* Address Jayant comment
2022-11-03 12:18:48 +01:00
Stanisław Drozd 2c542f9aa6
xc-tool: Initial commit (#366) 2022-11-02 13:38:00 +01:00
adirutwn c3f34a087a
[FEAT] Allow any contract to update the cache in test (#370)
* feat: allow public to update cache in test

* chore: change according to code review

* chore: rename func
2022-11-02 09:59:58 +00:00
Ali Behjati 0df243ba9e
[eth] Add benchmark tests (#368)
* Add remappings

This helps vs code solidity LSP work

* Remove unused wormhole contract

* Format foundry config file

* Fix install foundry script

* Add benchmark tests and its utils
2022-11-02 10:59:39 +01:00
guibescos a19cd93cd3
Update example to use APT pricefeed (#365)
* Update example

* Update address of example contract
2022-10-28 09:31:09 -05:00
Ali Behjati a9a1fb7b5a
Add deployment files of optimism goerli + fix bugs (#364) 2022-10-27 20:01:14 +02:00
Ali Behjati 044a867e11
Add verify command for wormhole msg (#363) 2022-10-27 10:02:38 +02:00
Ali Behjati 1c17499d03
Add foundry base (#362)
* Add foundry base

* Address Reisen comments
2022-10-25 17:49:24 +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
Ali Behjati d9e94b284d
Refactor the governance code a bit (#359) 2022-10-21 17:04:19 +02:00
Stanisław Drozd 0a8db01c10
Dockerfile.client, Dockerfile.solana: harden caching to cut CI time (#332)
* Dockerfile.client, Dockerfile.solana: harden caching to cut CI time

This change attempts to add useful items to the docker caching which
should save time downloading crates and by adding path=<full path> and
dropping id=<name> ensure that no Dockerfile cache mismatches occur. I
think the id= param is meant to help group builds that benefit from
common cache, but in case of pyth2wormhole-client/SOL contract builds
it became a competition between the two replacing the other's caches

* Dockerfile.client: remove malformed id= params
2022-10-20 12:33:18 +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
guibescos 808e9392e3
Update address again (#357) 2022-10-18 20:45:09 -05: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
Ali Behjati e4160b2f08
Run remote exec CI only if it's changed (#352)
* Run remote exec CI only if it's changed

To save more GH actions time + have faster CI checks (sometimes it takes longer than tilt!)

* Update remote-executor.yml
2022-10-18 11:33:34 -05:00
guibescos 0e49c8ea7b
Update example addresses (#354) 2022-10-18 11:25:54 -05:00
Ali Behjati b05a63fe5a
[attestation-cli] Fix corner case of product with no price (#351)
* Fix corner case of product with no price
2022-10-18 16:32:44 +02:00
Tom Pointon 079f8cc0b7
Add AptosAuthorizeUpgradeContractInstruction to xc-governance-sdk-js (#328) 2022-10-17 16:20:23 +02:00
Ali Behjati c47199d6cb
[eth] contract improvement (#348)
* 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
2022-10-17 16:19:55 +02:00
Ali Behjati 62ef9d7d1f
Add set fee mainnet deployment info (#349) 2022-10-17 13:46:11 +02:00
Tom Pointon 2c8efdba2a
Add link to on-demand and update fee docs (#347)
* Add link to update fees section

* Add link to on-demand docs

* Tweak wording
2022-10-16 11:50:38 +01:00
Ali Behjati f7958e387f
[eth] Add set fee migration step + deployment process improvement (#346)
* 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
2022-10-13 19:09:52 -05:00
guibescos 4b37fda80c
Guibescos/aptos example 2 (#327)
* Add example

* Subfolder for my example

* Ready to merge

* Cleanup

* Gitignore right

* Renaming

* Named address reset

* Bump pyth-common-js

* Cleanup

* More cleanup

* Cleanup

* dev addresses

* Link to addresses

* Rename app

* Add link

* Fix

* refactor

* Renamed

* Rename

* Add import statement for Price

* Update to pass vaa to get_update_fee

* Update README

* Rename directory

* Comments

* Add recency check

* Format

* Cleanup, remove bad practices

* Better comments

* Get rid of recency check

* Update README
2022-10-13 11:48:57 -05:00
Ali Behjati f77987df70
Fix logging of vaa as hex (#345) 2022-10-13 11:08:02 -05:00
Tom Pointon 412ef5e221
Fix example to reflect breaking api change (#344) 2022-10-13 14:55:20 +01:00
Tom Pointon b820c78ac1
Add comment clarifying deployed addresses (#343) 2022-10-12 14:47:35 +01:00
Tom Pointon 86df3ef997
Make imports used for tests test only (#342) 2022-10-12 14:47:26 +01:00
Tom Pointon 13f2d481d5
Charge update fees per VAA submitted (#340)
* Charge update fees per VAA submitted

* Rename UpdateFee struct to BaseUpdateFee

* Update comment
2022-10-11 18:17:02 +01:00
Tom Pointon dec51832bf
Start all pyth tilt pods by default (#339)
* Start all pyth tilt pods by default

* Remove pyth tiltfile variable
2022-10-11 14:15:34 +01: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 6407eaa244
pyth2wormhole-client:should_resend(): optimize interval-only batches (#338)
* pyth2wormhole-client:should_resend(): optimize interval-only batches

Most attestation conditions in prod are interval-only. This change
ensures that interval-only batches don't waste time on the on-chain
state lookup request.

* pyth2wormhole: Fix build error, redundant new_symbol_states decl

* pyth2wormhole-client: is_onchain -> needs_onchain_lookup

* pyth2wormhole-client: typo
2022-10-10 20:57:23 +02:00
Tom Pointon 124589da09
Only register account to receive coins if already unregistered (#336) 2022-10-10 17:13:15 +01:00
Tom Pointon 9d4a6b88c4
Ensure initialization data source emitter address and chain ids are the same length (#337) 2022-10-10 15:40:30 +01:00