Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
1efaeafa
Y
YTBP
项目概览
YottaChain
/
YTBP
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
YTBP
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1efaeafa
编写于
5月 21, 2018
作者:
K
Khaled Al-Hassanieh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Prevent name auctions from closing until 14 days after min_stake_activated - #3209
上级
de54bb5e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
24 addition
and
15 deletion
+24
-15
contracts/eosio.system/eosio.system.abi
contracts/eosio.system/eosio.system.abi
+1
-0
contracts/eosio.system/eosio.system.hpp
contracts/eosio.system/eosio.system.hpp
+3
-1
contracts/eosio.system/producer_pay.cpp
contracts/eosio.system/producer_pay.cpp
+17
-14
contracts/eosio.system/voting.cpp
contracts/eosio.system/voting.cpp
+3
-0
未找到文件。
contracts/eosio.system/eosio.system.abi
浏览文件 @
1efaeafa
...
...
@@ -260,6 +260,7 @@
{"name":"savings", "type":"int64"},
{"name":"total_unpaid_blocks", "type":"uint32"},
{"name":"total_activated_stake", "type":"int64"},
{"name":"thresh_activated_stake_time", "type":"uint64"},
{"name":"last_producer_schedule_id", "type":"checksum160"},
{"name":"total_producer_vote_weight", "type":"float64"},
{"name":"last_name_close", "type":"block_timestamp_type"}
...
...
contracts/eosio.system/eosio.system.hpp
浏览文件 @
1efaeafa
...
...
@@ -57,6 +57,7 @@ namespace eosiosystem {
int64_t
savings
=
0
;
uint32_t
total_unpaid_blocks
=
0
;
/// all blocks which have been produced but not paid
int64_t
total_activated_stake
=
0
;
uint64_t
thresh_activated_stake_time
=
0
;
checksum160
last_producer_schedule_id
;
double
total_producer_vote_weight
=
0
;
/// the sum of all producer votes
block_timestamp
last_name_close
;
...
...
@@ -65,7 +66,8 @@ namespace eosiosystem {
EOSLIB_SERIALIZE_DERIVED
(
eosio_global_state
,
eosio_parameters
,
(
total_ram_bytes_reserved
)(
total_ram_stake
)
(
last_producer_schedule_update
)
(
last_pervote_bucket_fill
)
(
pervote_bucket
)(
perblock_bucket
)(
savings
)(
total_unpaid_blocks
)(
total_activated_stake
)(
last_producer_schedule_id
)(
total_producer_vote_weight
)(
last_name_close
)
)
(
pervote_bucket
)(
perblock_bucket
)(
savings
)(
total_unpaid_blocks
)(
total_activated_stake
)(
thresh_activated_stake_time
)
(
last_producer_schedule_id
)(
total_producer_vote_weight
)(
last_name_close
)
)
};
struct
producer_info
{
...
...
contracts/eosio.system/producer_pay.cpp
浏览文件 @
1efaeafa
...
...
@@ -4,17 +4,17 @@
namespace
eosiosystem
{
const
int64_t
min_
daily_tokens
=
1
00
;
const
int64_t
min_activated_stake
=
150'000'000'0000
;
const
double
continuous_rate
=
0.04879
;
// 5% annual rate
const
double
perblock_rate
=
0.0025
;
// 0.25%
const
double
standby_rate
=
0.0075
;
// 0.75%
const
uint32_t
blocks_per_year
=
52
*
7
*
24
*
2
*
3600
;
// half seconds per year
const
uint32_t
seconds_per_year
=
52
*
7
*
24
*
3600
;
const
uint32_t
blocks_per_day
=
2
*
24
*
3600
;
const
uint32_t
blocks_per_hour
=
2
*
3600
;
const
uint64_t
useconds_per_day
=
24
*
3600
*
uint64_t
(
1000000
);
const
uint64_t
useconds_per_year
=
seconds_per_year
*
1000000ll
;
const
int64_t
min_
pervote_daily_pay
=
100'00
00
;
const
int64_t
min_activated_stake
=
150'000'000'0000
;
const
double
continuous_rate
=
0.04879
;
// 5% annual rate
const
double
perblock_rate
=
0.0025
;
// 0.25%
const
double
standby_rate
=
0.0075
;
// 0.75%
const
uint32_t
blocks_per_year
=
52
*
7
*
24
*
2
*
3600
;
// half seconds per year
const
uint32_t
seconds_per_year
=
52
*
7
*
24
*
3600
;
const
uint32_t
blocks_per_day
=
2
*
24
*
3600
;
const
uint32_t
blocks_per_hour
=
2
*
3600
;
const
uint64_t
useconds_per_day
=
24
*
3600
*
uint64_t
(
1000000
);
const
uint64_t
useconds_per_year
=
seconds_per_year
*
1000000ll
;
void
system_contract
::
onblock
(
block_timestamp
timestamp
,
account_name
producer
)
{
...
...
@@ -49,12 +49,15 @@ namespace eosiosystem {
print
(
"maybe update bids
\n
"
);
if
(
(
timestamp
.
slot
-
_gstate
.
last_name_close
.
slot
)
>
(
2
*
60
*
60
*
24ll
)
/*timeslots_per_day*/
)
{
if
(
(
timestamp
.
slot
-
_gstate
.
last_name_close
.
slot
)
>
blocks_per_day
)
{
print
(
"update bids"
);
name_bid_table
bids
(
_self
,
_self
);
auto
idx
=
bids
.
get_index
<
N
(
highbid
)
>
();
auto
highest
=
idx
.
begin
();
if
(
highest
!=
idx
.
end
()
&&
highest
->
high_bid
>
0
&&
highest
->
last_bid_time
<
(
current_time
()
-
useconds_per_day
)
)
{
if
(
highest
!=
idx
.
end
()
&&
highest
->
high_bid
>
0
&&
highest
->
last_bid_time
<
(
current_time
()
-
useconds_per_day
)
&&
(
current_time
()
-
_gstate
.
thresh_activated_stake_time
)
>
14
*
useconds_per_day
){
_gstate
.
last_name_close
=
timestamp
;
idx
.
modify
(
highest
,
0
,
[
&
](
auto
&
b
){
b
.
high_bid
=
-
b
.
high_bid
;
...
...
@@ -106,7 +109,7 @@ namespace eosiosystem {
if
(
_gstate
.
total_producer_vote_weight
>
0
)
{
producer_per_vote_pay
=
int64_t
((
_gstate
.
pervote_bucket
*
prod
.
total_votes
)
/
_gstate
.
total_producer_vote_weight
);
}
if
(
producer_per_vote_pay
<
100'0000
)
{
if
(
producer_per_vote_pay
<
min_pervote_daily_pay
)
{
producer_per_vote_pay
=
0
;
}
int64_t
total_pay
=
producer_per_block_pay
+
producer_per_vote_pay
;
...
...
contracts/eosio.system/voting.cpp
浏览文件 @
1efaeafa
...
...
@@ -167,6 +167,9 @@ namespace eosiosystem {
*/
if
(
voter
->
last_vote_weight
<=
0.0
)
{
_gstate
.
total_activated_stake
+=
voter
->
staked
;
if
(
_gstate
.
total_activated_stake
>=
min_activated_stake
)
{
_gstate
.
thresh_activated_stake_time
=
current_time
();
}
}
auto
new_vote_weight
=
stake2vote
(
voter
->
staked
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录