Commit 4dd01ec4 authored by SiaPrime's avatar SiaPrime

Merge branch 'tokenomic_changes' into 'master'

Tokenomic changes

See merge request !40
parents 40edf0cb 5dfaa8ac
Pipeline #39431573 failed with stages
in 2 minutes and 38 seconds
......@@ -80,7 +80,11 @@ func checkMinerPayoutsWithDevFund(b types.Block, height types.BlockHeight) bool
}
// TODO Keep this or remove?
if bytes.Compare(devSubsidyPayout.UnlockHash[:], types.DevFundUnlockHash[:]) != 0 {
subsidyUnlockHash := types.DevFundUnlockHash
if types.BurnAddressBlockHeight != types.BlockHeight(0) && height >= types.BurnAddressBlockHeight {
subsidyUnlockHash = types.BurnAddressUnlockHash
}
if bytes.Compare(devSubsidyPayout.UnlockHash[:], subsidyUnlockHash[:]) != 0 {
return false
}
......
......@@ -63,13 +63,17 @@ func (m *Miner) blockForWorkWithDevFund() types.Block {
if err != nil {
m.log.Println(err)
}
minerPayoutVal, devPayoutVal := b.CalculateSubsidies(m.persist.Height + 1)
minerPayoutVal, subsidyPayoutVal := b.CalculateSubsidies(m.persist.Height + 1)
subsidyUnlockHash := types.DevFundUnlockHash
if types.BurnAddressBlockHeight != types.BlockHeight(0) && (m.persist.Height+1) >= types.BurnAddressBlockHeight {
subsidyUnlockHash = types.BurnAddressUnlockHash
}
b.MinerPayouts = []types.SiacoinOutput{{
Value: minerPayoutVal,
UnlockHash: m.persist.Address,
}, {
Value: devPayoutVal,
UnlockHash: types.DevFundUnlockHash,
Value: subsidyPayoutVal,
UnlockHash: subsidyUnlockHash,
}}
// Add an arb-data txn to the block to create a unique merkle root.
......
......@@ -49,7 +49,11 @@ func (p *Pool) blockForWorkWithDevFund() types.Block {
b.Timestamp = types.CurrentTimestamp()
}
minerPayoutVal, devPayoutVal := b.CalculateSubsidies(p.persist.BlockHeight + 1)
minerPayoutVal, subsidyPayoutVal := b.CalculateSubsidies(p.persist.BlockHeight + 1)
subsidyUnlockHash := types.DevFundUnlockHash
if types.BurnAddressBlockHeight != types.BlockHeight(0) && (p.persist.BlockHeight+1) >= types.BurnAddressBlockHeight {
subsidyUnlockHash = types.BurnAddressUnlockHash
}
p.log.Printf("building a new source block, block id is: %s\n", b.ID())
p.log.Printf("miner fees cost: %s", b.CalculateMinerFees().String())
p.log.Printf("# transactions: %d", len(b.Transactions))
......@@ -58,8 +62,8 @@ func (p *Pool) blockForWorkWithDevFund() types.Block {
Value: minerPayoutVal,
UnlockHash: p.persist.Settings.PoolWallet,
}, {
Value: devPayoutVal,
UnlockHash: types.DevFundUnlockHash,
Value: subsidyPayoutVal,
UnlockHash: subsidyUnlockHash,
}}
return b
......
......@@ -21,6 +21,12 @@ var (
// BlockSizeLimit is the maximum size of a binary-encoded Block
// that is permitted by the consensus rules.
BlockSizeLimit = uint64(2e6)
// BurnAddressBlockHeight is the height at which the dev fund will be burnt
// instead of being claimed by the dev fund. Setting this value to 0 will
// prevent the dev fund from being burnt at any height.
BurnAddressBlockHeight = BlockHeight(105000)
// BurnAddressUnlockHash is the unlock hash for where to send coins to burn.
BurnAddressUnlockHash = UnlockHashFromAddrStr("000000000000000000000000000000000000000000000000000000000000000089eb0d6a8a69")
// DevFundEnabled is a boolean that when set to true will enable the ability to
// configure a dev fund
DevFundEnabled = true
......@@ -381,7 +387,7 @@ func init() {
// decreases by 1 every time, it means that Sia's coinbase will have an
// increasingly potent dropoff for about 5 years, until inflation more
// or less permanently settles around 2%.
MinimumCoinbase = 50e3
MinimumCoinbase = 10e3
// The oak difficulty adjustment hardfork is set to trigger at block
// 135,000, which is just under 6 months after the hardfork was first
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment