Giter Club home page Giter Club logo

Comments (4)

RiccardoM avatar RiccardoM commented on May 23, 2024

This seems to happen also inside the handleMsgLike:

like := types.Like{
    ID:            xid.New().String(),
}

And inside handleMsgCreateSession

session := types.Session{
    ID:            xid.New().String(),
}

from desmos.

kwunyeung avatar kwunyeung commented on May 23, 2024

Why you think this ID should be deterministic?

from desmos.

RiccardoM avatar RiccardoM commented on May 23, 2024

@kwunyeung Let's consider the situation in which we have two different nodes, A and B.

The TX is processed by both nodes to update their respective statuses. While processing the MsgCreatePost message, this happens:

  • on node A, the new post's ID assumes value X
  • on node B, the new post's ID assumes value Y

After creating the post, the client then asks to both nodes for the list of all posts. What will he get are two different lists:

  • from node A he will get a list containing a post with ID X
  • from node B he will get a list containing a post with ID Y

What ID should it use when liking the post now? Should it use X or Y?

This obviously gets more and more complicated as new nodes are taken into consideration.

As far as I've understood the Handler is called on each node to update the local status, and thus the handler behavior should be 100% deterministic to make sure each node has the same status at each given point in time.

With this random ID generation we cannot guarantee it and thus we might run into conflicting statuses problems later in time.

from desmos.

kwunyeung avatar kwunyeung commented on May 23, 2024

Oops! My bad. Yes it has to be deterministic. Let's change it to an incremental ID like proposal ID and sequence before we get a solution on verifiable random number.

from desmos.

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.