Comments (3)
We will need a simpler form of caching where we save the latest root hash every few blocks, just so the clients can create proof against it and submit it before it changes. #8 (comment)
from anon.
The solution mentioned above will still leave some failing transactions so, in order to provide a smooth experience, a simpler solution can be like:
Just have a linked list of the last n
root hashes, keep track of the head and the tail in the list. Every t
blocks remove the tail root hash and insert the current one (taken from storage) to the head of the list. This linked list can be implemented with BTreeMap. This is done inside the on_finalize
inside mixer pallet, but there will be a standalone function inside the Merkle pallet, so people can call it on demand
Improvements from the current caching strategy:
- No need to pass the block number to specify where is the root hash that you constructed proof for (for v1 at least)
- Smaller memory footprint
from anon.
So the feeling I'm getting is that we shouldn't touch the cache at all. It is sufficient for the use case atm and is efficiently implemented in the module's storage. It supports pruning to arbitrary length as specified in the runtime and we can set this to be anything reasonable for now.
As for block number, since we always carry it forward. You can just query latest block - 1 to get the previous root to prove against.
from anon.
Related Issues (20)
- Explore merkle mountain range pallets
- extract `gadgets`, `crypto-constants` and `wasm-utils` into a seprate crates/repos HOT 4
- Build and store entire merkle trees for each merkle group or mixer.
- max_leaves of group tree looks incorrect HOT 1
- Add pedersen commitments to leaf commitments instead of only Poseidon HOT 1
- Generalise the mixer sizes as a trait parameter.
- Implement delayed withdrawal processing.
- Offchain worker implementation for fee-less transactions. HOT 1
- Spec the bridge gadget for pallet implementation.
- Benchmark storage of poseidon parameters in runtime storage to initialise hasher against current usage.
- Store PedersenGens and BulletproofGens in runtime storage and benchmark against creating on the fly.
- Integrate ORML-tokens and wrap native token into webbNATIVE (such as webbEDG).
- Add caching speed-up to existing WASM Mixer implementation.
- Check poseidon parameters and re-generate them using hadeshash gitlab. HOT 1
- `Data` name conflict with polkadot change it to be `ScalarData`
- Fix CI build errors
- Update bulletproof-gadgets version and PoseidonBuilder uses across the repo
- Implement meta transactions and fee-less transactions
- Fix issues with recipient not being in circuit.
- Add index to deposit/insert event. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from anon.