Skip to content

Commit

Permalink
Adjust gas costs down
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcardon committed Oct 22, 2024
1 parent 4a655db commit a8801eb
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 127 deletions.
194 changes: 97 additions & 97 deletions pact-tests/gas-goldens/builtinGas.golden
Original file line number Diff line number Diff line change
@@ -1,124 +1,124 @@
!=: 401
!=: 201
&: 250
*: 227
+: 230
-: 230
/: 227
<: 464
<=: 464
=: 401
>: 464
>=: 464
^: 968
abs: 200
acquire-module-admin: 297894
*: 127
+: 130
-: 130
/: 127
<: 264
<=: 264
=: 201
>: 264
>=: 264
^: 868
abs: 100
acquire-module-admin: 234194
add-time: 750
and?: 1128
at: 906
and?: 628
at: 706
base64-decode: 331
base64-encode: 311
bind: 677
ceiling: 400
bind: 477
ceiling: 200
chain-data: 500
compose-capability: 514500
compose: 4460
concat: 920
cond: 1202
contains: 605
continue: 441250
create-capability-guard: 227850
create-capability-pact-guard: 246800
create-module-guard: 188300
create-pact-guard: 210050
create-principal: 2302
create-table: 466600
compose-capability: 390200
compose: 2760
concat: 820
cond: 602
contains: 405
continue: 312950
create-capability-guard: 173950
create-capability-pact-guard: 184700
create-module-guard: 142900
create-pact-guard: 156050
create-principal: 2002
create-table: 423300
days: 278
dec: 200
define-keyset: 8404
define-namespace: 44212
describe-keyset: 108404
describe-module: 262700
describe-namespace: 150124
describe-table: 566600
dec: 100
define-keyset: 6804
define-namespace: 37212
describe-keyset: 106804
describe-module: 224100
describe-namespace: 140174
describe-table: 523300
diff-time: 1414
distinct: 3176
drop: 1400
emit-event: 263650
enforce-guard: 3566
enforce-keyset: 3566
distinct: 2176
drop: 1000
emit-event: 200350
enforce-guard: 3166
enforce-keyset: 3166
enforce-verifier: 10150
enumerate: 824
enumerate: 524
exp: 4534
filter: 4460
floor: 400
fold-db: 40525850
fold: 1490
filter: 2760
floor: 200
fold-db: 40453150
fold: 1090
format-time: 1041
format: 2000
hash: 500
format: 1900
hash: 300
hours: 277
hyperlane-decode-token-message: 2175
hyperlane-encode-token-message: 2475
hyperlane-message-id: 2743
identity: 200
insert: 525650
install-capability: 670489
int-to-str: 1000
identity: 100
insert: 452950
install-capability: 505689
int-to-str: 800
is-charset: 1788
is-principal: 797
keys: 40525650
keyset-ref-guard: 10425
length: 1101
is-principal: 597
keys: 40452950
keyset-ref-guard: 8825
length: 801
list-modules: 100000
ln: 2016
log: 2090
make-list: 225
map: 1715
make-list: 125
map: 1315
minutes: 276
mod: 200
namespace: 44224
negate: 200
not: 664
not?: 664
or?: 664
pact-id: 225950
pairing-check: 12009033
mod: 100
namespace: 37224
negate: 100
not: 364
not?: 364
or?: 364
pact-id: 169750
pairing-check: 11063933
parse-time: 602
point-add: 5600
point-add: 5500
poseidon-hash-hack-a-chain: 6393700
read-decimal: 503
read-integer: 503
read-keyset: 8808
read-msg: 503
read-string: 503
read: 534550
remove: 460
require-capability: 402750
resume: 515531
reverse: 800
round: 400
scalar-mult: 360400
select: 40525800
shift: 1286
show: 1400
sort: 1400
read-decimal: 303
read-integer: 303
read-keyset: 7008
read-msg: 303
read-string: 303
read: 457650
remove: 360
require-capability: 304750
resume: 380331
reverse: 700
round: 200
scalar-mult: 360300
select: 40453100
shift: 886
show: 1300
sort: 1200
sqrt: 2022
static-redeploy: 298900
str-to-int: 708
static-redeploy: 199200
str-to-int: 408
str-to-list: 751
take: 2200
take: 1800
time: 500
tx-hash: 200
typeof-principal: 997
typeof: 200
update: 584750
validate-principal: 4540
where: 2340
with-default-read: 540016
with-read: 534833
write: 525650
tx-hash: 100
typeof-principal: 797
typeof: 100
update: 482650
validate-principal: 3940
where: 1640
with-default-read: 460916
with-read: 457833
write: 452950
xor: 500
yield: 328150
zip: 4920
yield: 247650
zip: 4320
|: 500
~: 250
12 changes: 6 additions & 6 deletions pact-tests/legacy-serial-tests/coin-v5/coin-v5.repl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
(env-gaslog)
(expect
"Gas cost of coin contract account creation"
69 (env-gas))
36 (env-gas))

