Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
f5ed0b4a
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,发现更多精彩内容 >>
提交
f5ed0b4a
编写于
3月 01, 2018
作者:
M
Matt Witherspoon
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
initial work at allowing wasm runtime to be configurable
(not wired up yet)
上级
a276d30d
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
30 addition
and
2 deletion
+30
-2
libraries/chain/include/eosio/chain/chain_controller.hpp
libraries/chain/include/eosio/chain/chain_controller.hpp
+1
-0
libraries/chain/include/eosio/chain/config.hpp
libraries/chain/include/eosio/chain/config.hpp
+3
-0
libraries/chain/include/eosio/chain/wasm_interface.hpp
libraries/chain/include/eosio/chain/wasm_interface.hpp
+4
-1
libraries/chain/wasm_interface.cpp
libraries/chain/wasm_interface.cpp
+11
-0
libraries/chain/webassembly/wavm.cpp
libraries/chain/webassembly/wavm.cpp
+1
-0
plugins/chain_plugin/chain_plugin.cpp
plugins/chain_plugin/chain_plugin.cpp
+10
-1
未找到文件。
libraries/chain/include/eosio/chain/chain_controller.hpp
浏览文件 @
f5ed0b4a
...
...
@@ -77,6 +77,7 @@ namespace eosio { namespace chain {
std
::
vector
<
signal
<
void
(
const
transaction_metadata
&
,
const
packed_transaction
&
)
>::
slot_type
>
on_pending_transaction_callbacks
;
contracts
::
genesis_state_type
genesis
;
runtime_limits
limits
;
wasm_interface
::
vm_type
wasm_runtime
=
config
::
default_wasm_runtime
;
};
explicit
chain_controller
(
const
controller_config
&
cfg
);
...
...
libraries/chain/include/eosio/chain/config.hpp
浏览文件 @
f5ed0b4a
...
...
@@ -4,6 +4,7 @@
*/
#pragma once
#include <eosio/chain/asset.hpp>
#include <eosio/chain/wasm_interface.hpp>
#include <fc/time.hpp>
#pragma GCC diagnostic ignored "-Wunused-variable"
...
...
@@ -64,6 +65,8 @@ const static uint32_t rate_limiting_precision = 1000*1000;
const
static
uint16_t
max_recursion_depth
=
6
;
const
static
eosio
::
chain
::
wasm_interface
::
vm_type
default_wasm_runtime
=
eosio
::
chain
::
wasm_interface
::
vm_type
::
binaryen
;
/**
* The number of sequential blocks produced by a single producer
*/
...
...
libraries/chain/include/eosio/chain/wasm_interface.hpp
浏览文件 @
f5ed0b4a
#pragma once
#include <eosio/chain/exceptions.hpp>
#include <eosio/chain/types.hpp>
namespace
eosio
{
namespace
chain
{
...
...
@@ -123,3 +122,7 @@ namespace eosio { namespace chain {
};
}
}
// eosio::chain
namespace
eosio
{
namespace
chain
{
std
::
istream
&
operator
>>
(
std
::
istream
&
in
,
wasm_interface
::
vm_type
&
runtime
);
}}
\ No newline at end of file
libraries/chain/wasm_interface.cpp
浏览文件 @
f5ed0b4a
...
...
@@ -1614,5 +1614,16 @@ REGISTER_INTRINSICS(db_index_api_key64x64x64_value_index_by_scope_primary, DB_
REGISTER_INTRINSICS
(
db_index_api_key64x64x64_value_index_by_scope_secondary
,
DB_INDEX_METHOD_SEQ
(
secondary_i64i64i64
));
REGISTER_INTRINSICS
(
db_index_api_key64x64x64_value_index_by_scope_tertiary
,
DB_INDEX_METHOD_SEQ
(
tertiary_i64i64i64
));
std
::
istream
&
operator
>>
(
std
::
istream
&
in
,
wasm_interface
::
vm_type
&
runtime
)
{
std
::
string
s
;
in
>>
s
;
if
(
s
==
"wavm"
)
runtime
=
eosio
::
chain
::
wasm_interface
::
vm_type
::
wavm
;
else
if
(
s
==
"binaryen"
)
runtime
=
eosio
::
chain
::
wasm_interface
::
vm_type
::
binaryen
;
else
in
.
setstate
(
std
::
ios_base
::
failbit
);
return
in
;
}
}
}
/// eosio::chain
libraries/chain/webassembly/wavm.cpp
浏览文件 @
f5ed0b4a
#include <eosio/chain/webassembly/wavm.hpp>
#include <eosio/chain/wasm_eosio_constraints.hpp>
#include <eosio/chain/apply_context.hpp>
#include <eosio/chain/exceptions.hpp>
#include "IR/Module.h"
#include "Platform/Platform.h"
...
...
plugins/chain_plugin/chain_plugin.cpp
浏览文件 @
f5ed0b4a
...
...
@@ -10,7 +10,7 @@
#include <eosio/chain/producer_object.hpp>
#include <eosio/chain/config.hpp>
#include <eosio/chain/types.hpp>
#include <eosio/chain/wasm_interface.hpp>
#include <eosio/chain/contracts/chain_initializer.hpp>
#include <eosio/chain/contracts/genesis_state.hpp>
...
...
@@ -27,6 +27,7 @@ namespace eosio {
using
namespace
eosio
;
using
namespace
eosio
::
chain
;
using
namespace
eosio
::
chain
::
config
;
using
vm_type
=
wasm_interface
::
vm_type
;
using
fc
::
flat_map
;
//using txn_msg_rate_limits = chain_controller::txn_msg_rate_limits;
...
...
@@ -49,6 +50,7 @@ public:
uint32_t
max_reversible_block_time_ms
;
uint32_t
max_pending_transaction_time_ms
;
//txn_msg_rate_limits rate_limits;
fc
::
optional
<
vm_type
>
wasm_runtime
;
};
chain_plugin
::
chain_plugin
()
...
...
@@ -69,6 +71,7 @@ void chain_plugin::set_program_options(options_description& cli, options_descrip
"Limits the maximum time (in milliseconds) that a reversible block is allowed to run before being considered invalid"
)
(
"max-pending-transaction-time"
,
bpo
::
value
<
int32_t
>
()
->
default_value
(
-
1
),
"Limits the maximum time (in milliseconds) that is allowed a pushed transaction's code to execute before being considered invalid"
)
(
"wasm-runtime"
,
bpo
::
value
<
eosio
::
chain
::
wasm_interface
::
vm_type
>
(),
"Override default WASM runtime; not supported"
)
#warning TODO: rate limiting
/*("per-authorized-account-transaction-msg-rate-limit-time-frame-sec", bpo::value<uint32_t>()->default_value(default_per_auth_account_time_frame_seconds),
"The time frame, in seconds, that the per-authorized-account-transaction-msg-rate-limit is imposed over.")
...
...
@@ -161,6 +164,9 @@ void chain_plugin::plugin_initialize(const variables_map& options) {
my
->
max_reversible_block_time_ms
=
options
.
at
(
"max-reversible-block-time"
).
as
<
int32_t
>
();
my
->
max_pending_transaction_time_ms
=
options
.
at
(
"max-pending-transaction-time"
).
as
<
int32_t
>
();
if
(
options
.
count
(
"wasm-runtime"
))
my
->
wasm_runtime
=
options
.
at
(
"wasm-runtime"
).
as
<
vm_type
>
();
#warning TODO: Rate Limits
/*my->rate_limits.per_auth_account_time_frame_sec = fc::time_point_sec(options.at("per-authorized-account-transaction-msg-rate-limit-time-frame-sec").as<uint32_t>());
my->rate_limits.per_auth_account = options.at("per-authorized-account-transaction-msg-rate-limit").as<uint32_t>();
...
...
@@ -190,6 +196,9 @@ void chain_plugin::plugin_startup()
my
->
chain_config
->
limits
.
max_push_transaction_us
=
fc
::
milliseconds
(
my
->
max_pending_transaction_time_ms
);
}
if
(
my
->
wasm_runtime
)
my
->
chain_config
->
wasm_runtime
=
*
my
->
wasm_runtime
;
my
->
chain
.
emplace
(
*
my
->
chain_config
);
if
(
!
my
->
readonly
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录