Coder Social home page Coder Social logo

Evaluate difficulty of threading through request/response pattern from networking to rest of the system [ Timeboxed ] about casper-node HOT 1 CLOSED

SaiProServ avatar SaiProServ commented on June 20, 2024
Evaluate difficulty of threading through request/response pattern from networking to rest of the system [ Timeboxed ]

from casper-node.

Comments (1)

marc-casperlabs avatar marc-casperlabs commented on June 20, 2024

Seems to be fairly feasible with a small bit of cleanup, especially for components like the fetcher. Backpressure propagation would be as follows:

  1. Upstream components (mainly the synchronizer) will be asked to have a defined limit on the number of parallel requests they make. They need not worry about timeouts, since the fetcher can now guarantee a response (albeit an error one).
  2. Fetcher itself knows the capacity of each peer (via chainspec configuration and can balance accordingly), keeping an internal, unlimited queue (which is low on memory usage, since it only stores IDs).
  3. Networking does no longer buffer any message beyond the buffers built into the transport itself (juliet).
  4. Proper request-response handling is used (see sample code), resulting in .respond() to be called to answer requests coming, and requests being made are made solely through EffectBuilder::make_network_request.

Essentially this results in a respnse or error being associated with every request made, all enforced by the networking layer. Fetcher and higher up components need not concern themselves with these.

See the 4561-request-response-eval branch for some sample code.

from casper-node.

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.