(create-account 'doug (read-keyset 'doug))

Expand Down Expand Up @@ -91,7 +91,7 @@
(env-gaslog)
(expect
"Gas cost of querying an account's balance"
12 (env-gas))
6 (env-gas))

; account information checks out for new accounts
(env-gas 0) (env-gaslog)
Expand All @@ -102,7 +102,7 @@
(env-gaslog)
(expect
"Gas cost of querying the details of an account"
13 (env-gas))
7 (env-gas))

(commit-tx)

Expand All @@ -128,7 +128,7 @@
(env-gaslog)
(expect
"Gas cost of testing the DEBIT capability"
14 (env-gas))
8 (env-gas))

; debit tests
(expect-failure
Expand Down Expand Up @@ -396,7 +396,7 @@
(env-gaslog)
(expect
"Gas cost of transfer"
185 (env-gas))
99 (env-gas))

(expect-failure "emily->doug capability used up"
"TRANSFER exceeded"
Expand Down Expand Up @@ -433,7 +433,7 @@
(transfer-create 'doug 'will (read-keyset 'will) 1.0))
(env-gaslog)
(expect
"Gas cost of transfer-create" 171 (env-gas))
"Gas cost of transfer-create" 93 (env-gas))

(expect
"doug now has 0.4 coins"
Expand Down
16 changes: 8 additions & 8 deletions pact-tests/pact-tests/coin-v1.repl
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
(env-gaslog)
(expect
"Gas cost of loading fungible contract"
844 (env-gas))
657 (env-gas))

(env-gas 0) (env-gaslog)
(load "coin-v1/coin.pact")
(env-gaslog)
(expect
"Gas cost of loading coin contract"
16389 (env-gas))
12562 (env-gas))
(env-gas 0)
(commit-tx)

Expand Down Expand Up @@ -50,7 +50,7 @@
(env-gaslog)
(expect
"Gas cost of coin contract account creation"
65 (env-gas))
33 (env-gas))

(create-account 'doug (read-keyset 'doug))

Expand Down Expand Up @@ -90,7 +90,7 @@
(env-gaslog)
(expect
"Gas cost of querying an account's balance"
12 (env-gas))
6 (env-gas))

; account information checks out for new accounts
(env-gas 0) (env-gaslog)
Expand All @@ -101,7 +101,7 @@
(env-gaslog)
(expect
"Gas cost of querying the details of an account"
13 (env-gas))
7 (env-gas))

(commit-tx)

Expand All @@ -127,7 +127,7 @@
(env-gaslog)
(expect
"Gas cost of testing the DEBIT capability"
14 (env-gas))
8 (env-gas))

; debit tests
(expect-failure
Expand Down Expand Up @@ -395,7 +395,7 @@
(env-gaslog)
(expect
"Gas cost of transfer"
185 (env-gas))
99 (env-gas))

(expect-failure "emily->doug capability used up"
"TRANSFER exceeded"
Expand Down Expand Up @@ -432,7 +432,7 @@
(transfer-create 'doug 'will (read-keyset 'will) 1.0))
(env-gaslog)
(expect
"Gas cost of transfer-create" 168 (env-gas))
"Gas cost of transfer-create" 90 (env-gas))

(expect
"doug now has 0.4 coins"
Expand Down
Loading

0 comments on commit a8801eb

Please sign in to comment.