Skip to content

Commit

Permalink
Undo
Browse files Browse the repository at this point in the history
  • Loading branch information
pgherveou committed May 3, 2024
1 parent f4d65f6 commit 9ceb549
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
13 changes: 0 additions & 13 deletions substrate/frame/contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,6 @@ calls are reverted. Assuming correct error handling by contract A, A's other cal

One `ref_time` `Weight` is defined as one picosecond of execution time on the runtime's reference machine.

#### Schedule

The `Schedule` is where, among other things, the cost of every action a contract can do is defined. These costs are derived
from the benchmarks of this pallet. Instead of looking at the raw benchmark results it is advised to look at the `Schedule`
if one wants to manually inspect the performance characteristics. The `Schedule` can be printed like this:

```sh
RUST_LOG=runtime::contracts=info cargo run --features runtime-benchmarks --bin substrate-node -- benchmark pallet --extra -p pallet_contracts -e print_schedule
```

Please note that the `Schedule` will be printed multiple times. This is because we are (ab)using a benchmark to print
the struct.

### Revert Behaviour

Contract call failures are not cascading. When failures occur in a sub-call, they do not "bubble up", and the call will
Expand Down
10 changes: 5 additions & 5 deletions substrate/frame/contracts/src/benchmarking/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ mod benchmarks {
let result;
#[block]
{
result = BenchEnv::seal1_terminate(&mut runtime, &mut memory, 0)
result = BenchEnv::seal1_terminate(&mut runtime, &mut memory, 0);
}

assert!(matches!(result, Err(crate::wasm::TrapReason::Termination)));
Expand Down Expand Up @@ -941,7 +941,7 @@ mod benchmarks {
subject_len, // subject_len
subject_len + 4, // output_ptr
0, // output_len_ptr
)
);
}

assert_ok!(result);
Expand Down Expand Up @@ -975,7 +975,7 @@ mod benchmarks {
topics_len, // topics_len
4 + topics_len, // data_ptr
0, // data_len
)
);
}

assert_ok!(result);
Expand Down Expand Up @@ -1574,7 +1574,7 @@ mod benchmarks {
result = BenchEnv::seal0_reentrance_count(&mut runtime, &mut memory)
}

assert!(result.unwrap() == 0);
assert_eq!(result.unwrap(), 0);
}

#[benchmark(pov_mode = Measured)]
Expand All @@ -1589,7 +1589,7 @@ mod benchmarks {
result = BenchEnv::seal0_account_reentrance_count(&mut runtime, &mut memory, 0);
}

assert!(result.unwrap() == 0);
assert_eq!(result.unwrap(), 0);
}

#[benchmark(pov_mode = Measured)]
Expand Down

0 comments on commit 9ceb549

Please sign in to comment.