Skip to content

Commit 8bd193e

Browse files
authored
Merge pull request #708 from axone-protocol/fix/logic-gas-limit
2 parents e354a2d + dc1b52e commit 8bd193e

26 files changed

+172
-280
lines changed

docs/predicate/bech32_address_2.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ bech32_address(Address, 'axone15wn30a9z4uc692s0kkx5fp5d4qfr3ac77gvjg4').
4343

4444
``` yaml
4545
height: 42
46-
gas_used: 2222
46+
gas_used: 3876
4747
answer:
4848
has_more: false
4949
variables: ["Address"]
@@ -72,7 +72,7 @@ bech32_address(-(Hrp, Address), 'axone15wn30a9z4uc692s0kkx5fp5d4qfr3ac77gvjg4').
7272

7373
``` yaml
7474
height: 42
75-
gas_used: 2222
75+
gas_used: 3876
7676
answer:
7777
has_more: false
7878
variables: ["Hrp", "Address"]
@@ -102,7 +102,7 @@ bech32_address(-(axone, Address), 'axone15wn30a9z4uc692s0kkx5fp5d4qfr3ac77gvjg4'
102102

103103
``` yaml
104104
height: 42
105-
gas_used: 2222
105+
gas_used: 3876
106106
answer:
107107
has_more: false
108108
variables: ["Address"]
@@ -129,7 +129,7 @@ bech32_address(-('axone', [163,167,23,244,162,175,49,162,170,15,181,141,68,134,1
129129

130130
``` yaml
131131
height: 42
132-
gas_used: 2222
132+
gas_used: 3876
133133
answer:
134134
has_more: false
135135
variables: ["Bech32"]
@@ -162,7 +162,7 @@ axone_addr('axone1p8u47en82gmzfm259y6z93r9qe63l25d858vqu').
162162

163163
``` yaml
164164
height: 42
165-
gas_used: 2222
165+
gas_used: 3876
166166
answer:
167167
has_more: false
168168
results:
@@ -188,7 +188,7 @@ bech32_address(Address, axoneincorrect).
188188

189189
``` yaml
190190
height: 42
191-
gas_used: 2222
191+
gas_used: 3876
192192
answer:
193193
has_more: false
194194
variables: ["Address"]
@@ -215,7 +215,7 @@ bech32_address(-('axone', X), foo(bar)).
215215

216216
``` yaml
217217
height: 42
218-
gas_used: 2222
218+
gas_used: 3876
219219
answer:
220220
has_more: false
221221
variables: ["X"]

docs/predicate/block_height_1.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ block_height(Height).
4444

4545
``` yaml
4646
height: 100
47-
gas_used: 2222
47+
gas_used: 3876
4848
answer:
4949
has_more: false
5050
variables: ["Height"]
@@ -79,7 +79,7 @@ Height > 100.
7979

8080
``` yaml
8181
height: 101
82-
gas_used: 2223
82+
gas_used: 3877
8383
answer:
8484
has_more: false
8585
variables: ["Height"]

docs/predicate/block_time_1.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ block_time(Time).
4444

4545
``` yaml
4646
height: 42
47-
gas_used: 2222
47+
gas_used: 3876
4848
answer:
4949
has_more: false
5050
variables: ["Time"]
@@ -80,7 +80,7 @@ Time > 1709550216.
8080

8181
``` yaml
8282
height: 42
83-
gas_used: 2223
83+
gas_used: 3877
8484
answer:
8585
has_more: false
8686
variables: ["Time"]

docs/predicate/consult_1.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ hello(Who).
6565

6666
``` yaml
6767
height: 42
68-
gas_used: 2224
68+
gas_used: 3878
6969
answer:
7070
has_more: false
7171
variables: ["Who"]
@@ -129,7 +129,7 @@ response: |
129129

130130
``` yaml
131131
height: 42
132-
gas_used: 2223
132+
gas_used: 3877
133133
answer:
134134
has_more: false
135135
variables: ["X"]
@@ -194,7 +194,7 @@ source_file(File).
194194

195195
``` yaml
196196
height: 42
197-
gas_used: 2223
197+
gas_used: 3877
198198
answer:
199199
has_more: false
200200
variables: ["File"]

docs/predicate/current_output_1.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ write_char_to_user_output(x).
6161

6262
``` yaml
6363
height: 42
64-
gas_used: 2241
64+
gas_used: 3976
6565
answer:
6666
has_more: false
6767
variables:
@@ -108,7 +108,7 @@ log_message('Hello world!').
108108

109109
``` yaml
110110
height: 42
111-
gas_used: 2248
111+
gas_used: 4010
112112
answer:
113113
has_more: false
114114
variables:
@@ -155,7 +155,7 @@ log_message('Hello world!').
155155

156156
``` yaml
157157
height: 42
158-
gas_used: 2241
158+
gas_used: 3976
159159
answer:
160160
has_more: false
161161
variables:
@@ -205,7 +205,7 @@ log_message("Hello 🧙!").
205205

206206
``` yaml
207207
height: 42
208-
gas_used: 2255
208+
gas_used: 3990
209209
answer:
210210
has_more: false
211211
variables:

docs/predicate/open_3.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ open(
6262

6363
``` yaml
6464
height: 42
65-
gas_used: 2223
65+
gas_used: 3877
6666
answer:
6767
has_more: false
6868
variables:

docs/predicate/open_4.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ open(URI, read, _, []).
100100

101101
``` yaml
102102
height: 42
103-
gas_used: 2228
103+
gas_used: 3882
104104
answer:
105105
has_more: false
106106
variables: ["URI"]
@@ -152,7 +152,7 @@ read_resource('cosmwasm:storage:axone15ekvz3qdter33mdnk98v8whv5qdr53yusksnfgc08x
152152

153153
``` yaml
154154
height: 42
155-
gas_used: 2224
155+
gas_used: 3878
156156
answer:
157157
has_more: false
158158
variables: ["Chars"]
@@ -202,7 +202,7 @@ read_resource('cosmwasm:storage:axone15ekvz3qdter33mdnk98v8whv5qdr53yusksnfgc08x
202202

203203
``` yaml
204204
height: 42
205-
gas_used: 2224
205+
gas_used: 3878
206206
answer:
207207
has_more: false
208208
variables: ["Chars"]
@@ -229,7 +229,7 @@ open('cosmwasm:storage:axone15ekvz3qdter33mdnk98v8whv5qdr53yusksnfgc08xd26fpdn3t
229229

230230
``` yaml
231231
height: 42
232-
gas_used: 2222
232+
gas_used: 3876
233233
answer:
234234
has_more: false
235235
variables: ["Stream"]
@@ -255,7 +255,7 @@ open('cosmwasm:storage:axone15ekvz3qdter33mdnk98v8whv5qdr53yusksnfgc08xd26fpdn3t
255255

256256
``` yaml
257257
height: 42
258-
gas_used: 2222
258+
gas_used: 3876
259259
answer:
260260
has_more: false
261261
variables: ["Stream"]
@@ -281,7 +281,7 @@ open('cosmwasm:storage:axone15ekvz3qdter33mdnk98v8whv5qdr53yusksnfgc08xd26fpdn3t
281281

282282
``` yaml
283283
height: 42
284-
gas_used: 2222
284+
gas_used: 3876
285285
answer:
286286
has_more: false
287287
variables: ["Stream"]
@@ -306,7 +306,7 @@ open('cosmwasm:storage:axone15ekvz3qdter33mdnk98v8whv5qdr53yusksnfgc08xd26fpdn3t
306306

307307
``` yaml
308308
height: 42
309-
gas_used: 2222
309+
gas_used: 3876
310310
answer:
311311
has_more: false
312312
variables: ["Stream"]

docs/proto/logic.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,12 @@ to submit transactions or make changes to the blockchain's state. It is therefor
182182

183183
To control the cpu and memory usage of the module, the module is limited by several different mechanisms:
184184

185-
- `max_gas`: the maximum amount of gas that can be used to evaluate a query.
186185
- `max_size`: the maximum size of the program that can be evaluated.
187186
- `max_result_count`: the maximum number of results that can be returned by a query.
188187

188+
The existing `query-gas-limit` configuration present in the `app.toml` can be used to constraint gas usage when not used
189+
in the context of a transaction.
190+
189191
Additional limitations are being considered for the future, such as restricting the number of variables that can be
190192
utilized within a query, or limiting the depth of the backtracking algorithm.
191193

@@ -274,7 +276,6 @@ Limits defines the limits of the logic module.
274276

275277
| Field | Type | Label | Description |
276278
| ----- | ---- | ----- | ----------- |
277-
| `max_gas` | [string](#string) | | max_gas specifies the maximum amount of computing power, measured in "gas," that is allowed to be consumed when executing a request by the interpreter. The interpreter calculates the gas consumption based on the number and type of operations that are executed, as well as, in some cases, the complexity of the processed data. nil value remove max gas limitation. |
278279
| `max_size` | [string](#string) | | max_size specifies the maximum size, in bytes, that is accepted for a program. nil value remove size limitation. |
279280
| `max_result_count` | [string](#string) | | max_result_count specifies the maximum number of results that can be requested for a query. nil value remove max result count limitation. |
280281
| `max_user_output_size` | [string](#string) | | max_user_output_size specifies the maximum number of bytes to keep in the user output. If the user output exceeds this size, the interpreter will overwrite the oldest bytes with the new ones to keep the size constant. nil value or 0 value means that no user output is used at all. |

proto/logic/docs.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,11 @@ description: |
178178
179179
To control the cpu and memory usage of the module, the module is limited by several different mechanisms:
180180
181-
- `max_gas`: the maximum amount of gas that can be used to evaluate a query.
182181
- `max_size`: the maximum size of the program that can be evaluated.
183182
- `max_result_count`: the maximum number of results that can be returned by a query.
184183
184+
The existing `query-gas-limit` configuration present in the `app.toml` can be used to constraint gas usage when not used
185+
in the context of a transaction.
186+
185187
Additional limitations are being considered for the future, such as restricting the number of variables that can be
186188
utilized within a query, or limiting the depth of the backtracking algorithm.

proto/logic/v1beta2/params.proto

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,6 @@ message Params {
3535
message Limits {
3636
option (gogoproto.goproto_stringer) = true;
3737

38-
// max_gas specifies the maximum amount of computing power, measured in "gas," that is allowed to be consumed when
39-
// executing a request by the interpreter. The interpreter calculates the gas consumption based on the number and type
40-
// of operations that are executed, as well as, in some cases, the complexity of the processed data.
41-
// nil value remove max gas limitation.
42-
string max_gas = 1 [
43-
(gogoproto.moretags) = "yaml:\"max_gas\",omitempty",
44-
(gogoproto.customtype) = "cosmossdk.io/math.Uint",
45-
(gogoproto.nullable) = true
46-
];
47-
4838
// max_size specifies the maximum size, in bytes, that is accepted for a program.
4939
// nil value remove size limitation.
5040
string max_size = 3 [

0 commit comments

Comments
 (0)