-
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
add hyperlane-message-id native #1335
Conversation
pact.cabal
Outdated
@@ -80,6 +80,7 @@ library | |||
-Wincomplete-record-updates | |||
-Wincomplete-uni-patterns | |||
-Wredundant-constraints | |||
-Wno-missed-extra-shared-lib |
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.
Quoting Austin in his PR to chainweb-node:
When running Template Haskell, GHC sees that some code it loads has dependent modules that also have a dependency on the zlib shared object via an extra-libraries clause; GHC can't find or load this module, issuing a warning, but it doesn't matter because the Template Haskell code doesn't actually use zlib despite having a transitive dependency on it.
Silence this warning, as it's extremely annoying to see while working on any files that use Template Haskell for any purposes e.g. deriving lenses.
I have been getting this warning on chainweb-node and pact for a while now.
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 needs a change in Pact.Interpreter
to disable the new native until Pact 4.11, similar to other natives that are only enabled by a fork.
Added |
Tests
Unit test, Haskell:
tests/HyperlaneSpec.hs
Repl test, Pact:
tests/pact/hyperlane-message-id.repl
Gas Benchmark
Gas Benchmark Code
Gas Benchmark Results
Going off of these numbers, assuming 1 milligas is 2.5ns, that means our cost is roughly
1120.8 + 0.4726 * byte_length(x)
, wherex
is theTokenMessage
recipient
. To avoid rounding errors due to the small cost per byte, we can cost this per 100 bytes. So ultimately, the proposed cost (in milligas) is:The Milligas constant
1121
in practise cannot be included indefaultGasTable
, which only contains Gas, not Milligas. We should round up here, so instead of 1 Gas, this is 2 Gas.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: