Skip to content

Commit

Permalink
Merge branch 'stylus' into print-wavm
Browse files Browse the repository at this point in the history
  • Loading branch information
rachel-bousfield authored Jan 18, 2024
2 parents 60b8cf0 + cb3c6dd commit 3319571
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arbitrator/prover/src/binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,10 @@ impl<'a> WasmBinary<'a> {
}

let table_entries = bin.tables.iter().map(|x| x.initial).saturating_sum();
limit!(8192, table_entries, "table entries");
limit!(4096, table_entries, "table entries");

let elem_entries = bin.elements.iter().map(|x| x.range.len()).saturating_sum();
limit!(4096, elem_entries, "element entries");

let max_len = 512;
macro_rules! too_long {
Expand Down
4 changes: 4 additions & 0 deletions arbitrator/prover/src/programs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,10 @@ impl Module {
let data = bin.datas.iter().map(|x| x.data.len()).saturating_sum() as u64;
pay!(data.saturating_mul(17_376) / 100_000);

// pay for elements
let elems = bin.elements.iter().map(|x| x.range.len()).saturating_sum() as u64;
pay!(elems.saturating_mul(17_376) / 100_000);

// pay for memory
let mem = bin.memories.first().map(|x| x.initial).unwrap_or_default();
pay!(mem.saturating_mul(2217));
Expand Down

0 comments on commit 3319571

Please sign in to comment.