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

Upgrade staking functionality to new specs #58

Closed
ureeves opened this issue Apr 5, 2022 · 0 comments · Fixed by #59
Closed

Upgrade staking functionality to new specs #58

ureeves opened this issue Apr 5, 2022 · 0 comments · Fixed by #59
Assignees
Labels
area:wallet Issues related to the wallet functionalities exposed by the node mark:testnet team:Core Low Level Core Development Team (Rust)

Comments

@ureeves
Copy link
Member

ureeves commented Apr 5, 2022

Describe what you want implemented
This library should conform to the change in the mint functionality described in this rusk issue.

This means a change in the messages signed in both the stake and withdraw functions, as well as the introduction of a new function specifically for withdrawing rewards. In the context of this, changes in the StateClient trait might be required.

The messages for signing in interaction with the stake contract are:

stake(0x00)    -> counter + value
unstake(0x01)  -> counter + note
withdraw(0x02) -> counter + address + nonce

Describe "Why" this is needed
The core of the wallet needs to sign the right message to be able to interact with the smart contract.

Describe alternatives you've considered
N/A

Additional context
This is in the context of the changes done the mint functionality. Instead of awarding a note to the block generator and another one to Dusk foundation, the reward now accumulates in the stake contract, which then mints the notes when the reward is withdrawn.

@ureeves ureeves added area:wallet Issues related to the wallet functionalities exposed by the node mark:testnet team:Core Low Level Core Development Team (Rust) labels Apr 5, 2022
@ureeves ureeves self-assigned this Apr 5, 2022
ureeves pushed a commit that referenced this issue Apr 5, 2022
- Add `unstake` function to allow unstaking a previously staked amount.
- Change `withdraw` function to withdraw the reward for staking and
  participating in the consensus.
- Change stake/withdraw cryptographic signatures to what the stake
  contract expects as call arguments
- Change `StakeInfo` structure to have an optional `amount` staked and
  a `reward`. It also includes a signature `counter`.
- Remove `get_block_height` function from the `StateClient` trait
- Change signature of `fetch_notes` by removing `block_height`. This
  effectively removes the concept from the library.

Resolves #58
See also dusk-network/rusk#614
ureeves pushed a commit that referenced this issue Apr 7, 2022
- Add `unstake` function to allow unstaking a previously staked amount.
- Change `withdraw` function to withdraw the reward for staking and
  participating in the consensus.
- Change stake/withdraw cryptographic signatures to what the stake
  contract expects as call arguments
- Change `StakeInfo` structure to have an optional `amount` staked and
  a `reward`. It also includes a signature `counter`.
- Remove `get_block_height` function from the `StateClient` trait
- Change signature of `fetch_notes` by removing `block_height`. This
  effectively removes the concept from the library.
- Change `Serializable` implementations to use `Write` trait.

Resolves #58
See also dusk-network/rusk#614
ureeves pushed a commit that referenced this issue Apr 8, 2022
- Add `unstake` function to allow unstaking a previously staked amount.
- Change `withdraw` function to withdraw the reward for staking and
  participating in the consensus.
- Change stake/withdraw cryptographic signatures to what the stake
  contract expects as call arguments
- Change `StakeInfo` structure to have an optional `amount` staked and
  a `reward`. It also includes a signature `counter`.
- Remove `get_block_height` function from the `StateClient` trait
- Change signature of `fetch_notes` by removing `block_height`. This
  effectively removes the concept from the library.
- Change `Serializable` implementations to use `Write` trait.
- Change `extern fn` `fetch_notes` to delegate buffer allocation to the
  implementor.

Resolves #58
See also dusk-network/rusk#614
ureeves pushed a commit that referenced this issue Apr 11, 2022
- Add `unstake` function to allow unstaking a previously staked amount.
- Change `withdraw` function to withdraw the reward for staking and
  participating in the consensus.
- Change stake/withdraw cryptographic signatures to what the stake
  contract expects as call arguments
- Change `StakeInfo` structure to have an optional `amount` staked and
  a `reward`. It also includes a signature `counter`.
- Remove `get_block_height` function from the `StateClient` trait
- Change signature of `fetch_notes` by removing `block_height`. This
  effectively removes the concept from the library.
- Change `Serializable` implementations to use `Write` trait.
- Change `extern fn` `fetch_notes` to delegate buffer allocation to the
  implementor.

Resolves #58
See also dusk-network/rusk#614
@moCello moCello mentioned this issue Oct 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:wallet Issues related to the wallet functionalities exposed by the node mark:testnet team:Core Low Level Core Development Team (Rust)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant