diff --git a/neps/nep-0488.md b/neps/nep-0488.md index decd4eea4..d580d0356 100644 --- a/neps/nep-0488.md +++ b/neps/nep-0488.md @@ -737,7 +737,7 @@ Note: we take as input any points on the curve, not only from $G_1$ The algorithm has a linear complexity of the number of elements. The gas can be calculated by the next formula ```rust -let k = (input_bytes + item_size - 1)/item_size +let k = input_bytes / item_size let gas_consumed = A + B * k ``` @@ -834,7 +834,7 @@ the ERROR_CODE is returned. The algorithm has a linear complexity of the number of elements. The gas can be calculated by the next formula ```rust -let k = (input_bytes + item_size - 1)/item_size +let k = input_bytes / item_size let gas_consumed = A + B * k ``` @@ -921,7 +921,7 @@ the ERROR_CODE is returned. This function should be calculated by Pippenger’s algorithm[^25]. The Complexity of this algorithm is $O(\frac{k}{\log(k)})$. For gas calculation we will use the formula $\frac{k}{\max(\log_2(k), 1)}$ the same way as in the host function for `BN254`[^10]. ```rust -let k = (input_bytes+item_size-1)/item_size; +let k = input_bytes / item_size; let gas_consumed = A + B*k + C * if k > 1 {k / (k as f32).log2().floor()} else {k}; ``` @@ -1026,7 +1026,7 @@ the output is 192 bytes — the one point $\in E'(F_{p^2})$ in decompressed form This function should be calculated by Pippenger’s algorithm[^25]. The Complexity of this algorithm is $O(\frac{k}{\log(k)})$. For gas calculation we will use the formula $\frac{k}{\max(\log_2(k), 1)}$ the same way as in the host function for `BN254`[^10]. ```rust -let k = (input_bytes+item_size-1)/item_size; +let k = input_bytes / item_size; let gas_consumed = A + B*k + C * if k > 1 {k / (k as f32).log2().floor()} else {k}; ``` @@ -1254,7 +1254,7 @@ For empty input it returns ERROR_CODE = 0. The algorithm has a linear complexity of the number of elements. The gas can be calculated by the next formula ```rust -let k = (input_bytes + item_size - 1)/item_size +let k = input_bytes / item_size let gas_consumed = A + B * k ``` @@ -1331,7 +1331,7 @@ the ERROR_CODE is returned. ***Gas Estimation:*** The algorithm has a linear complexity of the number of elements. The gas can be calculated by the next formula ```rust -let k = (input_bytes + item_size - 1)/item_size +let k = input_bytes / item_size let gas_consumed = A + B * k ```