more dos protection (#8104)

This commit is contained in:
Nikolay Volf
2018-03-14 15:27:56 +03:00
committed by GitHub
parent 113c35af0a
commit 1bad20ae38
4 changed files with 42 additions and 24 deletions

View File

@@ -135,6 +135,8 @@ pub struct WasmCosts {
pub initial_mem: u32,
/// Grow memory cost, per page (64kb)
pub grow_mem: u32,
/// Memory copy cost, per byte
pub memcpy: u32,
/// Max stack height (native WebAssembly stack limiter)
pub max_stack_height: u32,
/// Cost of wasm opcode is calculated as TABLE_ENTRY_COST * `opcodes_mul` / `opcodes_div`
@@ -154,6 +156,7 @@ impl Default for WasmCosts {
static_address: 40,
initial_mem: 4096,
grow_mem: 8192,
memcpy: 1,
max_stack_height: 64*1024,
opcodes_mul: 3,
opcodes_div: 8,