Skip to content

Commit

Permalink
Minor updates to CAP-0046-10 (#1400)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmkozh authored Sep 21, 2023
1 parent 22afaf6 commit 59f99ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/cap-0046-10.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ During runtime, whenever a component is hit, the meter is incremented by `y = ax
To obtain the parameters, we isolate the component and set up a benchmark sandbox around it with profiling enabled (e.g. `perf_event` or `rusage`). We then call it repeatedly with varying input size, measure and record the resource output for each input size. Finally we fit a linear curve and extract the parameters.

### Cost parameters
The result of calibration for per resource type is a set of cost parameters of size `C x 2`, where `C` is the number of cost types. The cost parameters per resource type form a `ConfigSettingEntry`.
The result of calibration for per resource type is a set of `C` cost parameters containing `a` and `b` coefficients for each input type. All the cost parameters per resource type are stored in a `ConfigSettingEntry`.

### The budget
The budget for each resource type is a `ConfigSettingEntry` that is determined in consensus by the validators. The budget reflects the ledger processing capacity in accordance to the requirements in the [Requirements](#requirements) section. We can start with an initial `cpu_insns` budget of 2'500'000 and `mem_bytes` of 2MiB.
The budget for each resource type is a `ConfigSettingEntry` that is determined in consensus by the validators. The budget reflects the ledger processing capacity in accordance to the requirements in the [Requirements](#requirements) section. Minimum budget for `cpu_insns` budget is 2'500'000 and for `mem_bytes` is 2MB.

At every metering charge, the cumulative resource consumption will be compared with the budget, and if exceeded, will result in a `SCEC_EXCEEDED_LIMIT` host error.

Expand Down

0 comments on commit 59f99ba

Please sign in to comment.