Code Monkey home page Code Monkey logo

Comments (3)

Robbepop avatar Robbepop commented on May 19, 2024

For the flushing system there will be two different ways of flushing.

Hard Flush

Flushes the cache and empties it.

If a contract A is calling another remote contract B that could potentially mutate the storage of A there must be a hard flush since B could write to the storage invalidating the cache of A.

Downside

A hard flush has the downside of A having to re-build the entire cache after the call of B returns.

Advantage

Whatever B does it is safe to perform a hard flush since nothing will invalidate cache if there is no cache. (:D)

Soft Flush

Flushes the cache and marks all flushes entries as clean.

If a contract A is calling another remote contract B that is not allowed to mutate the state of A (but besides that can do anything) then A can do a soft flush because anything that B could do won't invalidate the cache of A.

Downside

The run-time has to provide a way to allow A to call B in a way that the above mentioned guarantees are not invalidated by B.

Advantage

A soft flush has the advantage that A doesn't have to rebuild the entire cache after B returns.

from ink.

Robbepop avatar Robbepop commented on May 19, 2024

be555eb implements flushing for the fundamental SyncCell and SyncChunk types.
97696ec implements Flush for the remaining storage::{Value, Vec, HashMap, Stash}.

from ink.

Robbepop avatar Robbepop commented on May 19, 2024

This can be closed since it has been implemented and seem to be stable.

from ink.

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.