Coder Social home page Coder Social logo

Comments (2)

nickchapman-da avatar nickchapman-da commented on June 1, 2024
  • Update existing softFetch/softExercise integration tests to match latest required behaviour. i.e. it must work for any types which satisfy the compatibility relation. And specifically, work for downgrades. Fix existing implementation.
  • Implement the compatibility relation (i.e code to drop/make-None) within importValue/translateValue, replacing the current code in SBPromoteAnyContract (which is not in the right place)
  • Refuse to downgrade optional field values which are not None (test and imp)
  • Control upgrading behaviour via engine-startup feature flag
  • Add ResultNeedUpgradeVerification to engine/ledger interface (we might yet switch to ResultNeedCreate)
  • Ensure changes support Ratko's canton level integration test PR. Specifically, so we can replace the related hack PR in the daml repo.
  • Restructure contract caching in the engine
  • make required calls to ResultNeedUpgradeVerification
  • Add engine level unit tests for upgrading and downgrading.

from daml.

nickchapman-da avatar nickchapman-da commented on June 1, 2024

interaction with contract-caching

Following the work to move the compatibility transformation into importValue it became clear there is a interaction with contract caching (in the engine) which needs to be resolved.

Contract caching prevents the engine from asking the ledger for the same contract twice. Currently the (LF) Value for the contract (received from the ledger) is first converted to an SValue by importValue before being cached.

importValue requires a type to do it's work. Previously (before #17095) it used the type associated with the contract data. Now, to support upgrades, we use the type coming from the code (fetch/exercise) we are running, and then up/down-grade as necessary. Potentially, it seems that the same contract value could be used (fetch/exercise) at two different types (type versions).

This does not play well with the caching of the SValue resulting from importValue

Remy and I discussed two potential solutions, presented here:
#17095 (comment)

A: cache an (LF) Value. Then convert to SValue on each import
B: cache SValue (like now). Then convert to a new SValue on each import.

We believe that B has too much subtlety and complexity, and scope for bugs.
We agreed that we should attempt A in the first instance.

from daml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.