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

Sherlock-110: revert add settleable #909

Merged
merged 5 commits into from
Jun 28, 2023

Conversation

mattcushman
Copy link
Contributor

@mattcushman mattcushman commented Jun 23, 2023

Description of change

High level

Contract size

Pre Change

============ Deployment Bytecode Sizes ============
  ERC721Pool               -  24,477B  (99.59%)
  ERC20Pool                -  23,719B  (96.51%)

Post Change

============ Deployment Bytecode Sizes ============
  ERC721Pool               -  24,490B  (99.65%)
  ERC20Pool                -  23,732B  (96.56%)

Gas usage

Pre Change

| addQuoteToken                        | 122500          | 179774 | 164363 | 715163  | 60004   |

Post Change

| addQuoteToken                        | 122895          | 180303 | 164758 | 719558  | 60004   |

@mattcushman mattcushman changed the base branch from master to develop June 23, 2023 19:10
@grandizzy grandizzy changed the title Sherlock110 revert add settleable Sherlock-110: revert add settleable Jun 24, 2023
@grandizzy grandizzy force-pushed the sherlock110-revert-add-settleable branch from f60b816 to 406e6f3 Compare June 26, 2023 06:12
Copy link
Contributor Author

@mattcushman mattcushman left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@ith-harvey ith-harvey left a comment

Choose a reason for hiding this comment

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

The links that summarize the issue are dead, please copy and paste the issue into the description

@grandizzy
Copy link
Contributor

The links that summarize the issue are dead, please copy and paste the issue into the description

Will update to new judge repo which is permanent

Copy link
Contributor

@ith-harvey ith-harvey left a comment

Choose a reason for hiding this comment

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

I consider this change a mitigation to the issue rather than the fix, which is fine. I'm 51% no change 49% fine with this change. As was detailed in the issue why would a lender perform a dusting to protect a position that they can't withdraw? The incentives don't seem significant enough to warrant a lender performing this dusting...

As a lender who is performing the dusting I see two very simple workarounds:

  • dust with addCollateral(), performs the same protections
  • call addQuoteToken() on the 71st hour of the auction (before settle is callable) , this mitigation doesn't protect against.

Approving PR because it suffices as a soft mitigation and code looks correct. Again happy to leave code as is and not merge this PR because I don't see sufficient incentives for lender to perform dusting, nor do I see this mitigation as entirely solving the issue.

Copy link
Contributor

@grandizzy grandizzy left a comment

Choose a reason for hiding this comment

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

LGTM

@ith-harvey
Copy link
Contributor

I consider this change a mitigation to the issue rather than the fix, which is fine. I'm 51% no change 49% fine with this change. As was detailed in the issue why would a lender perform a dusting to protect a position that they can't withdraw? The incentives don't seem significant enough to warrant a lender performing this dusting...

As a lender who is performing the dusting I see two very simple workarounds:

* dust with `addCollateral()`, performs the same protections

* call `addQuoteToken()` on the 71st hour of the auction (before settle is callable) , this mitigation doesn't protect against.

Approving PR because it suffices as a soft mitigation and code looks correct. Again happy to leave code as is and not merge this PR because I don't see sufficient incentives for lender to perform dusting, nor do I see this mitigation as entirely solving the issue.

I stand corrected, addCollateral() doesn't effect the HPB so that would be ineffective to reproduce the attack.

Copy link
Collaborator

@MikeHathaway MikeHathaway left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@EdNoepel EdNoepel left a comment

Choose a reason for hiding this comment

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

Unrelated to this change, I was surprised to learn we don't allow lenders to remove collateral when an auction is settleable. LGTM.

@grandizzy grandizzy merged commit 5ba6d87 into develop Jun 28, 2023
3 checks passed
@grandizzy grandizzy deleted the sherlock110-revert-add-settleable branch June 28, 2023 21:23
Copy link

@dmitriia dmitriia left a comment

Choose a reason for hiding this comment

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

Looks ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants