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

Fix unbonding period in deposit.sol #1761

Open
DrZoltanFazekas opened this issue Nov 6, 2024 · 0 comments · May be fixed by #2007
Open

Fix unbonding period in deposit.sol #1761

DrZoltanFazekas opened this issue Nov 6, 2024 · 0 comments · May be fixed by #2007
Assignees
Labels
Agate Required for mainnet launch

Comments

@DrZoltanFazekas
Copy link
Contributor

DrZoltanFazekas commented Nov 6, 2024

The current deposit contract uses the block timestamp to determine if the unbonding period has expired and stakers can withdraw their deposit. This is vulnerable to the following attack. If the chain has a lot of timeouts (which can be caused by malicious validators) or, in an extreme case, it is down for a couple of days, the actual unbonding period in terms of blocks can become shorter than the weak-subjectivity period with the consequence that an adversary controlling 1/3 of the stake could escape slashing before the next checkpoint. Therefore, we should use block numbers instead of block timestamps.

The issue shall be fixed before the planned audit of the deposit contract,

@DrZoltanFazekas DrZoltanFazekas self-assigned this Nov 6, 2024
@DrZoltanFazekas DrZoltanFazekas linked a pull request Nov 13, 2024 that will close this issue
@DrZoltanFazekas DrZoltanFazekas removed a link to a pull request Nov 14, 2024
@DrZoltanFazekas DrZoltanFazekas pinned this issue Nov 20, 2024
@DrZoltanFazekas DrZoltanFazekas unpinned this issue Nov 20, 2024
@DrZoltanFazekas DrZoltanFazekas added the Agate Required for mainnet launch label Nov 20, 2024
@DrZoltanFazekas DrZoltanFazekas changed the title Unbonding period in deposit.sol Fix unbonding period in deposit.sol Nov 20, 2024
@DrZoltanFazekas DrZoltanFazekas removed their assignment Nov 26, 2024
@86667 86667 self-assigned this Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Agate Required for mainnet launch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants