Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
b13e483c
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,发现更多精彩内容 >>
提交
b13e483c
编写于
5月 17, 2018
作者:
D
Daniel Larimer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix #3140 unconfirmed cache invariant enforcements and related bug fixes
上级
7601fd83
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
17 addition
and
23 deletion
+17
-23
libraries/chain/controller.cpp
libraries/chain/controller.cpp
+12
-22
libraries/chain/include/eosio/chain/config.hpp
libraries/chain/include/eosio/chain/config.hpp
+1
-0
libraries/chain/include/eosio/chain/controller.hpp
libraries/chain/include/eosio/chain/controller.hpp
+3
-1
libraries/testing/tester.cpp
libraries/testing/tester.cpp
+1
-0
未找到文件。
libraries/chain/controller.cpp
浏览文件 @
b13e483c
...
...
@@ -73,7 +73,10 @@ struct controller_impl {
FC_ASSERT
(
prev
,
"attempt to pop beyond last irreversible block"
);
if
(
const
auto
*
b
=
unconfirmed_blocks
.
find
<
unconfirmed_block_object
,
by_num
>
(
head
->
block_num
)
)
{
edump
((
b
->
blocknum
));
unconfirmed_blocks
.
remove
(
*
b
);
}
for
(
const
auto
&
t
:
head
->
trxs
)
unapplied_transactions
[
t
->
signed_id
]
=
t
;
...
...
@@ -94,7 +97,7 @@ struct controller_impl {
cfg
.
shared_memory_size
),
unconfirmed_blocks
(
cfg
.
block_log_dir
/
"unconfirmed"
,
cfg
.
read_only
?
database
::
read_only
:
database
::
read_write
,
std
::
min
<
uint64_t
>
(
cfg
.
shared_memory_size
,
128
*
1024
*
1024ll
)
),
/// 1GB should store 1000 1MB blocks + overhead
cfg
.
unconfirmed_cache_size
),
blog
(
cfg
.
block_log_dir
),
fork_db
(
cfg
.
shared_memory_dir
),
wasmif
(
cfg
.
wasm_runtime
),
...
...
@@ -202,19 +205,9 @@ struct controller_impl {
(
"db"
,
db
.
revision
())(
"head"
,
head
->
block_num
)(
"unconfimed"
,
unconf_blocknum
)
);
edump
((
unconf_blocknum
));
/*
FC_ASSERT
(
head
->
block_num
==
unconf_blocknum
,
"unconfirmed block database out of sync"
,
(
"db"
,
db
.
revision
())(
"head"
,
head
->
block_num
)(
"unconfimed"
,
unconf_blocknum
)
);
*/
/**
* The undoable state contains state transitions from blocks
* in the fork database that could be reversed. Because this
* is a new startup and the fork database is empty, we must
* unwind that pending state. This state will be regenerated
* when we catch up to the head block later.
*/
//clear_all_undo();
}
~
controller_impl
()
{
...
...
@@ -400,20 +393,17 @@ struct controller_impl {
}
if
(
!
replaying
)
{
auto
itr
=
unconfirmed_blocks
.
find
<
unconfirmed_block_object
,
by_num
>
(
head
->
block_num
);
if
(
!
itr
)
{
unconfirmed_blocks
.
create
<
unconfirmed_block_object
>
(
[
&
](
auto
&
ubo
)
{
ubo
.
blocknum
=
head
->
block_num
;
ubo
.
set_block
(
head
->
block
);
});
}
}
// ilog((fc::json::to_pretty_string(*pending->_pending_block_state->block)));
emit
(
self
.
accepted_block
,
pending
->
_pending_block_state
);
pending
->
push
();
if
(
!
replaying
)
{
unconfirmed_blocks
.
create
<
unconfirmed_block_object
>
(
[
&
](
auto
&
ubo
)
{
ubo
.
blocknum
=
pending
->
_pending_block_state
->
block_num
;
ubo
.
set_block
(
pending
->
_pending_block_state
->
block
);
});
}
pending
.
reset
();
}
...
...
libraries/chain/include/eosio/chain/config.hpp
浏览文件 @
b13e483c
...
...
@@ -15,6 +15,7 @@ typedef __uint128_t uint128_t;
const
static
auto
default_block_log_dir
=
"block_log"
;
const
static
auto
default_shared_memory_dir
=
"shared_mem"
;
const
static
auto
default_shared_memory_size
=
1
*
1024
*
1024
*
1024ll
;
const
static
auto
default_unconfirmed_cache_size
=
320
*
1024
*
1024ll
;
/// 1MB * 340 blocks based on 21 producer BFT delay
const
static
uint64_t
system_account_name
=
N
(
eosio
);
const
static
uint64_t
null_account_name
=
N
(
eosio
.
null
);
...
...
libraries/chain/include/eosio/chain/controller.hpp
浏览文件 @
b13e483c
...
...
@@ -36,7 +36,8 @@ namespace eosio { namespace chain {
class
controller
{
public:
struct
config
{
path
block_log_dir
=
chain
::
config
::
default_block_log_dir
;
path
block_log_dir
=
chain
::
config
::
default_block_log_dir
;
uint64_t
unconfirmed_cache_size
=
chain
::
config
::
default_unconfirmed_cache_size
;;
path
shared_memory_dir
=
chain
::
config
::
default_shared_memory_dir
;
uint64_t
shared_memory_size
=
chain
::
config
::
default_shared_memory_size
;
bool
read_only
=
false
;
...
...
@@ -200,6 +201,7 @@ namespace eosio { namespace chain {
FC_REFLECT
(
eosio
::
chain
::
controller
::
config
,
(
block_log_dir
)
(
unconfirmed_cache_size
)
(
shared_memory_dir
)(
shared_memory_size
)(
read_only
)
(
genesis
)
(
wasm_runtime
)
...
...
libraries/testing/tester.cpp
浏览文件 @
b13e483c
...
...
@@ -36,6 +36,7 @@ namespace eosio { namespace testing {
cfg
.
block_log_dir
=
tempdir
.
path
()
/
"blocklog"
;
cfg
.
shared_memory_dir
=
tempdir
.
path
()
/
"shared"
;
cfg
.
shared_memory_size
=
1024
*
1024
*
8
;
cfg
.
unconfirmed_cache_size
=
1024
*
1024
*
8
;
cfg
.
genesis
.
initial_timestamp
=
fc
::
time_point
::
from_iso_string
(
"2020-01-01T00:00:00.000"
);
cfg
.
genesis
.
initial_key
=
get_public_key
(
config
::
system_account_name
,
"active"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录