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

Offline staking implementation #809

Merged
merged 291 commits into from
Jun 21, 2020
Merged

Offline staking implementation #809

merged 291 commits into from
Jun 21, 2020

Conversation

timemarkovqtum
Copy link
Contributor

New command line parameters:
-offlinestakingheight, -delegationsaddress, -stakingminutxovalue, -stakingminfee, -superstaking

New RPC calls:
getdelegationinfoforaddress, getdelegationsforstaker, splitutxosforaddress, removedelegationforaddress, setdelegateforaddress

The contract for delegation is not added into the EVM configuration because it is required modifications in the genesis bock, parameter genesis.hashStateRoot need to be modified in chainparams.cpp. The hash state root is a hash from all of the contracts bytecode into the EVM configuration, adding more bytecode will change that hash, no option for start block for compiled bytecode contracts. The precompiled contracts doesn't contain bytecode so they are not included into computation of the hash state root.

Activation from chainparams.cpp. Set the offline staking start block and the delegation contract address (create the delegation contract in a block before the offline stake height) for the specific network configuration:
consensus.nOfflineStakeHeight
consensus.delegationsAddress

For regtest mode those two parameters can be overwritten from command line -offlinestakingheight and -delegationsaddress.

Regtest command line:
qtum-qt -regtest -offlinestakingheight=BLOCK_HEIGHT -delegationsaddress=CONTRACT_ADDRESS

Regtest command line for super staker:
qtum-qt -regtest -offlinestakingheight=BLOCK_HEIGHT -delegationsaddress=CONTRACT_ADDRESS -superstaking

MarcoFalke and others added 30 commits February 9, 2020 07:50
5e17280 Squashed 'src/univalue/' changes from 7890db99d6..98261b1e7b (MarcoFalke)

Pull request description:

  Version bump backported from #18099

ACKs for top commit:
  laanwj:
    ACK fa4d00b

Tree-SHA512: dc34c98d9b1f450db700633ce7b674a3edf83bd12f3b77b74544a6b24f3e3b1f3c91f40d0ad6c27f82c1b26e88cf7625311b93f00e492a813dbdcca9f461cb5e
f11872c wallet: Reset reused transactions cache (Fabian Jahr)

Pull request description:

  Backport of #17843

  Required porting to pre-`WalletBatch`

ACKs for top commit:
  kallewoof:
    Code review ACK f11872c
  laanwj:
    code review ACK f11872c
  meshcollider:
    utACK f11872c

Tree-SHA512: 5cf5f136d1eafb0783c2e6799e3675ebc50997ebb56b379d8a198ac35eb3b32f6b98656760a8b1c821eeac665eb80efb1723dd4e9eb58d2b4d45c4674499bedf
… within bounds

f5fb7fc psbt: check output index is within bounds before accessing (Andrew Chow)
1cf77a2 Don't calculate tx fees for PSBTs with invalid money values (Andrew Chow)

Pull request description:

  Backport of #17156, non-trivial due to crossing the refactor in #17371

ACKs for top commit:
  laanwj:
    ACK f5fb7fc

Tree-SHA512: 7aabf9a6b8a8e287a26dfbf73a437a3bc55177bef8fc5149d822ef81b8ef2458e1d718c3a19c73532c5cef0f9bd8144574c7fad90ca89f13a08b44edf3a2656d
Tree-SHA512: 320576b94b58246ea7f2426e1dbe43cd0222c0ea58cf9a03e75225fcc226384478f39d7f54099d2cecbcf134a639932e7f2033eb3dd38786bb666dbb81aae2d7
Tree-SHA512: 18182903fed7034dc16c2d74ebccf992dd5343376d0f02bebaa50be4ff8fd76c9dd59a95524aef326b74b75a921c819063f06ef45fb9980ae87aacbfb7190554
Tree-SHA512: 23fc6e3712608a2d4ccec5ee2d0efdb3f8df8093f555890611039881a78147eee3a5226aade13d750e88be8f6814699424606b32cf7947faa6c034f1ff2dd81a
Tree-SHA512: 7ba1efdc24835405562b5ff710ed4223d7e4463dffa58721cc9e0f0f0ba90925e59719cb68b31f95cfc632a73ca9a5573e762167eed264c66323828a397b9127
facbdc0 doc: Add missing author to 0.19.1 release notes (MarcoFalke)

Pull request description:

  Commit 88729d8 is in 0.19, but the author is not in the release notes.

ACKs for top commit:
  practicalswift:
    ACK facbdc0 - credit where credit is due :)

Tree-SHA512: 5e65bdb6d1e2318143c978f7e69e2c22f09dc257d92c5a88c52da43b12b812ebbe1a9202382545d8dfd3bc1ca1927543cfeb1d2e5d6da98c1e90bc26765cb8b4
The parameter genesis.hashStateRoot is a hash of all bytecodes from the EVM configuration, it is used to create the genesis block.
The precompiled contracts have no bytecode so they are not hashed in the state root.
delegationsAddress is added to avoid changing the genesis block.
Neil and others added 29 commits May 27, 2020 00:08
Grouping Staking, Delegations and Super Staking under one menu
The EVM logs are not connected to the main log in the tests, so the default is to print to stdout. The solution is to connect them in the tests too.
Added tests for offlinestaking protocol;
Replace ceiling with integer division
* master:
  Add argument to getsubsidy
@qtum-neil qtum-neil merged commit 5feb318 into master Jun 21, 2020
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.

None yet

9 participants