Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
83a02dcf
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,发现更多精彩内容 >>
提交
83a02dcf
编写于
8月 08, 2018
作者:
B
Bart Wyatt
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
create option for disabling replay opts instead of co-opting the force-all-checks flag
上级
240ed8f5
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
8 addition
and
3 deletion
+8
-3
libraries/chain/controller.cpp
libraries/chain/controller.cpp
+3
-3
libraries/chain/include/eosio/chain/controller.hpp
libraries/chain/include/eosio/chain/controller.hpp
+2
-0
plugins/chain_plugin/chain_plugin.cpp
plugins/chain_plugin/chain_plugin.cpp
+3
-0
未找到文件。
libraries/chain/controller.cpp
浏览文件 @
83a02dcf
...
...
@@ -872,7 +872,7 @@ struct controller_impl {
pending
.
reset
();
});
bool
skip_db_sessions
=
!
conf
.
force_all_check
s
&&
(
s
==
controller
::
block_status
::
irreversible
);
bool
skip_db_sessions
=
!
conf
.
disable_replay_opt
s
&&
(
s
==
controller
::
block_status
::
irreversible
);
if
(
!
skip_db_sessions
)
{
EOS_ASSERT
(
db
.
revision
()
==
head
->
block_num
,
database_exception
,
"db revision is not on par with head block"
,
(
"db.revision()"
,
db
.
revision
())(
"controller_head_block"
,
head
->
block_num
)(
"fork_db_head_block"
,
fork_db
.
head
()
->
block_num
)
);
...
...
@@ -1655,11 +1655,11 @@ bool controller::skip_auth_check() const {
}
bool
controller
::
skip_db_sessions
()
const
{
return
!
my
->
conf
.
force_all_check
s
&&
my
->
pending
&&
!
my
->
in_trx_requiring_checks
&&
my
->
pending
->
_block_status
==
block_status
::
irreversible
;
return
!
my
->
conf
.
disable_replay_opt
s
&&
my
->
pending
&&
!
my
->
in_trx_requiring_checks
&&
my
->
pending
->
_block_status
==
block_status
::
irreversible
;
}
bool
controller
::
skip_trx_checks
()
const
{
return
!
my
->
conf
.
force_all_check
s
&&
my
->
pending
&&
!
my
->
in_trx_requiring_checks
&&
(
my
->
pending
->
_block_status
==
block_status
::
irreversible
||
my
->
pending
->
_block_status
==
block_status
::
validated
);
return
!
my
->
conf
.
disable_replay_opt
s
&&
my
->
pending
&&
!
my
->
in_trx_requiring_checks
&&
(
my
->
pending
->
_block_status
==
block_status
::
irreversible
||
my
->
pending
->
_block_status
==
block_status
::
validated
);
}
bool
controller
::
contracts_console
()
const
{
...
...
libraries/chain/include/eosio/chain/controller.hpp
浏览文件 @
83a02dcf
...
...
@@ -57,6 +57,7 @@ namespace eosio { namespace chain {
uint64_t
reversible_guard_size
=
chain
::
config
::
default_reversible_guard_size
;
bool
read_only
=
false
;
bool
force_all_checks
=
false
;
bool
disable_replay_opts
=
false
;
bool
contracts_console
=
false
;
genesis_state
genesis
;
...
...
@@ -286,6 +287,7 @@ FC_REFLECT( eosio::chain::controller::config,
(
reversible_cache_size
)
(
read_only
)
(
force_all_checks
)
(
disable_replay_opts
)
(
contracts_console
)
(
genesis
)
(
wasm_runtime
)
...
...
plugins/chain_plugin/chain_plugin.cpp
浏览文件 @
83a02dcf
...
...
@@ -225,6 +225,8 @@ void chain_plugin::set_program_options(options_description& cli, options_descrip
"recovers reversible block database if that database is in a bad state"
)
(
"force-all-checks"
,
bpo
::
bool_switch
()
->
default_value
(
false
),
"do not skip any checks that can be skipped while replaying irreversible blocks"
)
(
"disable-replay-opts"
,
bpo
::
bool_switch
()
->
default_value
(
false
),
"disable optimizations that specifically target replay"
)
(
"replay-blockchain"
,
bpo
::
bool_switch
()
->
default_value
(
false
),
"clear chain state database and replay all blocks"
)
(
"hard-replay-blockchain"
,
bpo
::
bool_switch
()
->
default_value
(
false
),
...
...
@@ -359,6 +361,7 @@ void chain_plugin::plugin_initialize(const variables_map& options) {
my
->
chain_config
->
wasm_runtime
=
*
my
->
wasm_runtime
;
my
->
chain_config
->
force_all_checks
=
options
.
at
(
"force-all-checks"
).
as
<
bool
>
();
my
->
chain_config
->
disable_replay_opts
=
options
.
at
(
"disable-replay-opts"
).
as
<
bool
>
();
my
->
chain_config
->
contracts_console
=
options
.
at
(
"contracts-console"
).
as
<
bool
>
();
if
(
options
.
count
(
"extract-genesis-json"
)
||
options
.
at
(
"print-genesis-json"
).
as
<
bool
>
())
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录