Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diphda release 2.64 #1718

Merged
merged 373 commits into from
Mar 13, 2022
Merged

Diphda release 2.64 #1718

merged 373 commits into from
Mar 13, 2022

Conversation

artdgn
Copy link
Contributor

@artdgn artdgn commented Mar 11, 2022

zyzek and others added 30 commits July 22, 2021 14:14
* Futures markets respect fee reclamation.

* Check necessity of reclamation on reclaim value rather than number of entries settled.
* Alioth release (#1263)

* Remove bridge migrator (#1257)

* Skips multicollateral prod tests if max debt has been reached (#1259)

* SIP-136: MultiCollateral/CollateralEth debt is not excluded correctly from debt calculations (#1243)

* SIP-112: EtherWrapper (#1178)

* Deploy 2.45 to kovan (#1260)

* Prepublish step

* 2.45.0-alpha

* set mint fee and burn fee per sccp 100

Co-authored-by: Alejandro Santander <Palebluedot@gmail.com>
Co-authored-by: Synthetix Team <team@synthetix.io>
Co-authored-by: Jackson C <jackosmacko@gmail.com>

* Introducing new integration tests in CI (#1287)

* Introducing integration tests in CI

* Improved integration tests in CI and removed redundant prod tests

* Bugfix on integration test task

* More verbose on deployer error

* Refactoring of Exchanger.sol to reduce size on OVM (#1291)

* Minor fix for integration tests (#1295)

* Clean state on dual integration tests plus slightly better exchange tests

* Minor fix to integration tests

* Disable some exchanging integration tests for now

* Extra prod tests (#1299)

* Add issuance prod tests

* Add erc20 behavior

* Tweaks on incoming integration tests

* Minor fix to integrationt ests

Co-authored-by: Alejandro Santander <Palebluedot@gmail.com>

* Audit feedback and spring cleaning (#1300)

* Port more integration tests (#1288)

* Basic integration tests for L2 deposits

* Basic integration tests for L2 deposits

* Polish deposit integration tests

* Progress porting withdrawal integration tests

* Working withdrawals in new integration tests

* Using watcher tool more

* Unify action and actionTo in integration tests

* Progress porting integration tests

* Remove comment

* Implemented exchanges in new integration tests

* Bugfix in integrationt est task

* Basic forking in integration tests

* Include fork tests in CI

* Minor fixes for prod tests

* port migrateEscrow test to integration dual

* Fix CI

* Fix CI

Co-authored-by: Leonardo Massazza <lmassazza+github@gmail.com>
Co-authored-by: Yannis <i.stamelakos@gmail.com>

* Better way to get SNX in integration tests (#1303)

* Better way to get SNX

* 2192

* Introduces forking via integration tests (#1307)

* Introduces forking with integration tests

* Compile and deploy on fork tests

* Fix old ovm prod tests

* Replace web3 with ethers in deployment (#1271)

* add wrapper object to hold web3 and ethers

* Replace web3-utils with ethers

* - replace web3.utils with ethers counterpart
- create account with ethers instead of web3

* corrections to failed tests

* propagate Deploy changes fix (test:publish green)

* document the provider addition to Deployer

* document the provider addition to Deployer

* fix require

* fix require

* Clean install

* Update to develop

Co-authored-by: Alejandro Santander <Palebluedot@gmail.com>

* Updates optimism dependencies (#1308)

* Updated optimism deps

* Update usage of dep in code

* Add hardhat-ethers dep required by smock

* Add await in unit test

* Removed @gas-skip (#1309)

* Updated optimism deps

* Update usage of dep in code

* Add hardhat-ethers dep required by smock

* Removed @gas-skip

* Add await in unit test

* Disables prod tests from CI (#1311)

* Reordering the deploy script for sanity (#1304)

* Add integration tests for settle and claim (#1310)

* Support settlements in exchanging behavior

* Testing claims in integration tests

* Address PR feedback, increase timeouts, improve test for forking

* Bigger tolerance for debt comparison

* Approve bridge tokens during bootstrap

* Add SynthsUSD integration (L1 and L2) tests (#1312)

* Add support to SynthsUSD in L1 and L2 integration tests

* Add support to SynthsUSD in L1 and L2 integration tests

* style fixes

Co-authored-by: Alejandro Santander <Palebluedot@gmail.com>

* Port migrateEscrow and depositAndMigrateEscrow tests  (#1306)

* ported. Some tests still failing

* wip

* migrateEscrow test ported

* accept multiples hashes in watchers

* Reduce migrateEscrow dual test to dual scope

* ported depositAndMigrateEscrow test

* update test wording

Co-authored-by: Alejandro Santander <Palebluedot@gmail.com>

* Migration for bulk staking reward upgrade (#1301)

* Deleted everything related to prod tests (#1315)

* Adds ether wrapper integration tests (#1319)

* Basic integration tests for ether wrapper

* Fix timeout in integration tests

* Abstract eth wrapper behavior in integration tests

* Support ether wrapper integration tests in mainnet forks

* Pin ops to a particular commit that is known to work in CI

* Processed Leo's feeedback on PR

* Enables separate folder compilation for integration tests (#1322)

* Enables separate folder compilation for integration tests

* Clean install

* Merge all integration test tasks into one (#1323)

* Remove web3 from the deploy script test (#1328)

* Progress removing web3 from test for deploy script

* Progress removing web3 from test for deploy script

* Almost done removing web3 from deploy tests

* Add optimism scripts to run Optmism via hardhat (#1324)

* Add optimism scripts to npm

* fix variable naming

* Add harhat task to build and start ops

* remove ops scripts from packages.json

* - check status to run the right steps
- order jobs
- cleanup messages

* Update circleCI

* change docker command to test on circleCI

* keep chain atached and add detach option

* Tweak CI for integration tests

* Keep ops start task open

Co-authored-by: Alejandro Santander <Palebluedot@gmail.com>

* Unpins the usage of the Optimism ops tool and starts managing L2 gas (#1331)

* Removes web3 from nominate script (#1332)

* Progress removing web3 from nominate script

* Applies nominate test to L2

* Ported nominate script to ethers

* Fix

* Removed web3 from settle script (#1334)

* Removed web3 from extract-staking-balances (#1335)

* Remove web3

* Remove wallet (only read from contracts)

* Removes web3 from the owner script (#1336)

* Using owner script in integration tests

* Removed web3 from owner script

* Manually setting isContract in owner script

* Add caching of docker layers on integration tests job (#1333)

* remove docker prune from ops tasks

* add cache for optimism build on integration-tests job

* add a check to execute deployments tests only if a deployment.json file changed (#1339)

* Removes web3 from the purge script (#1341)

* Support forks in purge-synths script

* Extract performTransactionalStep version for ethers

* Rename function to deprecate

* Minor fix

* Remove web3 from remove-fee-periods (#1342)

* wip commit

* wip commit

* wip

* wip

* Remove log line from script

* remove empty comment

* Add gas reporting job parallelization on CI (#1305)

* add task for merging gas reports files on CI

* add parallelized gas reports to unit tests

* update codechecks unit-test-gas-report name

* remove optimizer flag from unit tests

* remove test:gas script from package.json

* remove web3 references (#1344)

* SIP-150 Fix excluded debt calculation for partial snapshots. (#1340)

* SIP-145 Emit the proper cached debt number when debt snapshots are taken. (#1325)

* remove web3 from migrate-binary-option-markets (#1345)

* Fixing nominate to work locally and ethers fix (#1354)

* Introduces fast forwarding in L2 integration tests (#1343)

* Basic fast forwarding in L2 integration tests

* Replaced 'ignore' utils with fast forwarding in integration tests

* Clean install

* Undo changes to package lock file

* Pin ops version

* Avoid redundant heartbeats

* Fix and improve integration tests

* Add comment to test

* Update ops image

* Clear ops cache in CI

* Update watchers dep

* Hotfix for Optimism watchers

* Clean install

* Update to hardhat 2.3.x

* Clear ops tool cache

* Unpin ops

* Update ops cache

* Attach ops output

* Debugging Optimism messenger watchers

* Listen to interactions with messenger on blocks

* Keep withdraw tests open

* Implementing a completely patched ops watcher

* Tidy ups

* remove only in tests

* Disabled ops cache

* Restored ops caching

* Quiet

* Bugfix

* Debug optimism in l2 standalone integration tests

* Cleanups

* Adds integration tests for opening and closing a loan (#1330)

* Resolves conflict

* Updates ignore waiting period to new pattern

* Deploy EmptyEtherWrapper (#1349)

* EmptyEtherWrapper

* deploy EmptyEtherWrapper

* ignore EmptyEtherWrapper for coverage

* Use simple synths in local-ovm

* Bugfix on ops tool task

Co-authored-by: Alejandro Santander <Palebluedot@gmail.com>

* remove web3 from checkAggregatorPrices (#1353)

Co-authored-by: Alejandro Santander <Palebluedot@gmail.com>

* Unify wallet creation and ensure .address is always present (#1357)

Co-authored-by: Alejandro Santander <Palebluedot@gmail.com>

* Support for testnet forking (#1359)

* Allow private key overrides in local and fork mode (#1360)

* Fix for SupplySchedule - must use the ERC20 proxy (#1338)

* Adding new synth suspension reason for index rebalancing and using testnet checksum address

* SCCP-98 DEFI rebalance (#1364)

* Prepublish step

* 2.45.3

* Refresh ops cache (#1368)

* Upgrading etherscan links to optimistic explorer when required (#1369)

* Ethers overrides gasLimit, not gas (#1366)

* Adds documentation for integration tests (#1367)

* Add documentation for integration tests

* Update integration tests README

* Updating releases for Alnitak (#1363)

* Remove web3 from persist-tokens. (#1352)

* remove from persist-tokens. Missing one command

* WIP Commit (to stage the branch). Need to replace SetContenthash with our own implementation

* wip

* Remove web3 dependency (setContenthash doesn't work)

* Remove commented out code and useless interaction

Co-authored-by: Alejandro Santander <Palebluedot@gmail.com>

* Incorporate synthetix-cli interactive-ui as a `npx hardhat interact` task (#1365)

* add interactive ui hardhat task

* update pacakge-lock with a clean install

* Minor tidy ups

* Remove redundant utils

Co-authored-by: Alejandro <palebluedot@gmail.com>

* Adding solidity output to deploy script (#1313)

* Simplify conditional logic of generate solidity (#1378)

* Alnitak release kovan (#1379)

* Prepublish step

* 2.46.0-alpha

* Adding EtherWrapper for L2 to deploy empty and SystemSettings for Etherwrapper settings (#1380)

* Alnitak release kovan optimism (#1381)

* Prepublish step

* 2.46.0-alpha-ovm

* Fixing local dev to properly only deploy WETH the first time (#1384)

* Removing 145 and 150 from Alnitak (#1386)

* Fix fork-tests to work and surface errors correctly (#1385)

* OVM gas limit fixes (#1382)

* Mainnet deploy of Alnitak contracts and migration (#1383)

* Prepublish step

* 2.46.0

* Alnitak release optimism (#1390)

* Prepublish step

* 2.46.0-ovm

* Fixes integration tests on CI (#1392)

* Makes l2 standalone integration tests pass

* Refresh ops tool cache in CI

* Possible fix to hardhat ops task

* Undo bad fix, but with small tidy up

* Try to build ops image manually

* Update CI build

* Small bugfix on ci

* Another attempt at building ops tool on ci

* Undo all changes to CI

* Disabled ops tool in CI

* Disable ops tool build

* Showing a different name while integration tests are simplified

* Pins a newer ops tool version

* Re-enable ops-tool in CI (#1395)

* use docker 20.10.6 in CI

* duh...

* fix bootstrap.js issue on dual

Co-authored-by: Alejandro Santander <Palebluedot@gmail.com>
Co-authored-by: Synthetix Team <team@synthetix.io>
Co-authored-by: Jackson C <jackosmacko@gmail.com>
Co-authored-by: Justin J. Moses <justinjmoses@gmail.com>
Co-authored-by: justin j. moses <justin@synthetix.io>
Co-authored-by: Yannis <i.stamelakos@gmail.com>
Co-authored-by: Leonardo Massazza <lmassazza+github@gmail.com>
Co-authored-by: Matías Lescano <mjlescano@users.noreply.github.com>
Co-authored-by: Anton Jurisevic <zyzek@users.noreply.github.com>
Co-authored-by: David Goldberg <gberg1@users.noreply.github.com>
* add maxSlippage to submitOrder

This will be used to calculate an upper/lower bound for the price upon an order being confirmed.

* add slippage to calls

* failing test for confirmOrder slippage

* passing test for confirmOrder slippage

* fix some tests

* * fix/simplify slippage calc
* fix tests

* fix test

* convert slippage param to price bounds (min, max)

* fix tests

* test order min/max price in data contract
* add futures-markets.json to deploy configs

* load futures market settings from config

* remove FUTURES_ASSETS config var

* fix

* add futures-markets.json to deploy configs

* load futures market settings from config

* remove FUTURES_ASSETS config var

* fix

* wip

* wip2

* restore

* * modify publish script test to work with OVM
* add test for futures markets being added

* fix: use only hardhat for L2 tests

* publish script working for local-ovm

* add optimism folder to eslintignore file (#1406)

* restore publish script to original l1-only design

My original design was too complex for not much benefit, since most of the tests were skipped anyways.

* add l2 publish script test, as separate block below

This is a much cleaner diff that'll enable me to get this work out quicker.

* lint

* remove publish test block

I'll reintegrate this in another PR.

Co-authored-by: Matías Lescano <mjlescano@users.noreply.github.com>
* Position ID, PositionOpened, PositionClosed added

* removed useless positionId variable

* PR fixes

* removing PositionOpened & positionClosed

* Adding new status to futures market interface

* test debug

* tests added
* emit sizeDelta with PositionModified event

* fix

* sizeDelta -> tradeSize

This is clearer for liquidation flows
* remove price update constraint from order flow

* prepare-deploy

* add FuturesMarketSettings to releases

* deploy kovan-ovm-futures v0.2.0

* fixes

* unignore deployment.json

* add FuturesMarketSettings to releases

* prepare-deploy

* deploy kovan-ovm-futures v0.3.0

* Futures position details (#1479)

* Futures accessible margin (#1484)

* emit sizeDelta with PositionModified event

* emit sizeDelta with PositionModified event (#1485)

* emit sizeDelta with PositionModified event

* fix

* sizeDelta -> tradeSize

This is clearer for liquidation flows

* deploy kovan-ovm-futures v0.4.0

* test that npmignore will include deployment.json

NPM ignores files listed in gitignore which is a problem.

https://stackoverflow.com/questions/24942161/does-npm-ignore-files-listed-in-gitignore

Co-authored-by: Anton Jurisevic <zyzek@users.noreply.github.com>
 fix slither crashing in ci and local

#1519
* Adding safe functionality from the gnosis SDK to the owner command
* Updating nominate command to use owner actions when not the owner
* Sargas to be OVM only with 135, 142 and 174
* Adding missing SIP-140 from list
jacko125 and others added 16 commits March 2, 2022 11:04
Impl for 165

From a code perspective, this entails:

    FeePool and Issuer are changed to use the chainlink oracle instead of DebtCache and SynthetixDebtShare directly
    FeePool now closes its fee period across networks (using optimism relay call) to allow for synchronized sharing of close parameters between networks
    For testing and initial deployment, a dummy oracles SingleNetworkAggregatorDebtRatio and SingleNetworkAggregatorIssuedSynths are utilized to retrieve debt values for this network, meaning most unit tests can work exactly the same as before.

Notes:

    The SC has indicated that inflation should be divided evenly between networks based on amount of debt shares on each network, so this has been implemented. Also, fees will remain on the network they originate from for the time being
    Dual Integration test was added to verify fee pool closure
    Tests were removed from DebtCache because the functionality is no longer used within the system, but the actual code from solidity was not removed because there is no need to include DebtCache in an update. Doing so would require more migration complexity and it would be better if we could avoid that, so no changes have been made to DebtCache for the time being.

The release process for this SIP is 2 steps:

    First, we will release as usual with the included SingleNetworkAggregators, which will preserve current functionality while enabling for us to start reading from an oracle interface for debt info
    Second, we will use the pdao to change the AddressResolver setting for the two aggregators to be the chainlink provided ones, which will effectively complete the debt synthethsis and enable synth fungibility
@codecov
Copy link

codecov bot commented Mar 11, 2022

Codecov Report

Merging #1718 (f938cb5) into staging (89aa386) will decrease coverage by 0.17%.
The diff coverage is 94.35%.

Impacted file tree graph

@@             Coverage Diff             @@
##           staging    #1718      +/-   ##
===========================================
- Coverage    95.12%   94.95%   -0.18%     
===========================================
  Files           83       98      +15     
  Lines         1990     2338     +348     
  Branches       620      710      +90     
===========================================
+ Hits          1893     2220     +327     
- Misses          97      118      +21     
Impacted Files Coverage Δ
contracts/DebtCache.sol 100.00% <ø> (ø)
contracts/EmptyFuturesMarketManager.sol 0.00% <0.00%> (ø)
contracts/ExchangeRates.sol 98.64% <ø> (ø)
contracts/SignedSafeDecimalMath.sol 13.33% <13.33%> (ø)
contracts/BaseDebtCache.sol 85.18% <83.33%> (-0.24%) ⬇️
contracts/BaseSingleNetworkAggregator.sol 85.71% <85.71%> (ø)
contracts/BaseSynthetixBridge.sol 100.00% <100.00%> (ø)
contracts/ExchangeCircuitBreaker.sol 100.00% <100.00%> (ø)
contracts/Exchanger.sol 96.96% <100.00%> (-0.21%) ⬇️
contracts/ExchangerWithFeeRecAlternatives.sol 100.00% <100.00%> (ø)
... and 19 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 89aa386...f938cb5. Read the comment docs.

@artdgn artdgn requested review from jjgonecrypto, dbeal-eth and jacko125 and removed request for jjgonecrypto, dbeal-eth and jacko125 March 11, 2022 07:52
@jacko125 jacko125 merged commit a821149 into staging Mar 13, 2022
@barrasso barrasso deleted the diphda-release-2.64 branch March 15, 2022 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.