You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
updating fees related docs as per tx fee changes introduced by FLIP 351 (#1603)
* updating fees related docs as per tx fee changes introduced by FLIP 351
* updating the fees table for different type of transactions
* update fee numbers
---------
Co-authored-by: Janez Podhostnik <janez.podhostnik@gmail.com>
@@ -22,73 +22,180 @@ Transaction fee on EVM = surge x [inclusion fee + (execution effort * unit cost)
22
22
```
23
23
24
24
-`Surge' factor` dynamically accounts for network pressure and market conditions.
25
-
-`Inclusion fee` accounts for the resources required to process a transaction due to its core properties (byte size, signatures). This is currently constant at 1E-6 FLOW, but subject to change with community approval.
26
-
-`Execution fee` The fee that accounts for the operational cost of running the transaction script, processing the results, sending results for verification, generating verification receipts, etc. and is calculated as a product of `execution effort units` and the `cost per unit`.
27
-
-`Execution Effort (computation)` is based on transaction type and operations that are called during the execution of a transaction. The weights determine how costly (timeconsuming) each operation is.
28
-
-`Execution Effort Unit Cost` = `2.49E-07 FLOW` (currently constant, but subject to change with community approval)
25
+
-`Inclusion fee` accounts for the resources required to process a transaction due to its core properties (byte size, signatures). This is currently constant at 1E-4 FLOW, but subject to change with community approval.
26
+
-`Execution fee` The fee that accounts for the operational cost of running the transaction script, processing the results, sending results for verification, generating verification receipts, etc. and is calculated as a product of `computation units` and the `cost per unit`.
27
+
-`Execution Effort (measured in computation units)` is based on transaction type and operations that are called during the execution of a transaction. The weights determine how costly (time-consuming) each operation is.
28
+
-`Execution Effort Unit Cost` = `4E-05 FLOW` (currently constant, but subject to change with community approval)
29
29
30
30
<h3>Calculation of Execution Effort</h3>
31
31
32
32
```
33
33
Execution Effort (computation) =
34
-
0.00478 * function_or_loop_call +
35
-
0.00246 * GetValue +
36
-
0.00234 * SetValue +
37
-
8.65988 * CreateAccount +
38
-
EVMGasUsageCost * EVMGasUsage
34
+
3.271E+01 * create_account +
35
+
2.348E+01 * blsverify_pop +
36
+
7.408E+00 * get_account_balance +
37
+
6.145E+00 * blsaggregate_public_keys +
38
+
6.059E+00 * get_storage_capacity +
39
+
5.726E+00 * get_account_available_balance +
40
+
5.637E+00 * update_account_contract_code +
41
+
4.964E+00 * blsaggregate_signatures +
42
+
1.152E+00 * generate_account_local_id +
43
+
5.000E-01 * get_account_contract_names +
44
+
3.878E-01 * get_storage_used +
45
+
3.770E-01 * account_keys_count +
46
+
2.346E-01 * allocate_slab_index +
47
+
1.348E-01 * atree_map_get +
48
+
1.125E-01 * atree_map_remove +
49
+
6.659E-02 * create_array_value +
50
+
5.826E-02 * create_dictionary_value +
51
+
5.579E-02 * atree_map_set +
52
+
5.573E-02 * atree_array_insert +
53
+
5.074E-02 * atree_map_read_iteration +
54
+
4.442E-02 * encode_event +
55
+
3.598E-02 * transfer_composite_value +
56
+
2.910E-02 * atree_array_append +
57
+
2.701E-02 * statement +
58
+
2.650E-02 * atree_array_set +
59
+
2.135E-02 * function_invocation +
60
+
1.846E-02 * atree_map_pop_iteration +
61
+
1.123E-02 * atree_array_pop_iteration +
62
+
7.874E-03 * rlpdecoding +
63
+
4.242E-03 * graphemes_iteration +
64
+
3.922E-03 * ufix_parse +
65
+
3.403E-03 * fix_parse +
66
+
2.731E-03 * loop +
67
+
2.701E-03 * atree_array_batch_construction +
68
+
1.907E-03 * transfer_dictionary_value +
69
+
1.053E-03 * big_int_parse +
70
+
7.324E-04 * transfer_array_value +
71
+
7.324E-04 * set_value +
72
+
4.730E-04 * uint_parse +
73
+
4.272E-04 * int_parse +
74
+
3.510E-04 * get_value +
75
+
7.629E-05 * string_to_lower +
76
+
4.578E-05 * evmgas_usage
39
77
```
40
78
41
79
where
42
80
43
81
```
44
-
`EVMGasUsage` is reported by EVM as the cost in gas for executing the transaction within the EVM, for instance, 21K gas for a simple send transaction.
45
-
```
46
-
47
-
```
48
-
`EVMGasUsageCost` - The ratio that converts EVM gas into Flow compute units (execution effort) is currently set at `1/5000` but subject to revision by community approval
82
+
`evmgas_usage` is reported by EVM as the cost in gas for executing the transaction within the EVM, for instance, 21K gas for a simple send transaction.
49
83
```
50
84
51
85
</details>
52
86
53
87
<details>
54
88
<summary><h2>Demonstration of Transaction Fees on EVM</h2></summary>
55
89
56
-
Assume a simple NFT transfer transaction that makes 31 cadence loop calls, reads 5668 bytes from the storage register, and saves 1668 bytes to the storage register.
**Note**: Please be aware that this example serves solely for illustrative purposes to elucidate the calculations. Actual transaction fees may differ due to various factors, including the byte size of the transaction.
0 commit comments