Closed chessai closed 5 months ago
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.
pact> (hyperlane-message-id 0)
<interactive>:0:0:Error: Invalid arguments, received [0] for x:object:* -> string
at <interactive>:0:0: (hyperlane-message-id 0)
pact> (env-exec-config ['DisableVerifiers])
["DisableVerifiers"]
pact> (hyperlane-message-id 0)
<interactive>:0:0:Error: Cannot resolve hyperlane-message-id
Added
Tests
Unit test, Haskell:
tests/HyperlaneSpec.hs
HyperlaneSpec hyperlane hyperlane-message-id computes the correct message id [✔]
cabal run test:hspec -- --match="pact tests"
PactTestsSpec pact tests ... tests/pact/hyperlane-message-id.repl [✔]
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: