Skip to content

Commit

Permalink
Pact 4.6.0 Release Prep (#1128)
Browse files Browse the repository at this point in the history
* update docs and doc builder

* update warnings pr

* Update changelog for DisablePact46 flag (TODO: pr #)

* update changelog for new contrib + merge master

* update zk natives docs

* update for zk

* spelling
  • Loading branch information
emilypi authored Feb 8, 2023
1 parent 6bf5477 commit 842fbc4
Show file tree
Hide file tree
Showing 6 changed files with 141 additions and 49 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
4.6.0
---
* Add `DisablePact46` execution flag (#TODO)
* Add Zero Knowledge native operations (#1052)
* Add deprecation warning system (#1127)
* Build support for Nix flakes (#1083)
* Passage of time simulation in local pact server build (#1082)
* Fixed parsing failure message for Public Keys (#1097)
* `print` native now pretty prints output using term pretty printing (#1106)
* Typechecker:
- now handles all const value types (#1116)
- inlines mock dynamic references (#1120)

* Formal Verification:
- Prevent usage of `result` fixed binding in `defpact` verification. (#1113)
- Warning added for invaliding models when decimals are too high a
precision (#1113)
- Typechecker now correctly infers function type arguments (#1112)
- Added debug flag to `verify` native, allowing outputs to be directed to
SMTLib file on a per-module basis. (#1122)
- Add shim for `select` in FV (#1090)

Thanks to everyone for their contributions, especially new contributors @qooboodoop and @omahs, and welcome to our newest Pact team member, @rsoeldner!.

4.4.1
---
* Export `ApiReq` constituent data structures (#1055)
Expand Down
2 changes: 1 addition & 1 deletion docs/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

# --- Jump into Nix Shell --- #
nix-shell --pure -p python3 python37Packages.sphinx python37Packages.sphinx_rtd_theme pandoc perl --run "./work.sh"
nix-shell --pure -p python3 python38Packages.sphinx python38Packages.sphinx_rtd_theme pandoc perl --run "./work.sh"
2 changes: 1 addition & 1 deletion docs/en/pact-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ Return ID if called during current pact execution, failing if not.
Obtain current pact build version.
```lisp
pact> (pact-version)
"4.4.1"
"4.6.0"
```

Top level only: this function will fail if used in module code.
Expand Down
155 changes: 111 additions & 44 deletions docs/en/pact-functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ Obtain current pact build version.
.. code:: lisp
pact> (pact-version)
"4.4"
"4.6.0"
Top level only: this function will fail if used in module code.

Expand Down Expand Up @@ -846,9 +846,9 @@ by the ordering of keys.

.. code:: lisp
(let*
(let*
((qry (lambda (k obj) true)) ;; select all rows
(f (lambda (x) [(at 'firstName x), (at 'b x)]))
(f (lambda (k obj) [(at 'firstName obj), (at 'b obj)]))
)
(fold-db people (qry) (f))
)
Expand Down Expand Up @@ -1727,34 +1727,6 @@ in INNER-CAP being granted in the scope of OUTER-BODY.
(compose-capability (TRANSFER src dest))
create-module-guard
~~~~~~~~~~~~~~~~~~~

*name* ``string`` *→* ``guard``
Defines a guard by NAME that enforces the current module admin
predicate.

create-pact-guard
~~~~~~~~~~~~~~~~~

*name* ``string`` *→* ``guard``
Defines a guard predicate by NAME that captures the results of
‘pact-id’. At enforcement time, the success condition is that at that
time ‘pact-id’ must return the same value. In effect this ensures that
the guard will only succeed within the multi-transaction identified by
the pact id.

create-user-guard
~~~~~~~~~~~~~~~~~

*closure* ``-> bool`` *→* ``guard``
Defines a custom guard CLOSURE whose arguments are strictly evaluated at
definition time, to be supplied to indicated function at enforcement
time.

emit-event
~~~~~~~~~~

Expand Down Expand Up @@ -1832,16 +1804,6 @@ one installed with this function.
(install-capability (PAY "alice" "bob" 10.0))
keyset-ref-guard
~~~~~~~~~~~~~~~~

*keyset-ref* ``string`` *→* ``guard``
Creates a guard for the keyset registered as KEYSET-REF with
‘define-keyset’. Concrete keysets are themselves guard types; this
function is specifically to store references alongside other guards in
the database, etc.

require-capability
~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -1938,6 +1900,48 @@ are base-16 strings of length 32.
Guards
------

create-capability-guard
~~~~~~~~~~~~~~~~~~~~~~~

*capability* ``-> bool`` *→* ``guard``
Creates a guard that will enforce that CAPABILITY is acquired.

.. code:: lisp
(create-capability-guard (BANK_DEBIT 10.0))
create-capability-pact-guard
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*capability* ``-> bool`` *→* ``guard``
Creates a guard that will enforce that CAPABILITY is acquired and that
the currently-executing defpact is operational.

.. code:: lisp
(create-capability-pact-guard (ESCROW owner))
create-module-guard
~~~~~~~~~~~~~~~~~~~

*name* ``string`` *→* ``guard``
Defines a guard by NAME that enforces the current module admin
predicate.

create-pact-guard
~~~~~~~~~~~~~~~~~

*name* ``string`` *→* ``guard``
Defines a guard predicate by NAME that captures the results of
‘pact-id’. At enforcement time, the success condition is that at that
time ‘pact-id’ must return the same value. In effect this ensures that
the guard will only succeed within the multi-transaction identified by
the pact id.

create-principal
~~~~~~~~~~~~~~~~

Expand All @@ -1953,6 +1957,15 @@ Create a principal which unambiguously identifies GUARD.
(create-principal (create-user-guard 'user-guard))
(create-principal (create-pact-guard 'pact-guard))
create-user-guard
~~~~~~~~~~~~~~~~~

*closure* ``-> bool`` *→* ``guard``
Defines a custom guard CLOSURE whose arguments are strictly evaluated at
definition time, to be supplied to indicated function at enforcement
time.

is-principal
~~~~~~~~~~~~

Expand All @@ -1965,6 +1978,16 @@ proving validity.
(enforce (is-principal 'k:462e97a099987f55f6a2b52e7bfd52a36b4b5b470fed0816a3d9b26f9450ba69) "Invalid account structure: non-principal account")
keyset-ref-guard
~~~~~~~~~~~~~~~~

*keyset-ref* ``string`` *→* ``guard``
Creates a guard for the keyset registered as KEYSET-REF with
‘define-keyset’. Concrete keysets are themselves guard types; this
function is specifically to store references alongside other guards in
the database, etc.

typeof-principal
~~~~~~~~~~~~~~~~

Expand All @@ -1988,6 +2011,44 @@ Validate that PRINCIPAL unambiguously identifies GUARD.
(enforce (validate-principal (read-keyset 'keyset) account) "Invalid account ID")
.. _Zk:

Zk
--

pairing-check
~~~~~~~~~~~~~

*points-g1* ``[<a>]`` *points-g2* ``[<b>]`` *→* ``bool``
Perform pairing and final exponentiation points in G1 and G2 in BN254,
check if the result is 1

point-add
~~~~~~~~~

*type* ``string`` *point1* ``<a>`` *point2* ``<a>`` *→* ``<a>``
Add two points together that lie on the curve BN254. Point addition
either in Fq or in Fq2

.. code:: lisp
pact> (point-add 'g1 {'x: 1, 'y: 2} {'x: 1, 'y: 2})
{"x": 1368015179489954701390400359078579693043519447331113978918064868415326638035,"y": 9918110051302171585080402603319702774565515993150576347155970296011118125764}
scalar-mult
~~~~~~~~~~~

*type* ``string`` *point1* ``<a>`` *scalar* ``integer`` *→* ``<a>``
Multiply a point that lies on the curve BN254 by an integer value

.. code:: lisp
pact> (scalar-mult 'g1 {'x: 1, 'y: 2} 2)
{"x": 1368015179489954701390400359078579693043519447331113978918064868415326638035,"y": 9918110051302171585080402603319702774565515993150576347155970296011118125764}
.. _repl-lib:

REPL-only functions
Expand Down Expand Up @@ -2149,7 +2210,7 @@ env-exec-config
*→* ``[string]``
Queries, or with arguments, sets execution config flags. Valid flags:
[“AllowReadInLocal”,“DisableHistoryInTransactionalMode”,“DisableInlineMemCheck”,“DisableModuleInstall”,“DisablePact40”,“DisablePact420”,“DisablePact43”,“DisablePact431”,“DisablePact44”,“DisablePactEvents”,“EnforceKeyFormats”,“OldReadOnlyBehavior”,“PreserveModuleIfacesBug”,“PreserveModuleNameBug”,“PreserveNsModuleInstallBug”,“PreserveShowDefs”]
[“AllowReadInLocal”,“DisableHistoryInTransactionalMode”,“DisableInlineMemCheck”,“DisableModuleInstall”,“DisableNewTrans”,“DisablePact40”,“DisablePact420”,“DisablePact43”,“DisablePact431”,“DisablePact44”,“DisablePact45”,“DisablePact46”,“DisablePactEvents”,“EnforceKeyFormats”,“OldReadOnlyBehavior”,“PreserveModuleIfacesBug”,“PreserveModuleNameBug”,“PreserveNsModuleInstallBug”,“PreserveShowDefs”]

.. code:: lisp
Expand Down Expand Up @@ -2427,9 +2488,15 @@ Typecheck MODULE, optionally enabling DEBUG output.
verify
~~~~~~

*module* ``string`` *→* ``string``
*module* ``string`` *debug* ``bool`` *→* ``string``
Verify MODULE, checking that all properties hold. Optionally, if DEBUG
is set to true, write debug output to “pact-verify-MODULE” directory.

.. code:: lisp
Verify MODULE, checking that all properties hold.
(verify "module")
(verify "module" true)
with-applied-env
~~~~~~~~~~~~~~~~
Expand Down
5 changes: 3 additions & 2 deletions docs/en/pact-reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ Pact Smart Contract Language Reference
This document is a reference for the Pact smart-contract language,
designed for correct, transactional execution on a `high-performance
blockchain <http://kadena.io>`__. For more background, please see the
`white paper <http://kadena.io/docs/Kadena-PactWhitepaper.pdf>`__ or the
`pact home page <http://kadena.io/#pactModal>`__.
`white
paper <https://docs.kadena.io/basics/whitepapers/pact-smart-contract-language>`__
or the `pact home page <http://kadena.io/#pactModal>`__.

Copyright (c) 2016 - 2018, Stuart Popejoy. All Rights Reserved.

Expand Down
2 changes: 1 addition & 1 deletion pact.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.2
name: pact
version: 4.4.1
version: 4.6.0
-- ^ 4 digit is prerelease, 3- or 2-digit for prod release
synopsis: Smart contract language library and REPL
description:
Expand Down

0 comments on commit 842fbc4

Please sign in to comment.