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

Use eth in queue #255

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Conversation

Valdorff
Copy link
Contributor

@Valdorff Valdorff commented Aug 19, 2022

Design PR

  • The idea is that we only put use 1 ETH for scrub check and the rest of the ETH can be used for assignments.
  • This means all minipools need 31 ETH to get assigned. Here I only implement 16-ETH deposits.

Benefits:

  • Single queue
    • 16, 8, 4, etc ETH deposits could sit in the same queue because, when in the queue, they all require 31 ETH.
    • I think adding another minipool type would only require editing RocketNodeDeposit.getDepositType to consider another deposit amount valid.
  • ETH in queue is used productively - it increases rETH APR, similar to how ETH in the DP decreases rETH APR.

TODO

  • Definitely missing the "efficient" queue
  • Likely has errors from implementing; untested
  • May have errors from rebasing onto v1.1, but I think I did ok?

Valdorff and others added 7 commits August 19, 2022 14:14
… deposit pool space

- Also allows assignment to scale with value of deposit
- 2 comments in PR
- Need for a hard max on assignments to ensure there's enough gas in a block
- Unrelated; did away with the weird counter-spanning-for-loops trick to be more explicit
Comments implied it could be used either by anyone when an NO failed to move forward in prelaunch OR by the NO at that same time or while in queue. However, the functionality only allowed the former. Updated code/comments to explicitly only do the former.
- No longer supports 32E deposits
- Will support any deposit size the same way (eg, 16E or 8E)
@Valdorff
Copy link
Contributor Author

Force push fixed an error in deposit. I had subtracted the 1 ETH used for prestake from the balance instead of the deposit. My b.

Comment on lines +57 to +59
function setStakingQueueETHBalance(uint256 _value) private {
setUint(keccak256("network.balance.queuestaking"), _value);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

oDAO could calculate this as:

  • a = sum of nodeDepositBalance across efficient queue (equivalently, sum of nodeDepositBalance where nodeDepositAssigned==False)
  • b= number of minipools in efficient queue (accounts for the 1 scrub ETH)
  • c = total user-deposited ETH since last assignment
  • stakingQueueETHBalance = a - b - c

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.

1 participant