#0 Unused Sub-stake Removal

Proposal #0
Add Unused Sub-stake Removal Function to StakingEscrow.sol
v5.4.4 -> v5.5.1

Validate upgrade via Aragon interface
Verify upgrade details on Etherscan

It’s time for NuCypher’s first official DAO-driven upgrade! Everyone currently staking NU is eligible to participate in the inaugural validation process. In other words, YOU decide if this proposal passes and the changes are enacted!

The upgrade in question is very uncontroversial – it’s almost boring – and so we expect it to be collectively validated without any issues or delays. Still, the first ever democratic exercise in a fledgling republic is always a big deal. In fact, depending on a certain president’s willingness to concede, we could get a result here before the Free World knows its next leader!

This upgrade will reduce the daily costs of node operation, and more specifically, sub-stake management. Currently, configuring or editing your sub-stakes can lead to inactive, or ‘unused’ sub-stakes remaining in your sub-stake array. This can occur when:

  1. Two sub-stakes are merged
  2. A sub-stake reaches its unlock date
  3. Tokens are added to a sub-stake, increasing its size
  4. A sub-stake is slashed

These actions, while very useful, create temporary sub-stakes which may become inactive. The presence of inactive sub-stakes means a greater sum of gas spent on making a commitment each period. You can check for inactive sub-stakes you may have by running nucypher stake list --all.

The proposed upgrade will enable stakers to run a simple command – nucypher stake remove-unused – that removes these inactive, unused sub-stakes one by one. For stakers who proactively edit their sub-stakes, this feature will significantly reduce overheads over the long-term.

This proposal has already been fully implemented. You can inspect and verify the exact changes to be enacted by heading to Etherscan and scrolling down to lines 1052-1073 within the contract StakingEscrow.sol (File 1 of 15). Note that the source code at address 0xF6d5137CfA2C5f23530a0FCe66056B12B985554d also includes necessary changes to dependencies of StakingEscrow.sol.

Having a look at the the corresponding Pull Request may also be helpful! A reminder that although the PR has been merged into the NuCypher codebase, the network’s public contracts have not yet been upgraded. That requires the DAO’s approval – i.e. we need you to validate the proposal!

To validate the proposal, please head over to the Aragon interface and connect your staker address via Metamask. This name of this proposal (#0) is Agent: Execute 'Upgrade target of this proxy contract to address 0xF6d5…554d ’ on 0xbbD3…b2e2.

This is an auto-generated title – we’re fixing this so it’ll be easier to tell future proposals apart – but you can verify that the target contract matches the aforementioned contract on Etherscan (0xF6d5137CfA2C5f23530a0FCe66056B12B985554d).

The validation period has already begun and will conclude in just under 14 days, on November 6th 2020 at around 5:30pm UTC.

If validating gets you all excited and you need to expend some energy, it would be wonderful if you encouraged other stakers to participate! Also, feel free to comment below.

4 Likes

Yesterday, the NuCypher DAO validated Proposal #0 - Unused Sub-stake Removal. The relevant public contracts were successfully upgraded.

We have also tested using the new feature - it performs exactly as expected; both when executing the new staking command (removing inactive sub-stakes one-by-one) and subsequently in normal worker operations (making a daily commitment). Also pleased to report that for the staker we tested with, commitment gas costs were reduced by approximately 47%. Note that this saving will vary depending on your current sub-stake configuration.

Provided you’ve installed NuCypher v4.1.0 or later, you can now proceed to remove unused sub-stakes from your array. You can check if you have unused sub-stakes with the command nucypher stake list --all. You can then run nucypher stake remove-unused for each inactive sub-stake. Note that you do not need to specify the index as part of the command, the CLI will detect empty sub-stakes and ask you to choose which one you wish to remove. A separate transaction is required for each removal.

Thank you to everyone who participated. We’re thrilled to have a conclusive outcome ;).

1 Like