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

Bulwark Re-Stake #173

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

Bulwark Re-Stake #173

wants to merge 6 commits into from

Conversation

hodlforjesus
Copy link
Contributor

Bulwark's "Re-Stake". Because Bulwark stores metadata identifying stake in tx we know that previously this was a POS reward

If you have not previously staked on this input then you will have to wait longer for your stake to mature.

This penalizes "Stake Grinding" and gives reason to leave stakes alone reducing traffic on the network.

@@ -915,6 +916,7 @@ int GetIXConfirmations(uint256 nTXHash) {
// introduced to help nodes establish a consistent view of the coin
// age (trust score) of competing branches.
bool GetCoinAge(const CTransaction& tx, const unsigned int nTxTime, uint64_t& nCoinAge) {

Choose a reason for hiding this comment

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

nit, trailing space

}
}
// Ensure the output of the stake is above min amount (100 for BWK)
if (block.vtx[1].vout[1].nValue < minStakeAmount)

Choose a reason for hiding this comment

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

doesn't this achieve the same as the code deleted above?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes the amount didn't change but I wanted to group the logic together.

Choose a reason for hiding this comment

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

Ok

// If you have not previously staked on this input then you will have to wait longer for your stake to mature.
// This penalizes "Stake Grinding" and gives reason to leave stakes alone reducing traffic on the network.
if (IsSporkActive(SPORK_25_BWK_RESTAKE) && block.GetBlockTime() >= GetSporkValue(SPORK_25_BWK_RESTAKE)) {
// Time is doubled if it's not a basic steak (without split)

Choose a reason for hiding this comment

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

nit, stake spelling mistake

@@ -1704,8 +1707,17 @@ bool CWallet::SelectStakeCoins(std::set<std::pair<const CWalletTx*, unsigned int
if (out.tx->vout[out.i].nValue < nStakeAmount)
continue;

//For Bulwark Re-staking since we know if a tx is previous stake it'll be considered re-stake resulting in various advantages

Choose a reason for hiding this comment

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

this adds more incentive to stake grind, but in a different way,might wanna see how this plays out on a testnet

@@ -47,6 +47,8 @@ using namespace boost;
#define SPORK_21_ENABLE_ZEROCOIN 10020
#define SPORK_22_ZEROCOIN_MAINTENANCE_MODE 10021
#define SPORK_23_STAKING_REQUIREMENTS 10022
#define SPORK_24_QUERY_NODES 10023

Choose a reason for hiding this comment

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

What is this spork used for?its not used anywhere in this pr afaik

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This one is for another upcoming feature Penple is looking into.

Choose a reason for hiding this comment

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

Ok

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

2 participants