-
Notifications
You must be signed in to change notification settings - Fork 177
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
improve(dec-20-audit): [N04] Naming issues hinder code understanding #2332
Conversation
…and readability Signed-off-by: pemulis <john.d.shutt@gmail.com>
59b6797
to
c2e6ec0
Compare
78ab2ce
to
1967b82
Compare
…otocol/protocol into pemulis/dec-2020-audit-N04 Signed-off-by: pemulis <john.d.shutt@gmail.com>
1967b82
to
6dd6ddb
Compare
packages/core/test/financial-templates/perpetual-multiparty/ConfigStore.js
Outdated
Show resolved
Hide resolved
packages/core/test/financial-templates/perpetual-multiparty/ConfigStore.js
Outdated
Show resolved
Hide resolved
packages/core/contracts/financial-templates/perpetual-multiparty/PerpetualLiquidatable.sol
Show resolved
Hide resolved
packages/core/contracts/financial-templates/perpetual-multiparty/PerpetualCreator.sol
Show resolved
Hide resolved
packages/core/contracts/financial-templates/common/FundingRateApplier.sol
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
High level comments
- Since we're going to be upgrading the EMP related contracts as well do you think its worth making the changes to them now? Or should we just not touch the EMP at all.
- What about changing the Liquidatable states: {PreDispute, PendingDispute}
- What about other changes in the audit suggestions such as renaming
dispute
etc.
Apologies @pemulis I'm going to take back my statements and just go through the audit suggestions for renaming one by one to aid you. The overall philosophy I'm going to recommend stays true to your original goal, which is to NOT introduce any breaking changes to the off-chain infrastructure such as the Changes we should make:
These suggestions would change internal
These suggestions introduce breaking changes to the interface but are not called by the bots, and therefore should be implemented for both the EMP and Perpetual.
This is an internal modifier renaming and should be changed for both
This changes the interface for the Perpetual, which has not been integrated into any off-chain infra yet, so can be changed. Changes we should not make:
See full explanation here
I actually don't agree with this change because the contract being returned is named
These changes would introduce breaking changes to the interface functions and events that would break off-chain infra in @daywiss @chrismaree can you verify that these changes are ok with the |
packages/core/contracts/financial-templates/perpetual-multiparty/PerpetualPositionManager.sol
Outdated
Show resolved
Hide resolved
thanks @pemulis and @nicholaspai for the update and analysis. I agree we really should try to just go with non breaking changes here. That said, any changes to emp events will break affiliates as it is. I'm leaning towards not changing the EMP because its high risk to break infrastructure in general. So far affiliates has only had to run with a single version of the EMP abi, but having to apply rewards across different ABI versions will be tricky ( but not impossible). I'm ok with the inconsistency between EMP and perp for now so id rather reduce code churn. |
@nicholaspai totally agree with your conclusions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drive by: I thought we had decided to not change _collateralAddress
==> _collateralTokenAddress
because we are leaving _tokenAddress
and tokenCurrency
as is?
I updated this comment to reflect this decision just now, apologies if you were going by that comment before!
Yep! I was going by that comment but can revert that change. |
Signed-off-by: Matt Rice <matthewcrice32@gmail.com>
…and readability
Motivation
Improve naming according to audit recommendations, except in cases which would require upgrading contracts that are already live.
Summary
There are numerous naming updates here, concentrated on the new contracts that have yet to be released, and setting aside existing contracts that would need to be upgraded.
Details
We may want to go back and take a second look at the other contracts that we may want to more thoroughly refactor and upgrade later. I'm also seeing some failing tests and would like to better understand if this is a code issue (bytecode limit problems?) or some deficiency in my current testing set-up.
Issue(s)
N/A