Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
e3f22656
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,发现更多精彩内容 >>
提交
e3f22656
编写于
8月 07, 2017
作者:
B
Bart Wyatt
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make the scheduler potentially vary per produced block, controlled by the producer plugin
上级
d0828b2b
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
16 addition
and
8 deletion
+16
-8
libraries/chain/block_schedule.cpp
libraries/chain/block_schedule.cpp
+1
-0
libraries/chain/chain_controller.cpp
libraries/chain/chain_controller.cpp
+5
-4
libraries/chain/include/eos/chain/block_schedule.hpp
libraries/chain/include/eos/chain/block_schedule.hpp
+2
-1
libraries/chain/include/eos/chain/chain_controller.hpp
libraries/chain/include/eos/chain/chain_controller.hpp
+5
-2
plugins/producer_plugin/producer_plugin.cpp
plugins/producer_plugin/producer_plugin.cpp
+2
-0
tests/common/database_fixture.cpp
tests/common/database_fixture.cpp
+1
-1
未找到文件。
libraries/chain/block_schedule.cpp
浏览文件 @
e3f22656
...
...
@@ -22,6 +22,7 @@
* THE SOFTWARE.
*/
#include <eos/chain/block_schedule.hpp>
#include <eos/chain/block.hpp>
namespace
eos
{
namespace
chain
{
...
...
libraries/chain/chain_controller.cpp
浏览文件 @
e3f22656
...
...
@@ -26,7 +26,6 @@
#include <eos/chain/exceptions.hpp>
#include <eos/chain/block_summary_object.hpp>
#include <eos/chain/block_schedule.hpp>
#include <eos/chain/global_property_object.hpp>
#include <eos/chain/key_value_object.hpp>
#include <eos/chain/action_objects.hpp>
...
...
@@ -263,12 +262,13 @@ signed_block chain_controller::generate_block(
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_conflits */
uint32_t
skip
/* = 0 */
)
{
try
{
return
with_skip_flags
(
skip
,
[
&
](){
auto
b
=
_db
.
with_write_lock
(
[
&
](){
return
_generate_block
(
when
,
producer
,
block_signing_private_key
);
return
_generate_block
(
when
,
producer
,
block_signing_private_key
,
scheduler
);
});
push_block
(
b
,
skip
);
return
b
;
...
...
@@ -278,7 +278,8 @@ signed_block chain_controller::generate_block(
signed_block
chain_controller
::
_generate_block
(
fc
::
time_point_sec
when
,
const
AccountName
&
producer
,
const
fc
::
ecc
::
private_key
&
block_signing_private_key
const
fc
::
ecc
::
private_key
&
block_signing_private_key
,
block_schedule
::
factory
scheduler
)
{
try
{
...
...
@@ -306,7 +307,7 @@ signed_block chain_controller::_generate_block(
pending
.
emplace_back
(
pending_transaction
{
&
st
});
}
auto
schedule
=
block_schedule
::
by_threading_conflicts
(
pending
,
get_global_properties
());
auto
schedule
=
scheduler
(
pending
,
get_global_properties
());
//
// The following code throws away existing pending_tx_session and
...
...
libraries/chain/include/eos/chain/block_schedule.hpp
浏览文件 @
e3f22656
...
...
@@ -22,7 +22,7 @@
* THE SOFTWARE.
*/
#pragma once
#include <eos/chain/
chain_controller
.hpp>
#include <eos/chain/
global_property_object
.hpp>
#include <eos/chain/transaction.hpp>
namespace
eos
{
namespace
chain
{
...
...
@@ -40,6 +40,7 @@ namespace eos { namespace chain {
*/
struct
block_schedule
{
typedef
block_schedule
(
*
factory
)(
vector
<
pending_transaction
>
const
&
,
const
global_property_object
&
);
vector
<
cycle_schedule
>
cycles
;
// Algorithms
...
...
libraries/chain/include/eos/chain/chain_controller.hpp
浏览文件 @
e3f22656
...
...
@@ -32,6 +32,7 @@
#include <boost/signals2/signal.hpp>
#include <eos/chain/block_schedule.hpp>
#include <eos/chain/protocol.hpp>
#include <eos/chain/message_handling_contexts.hpp>
#include <eos/chain/chain_initializer_interface.hpp>
...
...
@@ -152,12 +153,14 @@ namespace eos { namespace chain {
fc
::
time_point_sec
when
,
const
AccountName
&
producer
,
const
fc
::
ecc
::
private_key
&
block_signing_private_key
,
uint32_t
skip
block_schedule
::
factory
scheduler
=
block_schedule
::
by_threading_conflicts
,
uint32_t
skip
=
skip_nothing
);
signed_block
_generate_block
(
fc
::
time_point_sec
when
,
const
AccountName
&
producer
,
const
fc
::
ecc
::
private_key
&
block_signing_private_key
const
fc
::
ecc
::
private_key
&
block_signing_private_key
,
block_schedule
::
factory
scheduler
);
...
...
plugins/producer_plugin/producer_plugin.cpp
浏览文件 @
e3f22656
...
...
@@ -54,6 +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
;
std
::
map
<
chain
::
public_key_type
,
fc
::
ecc
::
private_key
>
_private_keys
;
std
::
set
<
types
::
AccountName
>
_producers
;
...
...
@@ -301,6 +302,7 @@ block_production_condition::block_production_condition_enum producer_plugin_impl
scheduled_time
,
scheduled_producer
,
private_key_itr
->
second
,
_production_scheduler
,
_production_skip_flags
);
capture
(
"n"
,
block
.
block_num
())(
"t"
,
block
.
timestamp
)(
"c"
,
now
);
...
...
tests/common/database_fixture.cpp
浏览文件 @
e3f22656
...
...
@@ -107,7 +107,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
,
0
);
generate_block
(
get_slot_time
(
slot
),
producer
.
owner
,
private_key
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录