Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Remove read-only mode and associated code #2295

Merged
merged 8 commits into from
Oct 28, 2019

Conversation

abandeali1
Copy link
Member

@abandeali1 abandeali1 commented Oct 27, 2019

Description

  • This PR primarily removes read-only mode from the StakingProxy contract. Read-only mode was originally designed to control damage in case any vulnerabilities were discovered. The ZeroExGovernor could 1) set ROM, 2) attach a new staking contract that fixes the bug and 3) turn off ROM. However, this seems to necessarily introduce points of centralization into the system and creates an upgrade path where users are no longer able to opt out of the new logic. The types of bugs that may exist in the current system are very isolated and would only result in minimal losses, even in the case of a critical vulnerability. This makes the tradeoff of introducing read-only mode not worth it, IMO.

  • This change also allows us to remove the ZrxVaultBackstop contract.

  • A detachProtocolFeeCollector function was added to the Exchange contract. The intent is for this function to have a timelock of 0, and calling it would become a part of standard damage control from any bugs found in the staking logic.

  • Updates the default alpha from 1/2 to 2/3 (needed before deployment).

Testing instructions

Types of changes

Checklist:

  • Prefix PR title with [WIP] if necessary.
  • Add tests to cover changes as needed.
  • Update documentation as needed.
  • Add new entries to the relevant CHANGELOG.jsons.

Copy link
Contributor

@jalextowle jalextowle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. I think that we're making the right choice by removing this.

@@ -103,4 +103,37 @@ blockchainTests.resets('MixinProtocolFees', env => {
expect(updatedEvent.args.updatedProtocolFeeCollector).to.be.eq(protocolFeeCollector);
});
});

blockchainTests.resets('detachProtocolFeeCollector', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏

@@ -277,23 +263,10 @@ export async function deployAndConfigureContractsAsync(
artifacts,
);

const zrxVaultBackstopContract = await ZrxVaultBackstopContract.deployFrom0xArtifactAsync(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huge RIP

@abandeali1 abandeali1 force-pushed the feat/staking/remove-read-only-mode branch from ab389ae to f246314 Compare October 27, 2019 23:54
@coveralls
Copy link

coveralls commented Oct 27, 2019

Coverage Status

Coverage remained the same at 75.286% when pulling f246314 on feat/staking/remove-read-only-mode into 0067f10 on 3.0.

Copy link
Contributor

@dorothy-zbornak dorothy-zbornak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems legit

@abandeali1 abandeali1 merged commit bc2a9be into 3.0 Oct 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants