Code Monkey home page Code Monkey logo

Comments (4)

kphfb avatar kphfb commented on August 28, 2024

Versioning exists on an individual basis on objects and isn't a global version. Which means that for TR specifically, it's of little importance actually (or at least not any more importance than someone losing their entire DB which is already fairly painful, but doesn't prevent communications from continuing). If this were a global state, then you are correct that it would break the channel. Let's take an example and explore what happens:

  • Two VASPs, C and D
  • C creates a TR object with state of abcd and sends it to D who responds with OK. This request would have _reads empty because it reads nothing and _writes of abcd since it writes the object state for this one object as abcd
  • D (or C) loses their entire DB
  • C creates another TR object for a new transaction. It has _reads empty since this is a new object and hence not dependent upon any prior state of this object. It has _writes of cbad for this new object. D is able to handle this fine because what it cares about is that it has the object state contained by _reads. Since _reads is empty, it means that this command has no prior dependencies.
  • C tries to update the first object abcd. It sends a command with _reads of abcd and _writes of 1234. This will fail since D no longer has this state due to the dropped database. C will need to re-create this object if they wish to submit it on-chain (or D will likely refund it if it's submitted on-chain). So there is a set of transactions that will have issues, but it's fairly short-lived. Essentially only objects which were open at the time that the database was dropped (assuming there was no backup from which to restore).

As you can see, there isn't actually a requirement to know that you had a channel with a VASP previously in the case that you lose your database since the only thing that you lose is open transactions which can be re-instantiated when the sending party sees an error response. We considered a state synchronization, but since these are individual object states, the scope of the failure is pretty limited and the advantage of simplicity vs preventing all failures felt like a reasonable tradeoff.

from dip.

dahliamalkhi avatar dahliamalkhi commented on August 28, 2024

@kphfb :

  1. Does an "object" exists only during the lifetime of a channel between two parties?
  2. Is it logically shared, but each party stores in its local DB the latest version it knows?
  3. Would it be advisable for parties on both sides of a channel to move objects to a durable store once its response on a channel allows a transaction to be submitted to the blockchain?

from dip.

kphfb avatar kphfb commented on August 28, 2024

@dahliamalkhi

  1. An object exists from when it was created until when it is finalized on chain or closed out via off-chain APIs (i.e. canceled)
  2. Correct
  3. Yes - although every operation should be updated in a database always

from dip.

gdanezis avatar gdanezis commented on August 28, 2024

Hi all,

In the past we discussed making a set of read commands that allow VASPs to read objects from each other. This can be used in the re-sync use-case among others.

In fact we have in the local API two function that we could provide over the network to the other side as commands: they are get_payment_by_ref and get_payment_history_by_ref here: https://github.com/libra/off-chain-reference/blob/eba72f53d4962fccd2033c98500c06bfaaacf4e2/src/offchainapi/core.py#L215

As @kphfb points out we thought this is not a necessity, but it is an option if people feel it is useful.

Best,

George

from dip.

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.