Coder Social home page Coder Social logo

Comments (4)

bkchr avatar bkchr commented on July 2, 2024 1

One relatively straight-forward way to solve the problem could be to switch extrinsics_root to using V1 of the trie:

Sounds like a good start to me.

Maybe we could also introduce a bloom filter as part of the header that provides information about present transactions?

from rfcs.

tomaka avatar tomaka commented on July 2, 2024 1

The light client doesn't need to know the transaction index.
When a light client wants to know whether a transaction of a certain hash is included, the full node would send to it a Merkle proof of all the nodes whose key starts with that hash.

from rfcs.

tomaka avatar tomaka commented on July 2, 2024

One relatively straight-forward way to solve the problem could be to switch extrinsics_root to using V1 of the trie: https://github.com/paritytech/substrate/blob/ece92d6b30ee7f9fbda7a84bee76f8ff6d2c92a1/frame/system/src/lib.rs#L150

If this is done, we could then add a networking request for light clients to ask full nodes for a Merkle proof of the extrinsics trie that only contains the hashes of the extrinsics.
This proof would be around 35 * k to 40 * k bytes, where k is the number of extrinsics. This seems like a reasonable size to me.

Switching the extrinsics_root to V1 would be a breaking change, but we could reuse the state_version field for the migration (and rename it to system_version for example) by setting it to 2.

Another possibility could be to modify the extrinsics trie so that the trie keys are something like concat(transaction_hash, index). This would make it possible for a full node to generate a very small Merkle proof that an extrinsic is or is not in the block body.

from rfcs.

seunlanlege avatar seunlanlege commented on July 2, 2024

concat(transaction_hash, index)

Light clients don't know the transaction index, i think just using transaction hash as the key is fine.

from rfcs.

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.