Skip to content

Commit

Permalink
limit bold steps
Browse files Browse the repository at this point in the history
  • Loading branch information
rachel-bousfield committed Feb 3, 2024
1 parent d4e30af commit 50cdb4d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion arbitrator/prover/src/programs/meter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,10 @@ pub fn pricing_v1(op: &Operator, tys: &HashMap<SignatureIndex, FunctionType>) ->
#[rustfmt::skip]
let ink = match op {
op!(Unreachable, Return) => 1,
op!(Nop, Drop) | dot!(I32Const, I64Const) => 1,
op!(Nop) | dot!(I32Const, I64Const) => 1,

op!(Drop) => 9, // could be 1, but using a higher number helps limit the number of ops in BOLD

dot!(Block, Loop) | op!(Else, End) => 1,
dot!(Br, BrIf, If) => 765,
dot!(Select) => 1250, // TODO: improve wasmer codegen
Expand Down
2 changes: 1 addition & 1 deletion arbitrator/prover/src/wavm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ pub fn wasm_to_wavm(
opcode!(Unreachable);
stack = StackState::Unreachable;
},
Nop => opcode!(Nop),
Nop => {},
Block { blockty } => {
scopes.push(Scope::Simple(*blockty, vec![], height_after_block!(blockty)));
}
Expand Down

0 comments on commit 50cdb4d

Please sign in to comment.