Skip to content
GitLab
About GitLab
GitLab: the DevOps platform
Explore GitLab
Install GitLab
How GitLab compares
Get started
GitLab docs
GitLab Learn
Pricing
Talk to an expert
/
Help
What's new
2
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Projects
Groups
Snippets
Sign up now
Login
Sign in / Register
Toggle navigation
Menu
Open sidebar
SiaPrime
Sia
Commits
4dd01ec4
Commit
4dd01ec4
authored
Dec 08, 2018
by
SiaPrime
Browse files
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
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
modules/consensus/block_validation.go
View file @
4dd01ec4
...
...
@@ -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
}
...
...
modules/miner/blockmanager.go
View file @
4dd01ec4
...
...
@@ -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
:
dev
PayoutVal
,
UnlockHash
:
types
.
DevFund
UnlockHash
,
Value
:
subsidy
PayoutVal
,
UnlockHash
:
subsidy
UnlockHash
,
}}
// Add an arb-data txn to the block to create a unique merkle root.
...
...
modules/miningpool/blockmanager.go
View file @
4dd01ec4
...
...
@@ -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
:
dev
PayoutVal
,
UnlockHash
:
types
.
DevFund
UnlockHash
,
Value
:
subsidy
PayoutVal
,
UnlockHash
:
subsidy
UnlockHash
,
}}
return
b
...
...
types/constants.go
View file @
4dd01ec4
...
...
@@ -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
=
5
0e3
MinimumCoinbase
=
1
0e3
// The oak difficulty adjustment hardfork is set to trigger at block
// 135,000, which is just under 6 months after the hardfork was first
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment