Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
4d98e29a
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,发现更多精彩内容 >>
提交
4d98e29a
编写于
8月 30, 2017
作者:
D
Daniel Larimer
提交者:
GitHub
8月 30, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #265 from wanderingbort/feature/263-single-threaded
Add a single threaded scheduler and make it the default
上级
2534e052
4d96684b
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
29 addition
and
3 deletion
+29
-3
libraries/chain/block_schedule.cpp
libraries/chain/block_schedule.cpp
+19
-0
libraries/chain/include/eos/chain/block_schedule.hpp
libraries/chain/include/eos/chain/block_schedule.hpp
+7
-0
libraries/chain/include/eos/chain/chain_controller.hpp
libraries/chain/include/eos/chain/chain_controller.hpp
+1
-1
plugins/producer_plugin/producer_plugin.cpp
plugins/producer_plugin/producer_plugin.cpp
+1
-1
tests/common/database_fixture.cpp
tests/common/database_fixture.cpp
+1
-1
未找到文件。
libraries/chain/block_schedule.cpp
浏览文件 @
4d98e29a
...
...
@@ -289,4 +289,23 @@ block_schedule block_schedule::by_cycling_conflicts(
return
from_entries
(
schedule
);
}
block_schedule
block_schedule
::
in_single_thread
(
const
vector
<
pending_transaction
>&
transactions
,
const
global_property_object
&
properties
)
{
auto
skipper
=
make_skipper
(
properties
);
thread_schedule
thread
;
thread
.
transactions
.
reserve
(
transactions
.
size
());
for
(
const
auto
&
t
:
transactions
)
{
if
(
skipper
.
should_skip
(
t
))
{
break
;
}
thread
.
transactions
.
push_back
(
t
);
}
return
block_schedule
{
{
{
thread
}
}
};
}
}
/* namespace chain */
}
/* namespace eos */
libraries/chain/include/eos/chain/block_schedule.hpp
浏览文件 @
4d98e29a
...
...
@@ -60,6 +60,13 @@ namespace eos { namespace chain {
* @return the block scheduler
*/
static
block_schedule
by_cycling_conflicts
(
const
vector
<
pending_transaction
>&
transactions
,
const
global_property_object
&
properties
);
/**
* A reference scheduler that puts all transactions in a single thread (FIFO)
* @return the block scheduler
*/
static
block_schedule
in_single_thread
(
const
vector
<
pending_transaction
>&
transactions
,
const
global_property_object
&
properties
);
};
struct
scope_extracting_visitor
:
public
fc
::
visitor
<
std
::
set
<
AccountName
>>
{
...
...
libraries/chain/include/eos/chain/chain_controller.hpp
浏览文件 @
4d98e29a
...
...
@@ -164,7 +164,7 @@ namespace eos { namespace chain {
fc
::
time_point_sec
when
,
const
AccountName
&
producer
,
const
fc
::
ecc
::
private_key
&
block_signing_private_key
,
block_schedule
::
factory
scheduler
=
block_schedule
::
by_threading_conflicts
,
block_schedule
::
factory
scheduler
=
block_schedule
::
in_single_thread
,
uint32_t
skip
=
skip_nothing
);
signed_block
_generate_block
(
...
...
plugins/producer_plugin/producer_plugin.cpp
浏览文件 @
4d98e29a
...
...
@@ -54,7 +54,7 @@ public:
bool
_production_enabled
=
false
;
uint32_t
_required_producer_participation
=
33
*
config
::
Percent1
;
uint32_t
_production_skip_flags
=
eos
::
chain
::
chain_controller
::
skip_nothing
;
eos
::
chain
::
block_schedule
::
factory
_production_scheduler
=
eos
::
chain
::
block_schedule
::
by_threading_conflicts
;
eos
::
chain
::
block_schedule
::
factory
_production_scheduler
=
eos
::
chain
::
block_schedule
::
in_single_thread
;
std
::
map
<
chain
::
public_key_type
,
fc
::
ecc
::
private_key
>
_private_keys
;
std
::
set
<
types
::
AccountName
>
_producers
;
...
...
tests/common/database_fixture.cpp
浏览文件 @
4d98e29a
...
...
@@ -116,7 +116,7 @@ void testing_blockchain::produce_blocks(uint32_t count, uint32_t blocks_to_miss)
auto
slot
=
blocks_to_miss
+
1
;
auto
producer
=
get_producer
(
get_scheduled_producer
(
slot
));
auto
private_key
=
fixture
.
get_private_key
(
producer
.
signing_key
);
generate_block
(
get_slot_time
(
slot
),
producer
.
owner
,
private_key
,
block_schedule
::
by_threading_conflicts
,
generate_block
(
get_slot_time
(
slot
),
producer
.
owner
,
private_key
,
block_schedule
::
in_single_thread
,
skip_trx_sigs
?
chain_controller
::
skip_transaction_signatures
:
0
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录