Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
234a03e6
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,发现更多精彩内容 >>
提交
234a03e6
编写于
5月 05, 2018
作者:
A
arhag
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
optimization in check_authorization:
Do not check if a permission level is satisfied more than once.
上级
352500be
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
27 addition
and
10 deletion
+27
-10
libraries/chain/authorization_manager.cpp
libraries/chain/authorization_manager.cpp
+26
-10
libraries/chain/include/eosio/chain/config.hpp
libraries/chain/include/eosio/chain/config.hpp
+1
-0
未找到文件。
libraries/chain/authorization_manager.cpp
浏览文件 @
234a03e6
...
...
@@ -336,6 +336,9 @@ namespace eosio { namespace chain {
fc
::
microseconds
max_delay
;
map
<
permission_level
,
bool
>
permissions_to_satisfy
;
// bool value indicates whether the delay encountered in the check should not contribute to max_delay.
for
(
const
auto
&
act
:
actions
)
{
bool
special_case
=
false
;
bool
ignore_delay
=
false
;
...
...
@@ -383,19 +386,32 @@ namespace eosio { namespace chain {
}
}
//if( should_check_signatures() ) {
if
(
ignore_delay
)
auto
res
=
permissions_to_satisfy
.
emplace
(
declared_auth
,
ignore_delay
);
if
(
!
res
.
second
&&
res
.
first
->
second
)
{
// if the declared_auth was already in the map and without delay tracking specified
res
.
first
->
second
=
ignore_delay
;
}
}
}
// Now verify that all the declared authorizations are satisfied:
// Although this can be made parallel (especially for input transactions) with the optimistic assumption that the
// CPU limit is not reached, because of the CPU limit the protocol must officially specify a sequential algorithm
// for checking the set of declared authorizations.
// The permission_levels are traversed in ascending order, which is:
// ascending order of the actor name with ties broken by ascending order of the permission name.
for
(
const
auto
&
p
:
permissions_to_satisfy
)
{
checktime
(
config
::
base_authority_checker_cpu_per_permission
);
// TODO: this should eventually move into authority_checker instead
if
(
p
.
second
)
checker
.
get_permission_visitor
().
pause_delay_tracking
();
EOS_ASSERT
(
checker
.
satisfied
(
declared_auth
),
tx_missing_sigs
,
EOS_ASSERT
(
checker
.
satisfied
(
p
.
first
),
tx_missing_sigs
,
"transaction declares authority '${auth}', but does not have signatures for it."
,
(
"auth"
,
declared_auth
)
);
if
(
ignore_delay
)
(
"auth"
,
p
.
first
)
);
if
(
p
.
second
)
checker
.
get_permission_visitor
().
resume_delay_tracking
();
//}
}
}
if
(
!
allow_unused_keys
)
{
//&& should_check_signatures() ) {
if
(
!
allow_unused_keys
)
{
EOS_ASSERT
(
checker
.
all_keys_used
(),
tx_irrelevant_sig
,
"transaction bears irrelevant signatures from these keys: ${keys}"
,
(
"keys"
,
checker
.
unused_keys
())
);
...
...
libraries/chain/include/eosio/chain/config.hpp
浏览文件 @
234a03e6
...
...
@@ -84,6 +84,7 @@ const static uint16_t default_max_auth_depth = 6;
const
static
uint32_t
default_max_gen_trx_count
=
16
;
const
static
uint32_t
base_check_authorization_cpu_per_authorization
=
64
;
// TODO: is this reasonable?
const
static
uint32_t
base_authority_checker_cpu_per_permission
=
128
;
// TODO: is this reasonable?
const
static
uint32_t
resource_processing_cpu_overhead_per_billed_account
=
256
;
// TODO: is this reasonable?
const
static
uint32_t
determine_payers_cpu_overhead_per_authorization
=
64
;
// TODO: is this reasonable?
const
static
uint32_t
ram_usage_validation_overhead_per_account
=
64
;
// TODO: is this reasonable?
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录