-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix div by zero in concat
gas model
#1317
Conversation
@@ -224,7 +226,7 @@ instance Pretty GasArgs where | |||
GSelect {} -> "GSelect" | |||
GSortFieldLookup i -> "GSortFieldLookup:" <> pretty i | |||
GConcatenation i j -> "GConcatenation:" <> pretty i <> colon <> pretty j | |||
GTextConcatenation nChars nStrings -> "GTextConcatenation:" <> pretty nChars <> colon <> pretty nStrings | |||
GTextConcatenation nChars nStrings fixupDiv -> "GTextConcatenation:" <> pretty nChars <> colon <> pretty nStrings <> colon <> pretty fixupDiv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assumes changing this Pretty
instance doesn't participate in on-chain computations. I skimmed through the code and found no evidence it does, but worth double-checking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this, @jmcardon ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not. Gas logs are not part of txlog outputs that get hashed.
@@ -826,6 +826,12 @@ d.G3 | |||
(env-gas 0) | |||
(concat strings_1000_2000) | |||
(expect "calling (concat strings_1000_2000)" 151 (env-gas)) | |||
|
|||
;; Test issue #1316 | |||
(expect "concat gassing works on empty list" "" (concat [])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
PR checklist:
cabal run tests
. If they pass locally, docs are generated.pact -t
), make sure pact-lsp is in sync.Additionally, please justify why you should or should not do the following: