Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
075b7171
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,发现更多精彩内容 >>
提交
075b7171
编写于
4月 05, 2018
作者:
D
Daniel Larimer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix #2156 - replay fails due to access of non-consensus state
上级
df65f11f
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
35 addition
and
41 deletion
+35
-41
genesis.json
genesis.json
+0
-16
libraries/chain/chain_controller.cpp
libraries/chain/chain_controller.cpp
+29
-21
plugins/net_plugin/net_plugin.cpp
plugins/net_plugin/net_plugin.cpp
+1
-1
plugins/producer_plugin/producer_plugin.cpp
plugins/producer_plugin/producer_plugin.cpp
+5
-3
未找到文件。
genesis.json
已删除
100644 → 0
浏览文件 @
df65f11f
{
"initial_key"
:
"EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
,
"initial_timestamp"
:
"2017-03-30T12:00:00"
,
"initial_parameters"
:
{
"maintenance_interval"
:
86400
,
"maintenance_skip_slots"
:
3
,
"maximum_transaction_size"
:
2048
,
"maximum_block_size"
:
2048000000
,
"maximum_time_until_expiration"
:
86400
,
"maximum_producer_count"
:
1001
},
"immutable_parameters"
:
{
"min_producer_count"
:
21
},
"initial_chain_id"
:
"0000000000000000000000000000000000000000000000000000000000000000"
}
libraries/chain/chain_controller.cpp
浏览文件 @
075b7171
...
...
@@ -173,6 +173,7 @@ void chain_controller::push_block(const signed_block& new_block, uint32_t skip)
}
);
});
});
ilog
(
"
\r
push block #${n} from ${pro} ${time} ${id} lib: ${l} success"
,
(
"n"
,
new_block
.
block_num
())(
"pro"
,
name
(
new_block
.
producer
))(
"time"
,
new_block
.
timestamp
)(
"id"
,
new_block
.
id
())(
"l"
,
last_irreversible_block_num
()));
}
FC_CAPTURE_AND_RETHROW
((
new_block
))
}
bool
chain_controller
::
_push_block
(
const
signed_block
&
new_block
)
...
...
@@ -614,6 +615,7 @@ void chain_controller::_finalize_block( const block_trace& trace, const producer
// trigger an update of our elastic values for block limits
_resource_limits
.
process_block_usage
(
b
.
block_num
());
// validate_block_header( _skip_flags, b );
applied_block
(
trace
);
//emit
if
(
_currently_replaying_blocks
)
applied_irreversible_block
(
b
);
...
...
@@ -703,10 +705,12 @@ signed_block chain_controller::_generate_block( block_timestamp_type when,
*/
void
chain_controller
::
pop_block
()
{
try
{
_pending_block_session
.
reset
();
clear_pending
();
auto
head_id
=
head_block_id
();
optional
<
signed_block
>
head_block
=
fetch_block_by_id
(
head_id
);
EOS_ASSERT
(
head_block
.
valid
(),
pop_empty_chain
,
"there are no blocks to pop"
);
wlog
(
"
\r
pop block #${n} from ${pro} ${time} ${id}"
,
(
"n"
,
head_block
->
block_num
())(
"pro"
,
name
(
head_block
->
producer
))(
"time"
,
head_block
->
timestamp
)(
"id"
,
head_block
->
id
()));
_fork_db
.
pop_block
();
_db
.
undo
();
...
...
@@ -1392,7 +1396,7 @@ void chain_controller::require_account(const account_name& name) const {
FC_ASSERT
(
account
!=
nullptr
,
"Account not found: ${name}"
,
(
"name"
,
name
));
}
const
producer_object
&
chain_controller
::
validate_block_header
(
uint32_t
skip
,
const
signed_block
&
next_block
)
const
{
const
producer_object
&
chain_controller
::
validate_block_header
(
uint32_t
skip
,
const
signed_block
&
next_block
)
const
{
try
{
EOS_ASSERT
(
head_block_id
()
==
next_block
.
previous
,
block_validate_exception
,
""
,
(
"head_block_id"
,
head_block_id
())(
"next.prev"
,
next_block
.
previous
));
EOS_ASSERT
(
head_block_time
()
<
(
fc
::
time_point
)
next_block
.
timestamp
,
block_validate_exception
,
""
,
...
...
@@ -1423,10 +1427,12 @@ const producer_object& chain_controller::validate_block_header(uint32_t skip, co
(
"block producer"
,
next_block
.
producer
)(
"scheduled producer"
,
producer
.
owner
));
}
EOS_ASSERT
(
next_block
.
schedule_version
==
get_global_properties
().
active_producers
.
version
,
block_validate_exception
,
"wrong producer schedule version specified"
);
auto
expected_schedule_version
=
get_global_properties
().
active_producers
.
version
;
EOS_ASSERT
(
next_block
.
schedule_version
==
expected_schedule_version
,
block_validate_exception
,
"wrong producer schedule version specified ${x} expectd ${y}"
,
(
"x"
,
next_block
.
schedule_version
)(
"y"
,
expected_schedule_version
)
);
return
producer
;
}
}
FC_CAPTURE_AND_RETHROW
(
(
block_header
(
next_block
)))
}
void
chain_controller
::
create_block_summary
(
const
signed_block
&
next_block
)
{
auto
sid
=
next_block
.
block_num
()
&
0xffff
;
...
...
@@ -1471,6 +1477,7 @@ void chain_controller::update_global_properties(const signed_block& b) { try {
const
auto
&
gpo
=
get_global_properties
();
if
(
_head_producer_schedule
()
!=
schedule
)
{
//wlog( "change in producer schedule pending irreversible: ${s}", ("s", b.new_producers ) );
FC_ASSERT
(
b
.
new_producers
,
"pending producer set changed but block didn't indicate it"
);
}
_db
.
modify
(
gpo
,
[
&
](
auto
&
props
)
{
...
...
@@ -1478,7 +1485,8 @@ void chain_controller::update_global_properties(const signed_block& b) { try {
props
.
pending_active_producers
.
back
().
second
=
schedule
;
else
{
props
.
pending_active_producers
.
emplace_back
(
props
.
pending_active_producers
.
get_allocator
()
);
// props.pending_active_producers.size()+1, props.pending_active_producers.get_allocator() );
props
.
pending_active_producers
.
emplace_back
(
props
.
pending_active_producers
.
get_allocator
()
);
// props.pending_active_producers.size()+1, props.pending_active_producers.get_allocator() );
auto
&
back
=
props
.
pending_active_producers
.
back
();
back
.
first
=
b
.
block_num
();
back
.
second
=
schedule
;
...
...
@@ -1846,24 +1854,24 @@ void chain_controller::update_last_irreversible_block()
}
}
if
(
new_last_irreversible_block_num
>
last_block_on_disk
)
{
/// TODO: use upper / lower bound to find
optional
<
producer_schedule_type
>
new_producer_schedule
;
for
(
const
auto
&
item
:
gpo
.
pending_active_producers
)
{
if
(
item
.
first
<
new_last_irreversible_block_num
)
{
new_producer_schedule
=
item
.
second
;
}
/// TODO: use upper / lower bound to find
optional
<
producer_schedule_type
>
new_producer_schedule
;
for
(
const
auto
&
item
:
gpo
.
pending_active_producers
)
{
if
(
item
.
first
<
new_last_irreversible_block_num
)
{
new_producer_schedule
=
item
.
second
;
}
if
(
new_producer_schedule
)
{
update_or_create_producers
(
*
new_producer_schedule
);
_db
.
modify
(
gpo
,
[
&
](
auto
&
props
){
boost
::
range
::
remove_erase_if
(
props
.
pending_active_producers
,
[
new_last_irreversible_block_num
](
const
typename
decltype
(
props
.
pending_active_producers
)
::
value_type
&
v
)
->
bool
{
return
v
.
first
<
new_last_irreversible_block_num
;
});
}
if
(
new_producer_schedule
)
{
update_or_create_producers
(
*
new_producer_schedule
);
_db
.
modify
(
gpo
,
[
&
](
auto
&
props
){
boost
::
range
::
remove_erase_if
(
props
.
pending_active_producers
,
[
new_last_irreversible_block_num
](
const
typename
decltype
(
props
.
pending_active_producers
)
::
value_type
&
v
)
->
bool
{
return
v
.
first
<=
new_last_irreversible_block_num
;
});
if
(
props
.
active_producers
.
version
!=
new_producer_schedule
->
version
)
{
props
.
active_producers
=
*
new_producer_schedule
;
});
}
}
}
);
}
// Trim fork_database and undo histories
...
...
plugins/net_plugin/net_plugin.cpp
浏览文件 @
075b7171
...
...
@@ -1407,7 +1407,7 @@ namespace eosio {
send_handshakes
();
}
else
{
ilog
(
"
a second atten
pt to retrive block ${n} failed"
,
ilog
(
"
second attem
pt to retrive block ${n} failed"
,
(
"n"
,
head_num
+
1
));
last_repeated
=
0
;
c
->
close
();
...
...
plugins/producer_plugin/producer_plugin.cpp
浏览文件 @
075b7171
...
...
@@ -222,9 +222,11 @@ block_production_condition::block_production_condition_enum producer_plugin_impl
_prev_result_count
++
;
}
else
{
/*
if (_prev_result_count > 1) {
ilog("Previous result occurred ${r} times",("r", _prev_result_count));
}
*/
_prev_result_count
=
1
;
_prev_result
=
result
;
switch
(
result
)
...
...
@@ -234,17 +236,17 @@ block_production_condition::block_production_condition_enum producer_plugin_impl
auto
producer
=
db
.
head_block_producer
();
// auto pending = db.pending().size();
wlog
(
"
\r
${p} generated block ${id}... #${n} @ ${t} with ${count} trxs
"
,
(
"p"
,
producer
)(
capture
)
);
wlog
(
"
\r
${p} generated block ${id}... #${n} @ ${t} with ${count} trxs
, lib: ${lib}"
,
(
"p"
,
producer
)(
"lib"
,
db
.
last_irreversible_block_num
()
)(
capture
)
);
break
;
}
case
block_production_condition
::
not_synced
:
ilog
(
"Not producing block because production is disabled until we receive a recent block (see: --enable-stale-production)"
);
break
;
case
block_production_condition
::
not_my_turn
:
ilog
(
"Not producing block because it isn't my turn, its ${scheduled_producer}"
,
(
capture
)
);
//
ilog("Not producing block because it isn't my turn, its ${scheduled_producer}", (capture) );
break
;
case
block_production_condition
::
not_time_yet
:
ilog
(
"Not producing block because slot has not yet arrived"
);
//
ilog("Not producing block because slot has not yet arrived");
break
;
case
block_production_condition
::
no_private_key
:
ilog
(
"Not producing block because I don't have the private key for ${scheduled_key}"
,
(
capture
)
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录