GitLab's annual major release is around the corner. Along with a lot of new and exciting features, there will be a few breaking changes. Learn more here.

This project is mirrored from https://gitlab.com/tezos/tezos.git. Pull mirroring updated .
  1. 16 Jun, 2021 5 commits
    • Thomas Letan's avatar
      LB/PBT: Check an attacker cannot get richer by interacting with CPMM · 36f43754
      Thomas Letan authored
      
      
      For any sequence of calls from a fixed attacker to the CPMM, the
      global effect of the sequence of calls on the balances of the attacker
      in tez, tzBTC, and liquidity tokens is such that at least one of the
      balances decreases.
      
      We have looked for global-gain attacks using our property-based
      testing framework. More precisely, the test consists in generating 100
      initial contexts, and for each of these contexts, generating and
      executing a sequence of 100 valid contracts calls performed by the
      same implicit account `c'. Note that the execution is done with a
      subsidy equal to 0, because the objective of this test is to discover
      if an attacker can become richer by exploiting the CPMM, not by
      depositing funds against liquidity tokens. After each contract call,
      the balance of `c' is checked to assert that either one of its
      balances (xtz, tzBTC or lqt) has decreased, or they all remained
      constant.
      Co-author-by: Arvid Jakobsson's avatarArvid Jakobsson <arvid.jakobsson@nomadic-labs.com>
      Co-author-by: Thomas Letan's avatarThomas Letan <lthms@nomadic-labs.com>
      36f43754
    • Thomas Letan's avatar
      LB/PBT: Introduce so-called Liquidity Baking machines · 568cf99d
      Thomas Letan authored
      
      
      In this commit, we introduce so-called “machines” to test the
      liquidity baking feature.  In this context, machines are transition
      systems which allows to run “scenarios”, that is sequences of “steps”
      consisting in calling one or more entrypoints of the Exchange
      contracts.
      
      There are three key machines implemented in this commit:
      
         1. The `ConcreteMachine' which runs scenarios on-chain
         2. The `SimulationMachine' which runs scenarios completely
            off-chain
         3. The `ValidationMachine' which runs scenarios against both
            machines
      
      The need for a fast `SimulationMachine' is motivated by the slowness
      of the `ConcreteMachine'; the `ValidationMachine' allows to solve the
      trustworthiness issue raised by testing a simulation rather than the
      actual implementation.
      
      Besides, the `ValidationMachine' checks that the storage of the LB
      contracts remain consistent throughout the execution of scenarios,
      that is (1) the tez balance stored in the ledger, (2) the storage of
      the FA1.2 contract, and (3) the storage of the tzBTC replacement
      contract.
      Co-author-by: Arvid Jakobsson's avatarArvid Jakobsson <arvid.jakobsson@nomadic-labs.com>
      Co-author-by: Thomas Letan's avatarThomas Letan <lthms@nomadic-labs.com>
      568cf99d
    • Thomas Letan's avatar
      Proto/test: Provide a way to configure [cost_per_byte] · 5dd7d1ec
      Thomas Letan authored
      The [cost_per_byte] parameter is here to set a price for increasing
      the size of the storage; when it comes to testing the blockchain, it
      may make the task to predict transaction outcomes harder.  To avoid
      this additional challenge when the later is not the focus of a test,
      we provide an additional parameter to [Context.init] to set it to
      an arbitrary value, (i.e., [Tez.zero] in practice).
      5dd7d1ec
    • Arvid Jakobsson's avatar
      LB/PBT: Add a new test executable dedicated to Liquidity Baking PBT · 77ca68b2
      Arvid Jakobsson authored
      In this patch, we introduce an executable dedicated to Liquidity
      Baking PBT. The reason we use a dedicated executable rather than
      reusing the existing unit tests executable is to make sure that the
      seed used by QCheck for a given run is easily accessible to
      developers.
      
      Indeed, the first line printed by QCheck is of the form
      
          random seed: 405690462
      
      To run the test-suite using the exact same seed, one can use the
      following command line:
      
          dune exec src/proto_alpha/lib_protocol/test/liquidity_baking_pbt.exe \
               -- --seed 405690462
      77ca68b2
    • Arvid Jakobsson's avatar
      LB/PBT: Introduce LB contracts boilerplate · c2af3f11
      Arvid Jakobsson authored
      In this patch, we introduce the necessary boilerplate In order to
      programmatically call LB contracts’ entrypoint from the Tezos protocol
      test framework.  Said boilerplate consists in regular OCaml types for
      entrypoint parameters and storage, and conversion functions from and
      to their Micheline representation.  Beside, this patch provides
      specialized version of the [transaction] function for calling LB
      contracts.
      c2af3f11
  2. 15 Jun, 2021 8 commits
  3. 14 Jun, 2021 14 commits
  4. 11 Jun, 2021 13 commits