Comments (1)
The DB Layer could provide very specific details like exactly where the item exists in the merkle trie (depth, size, neighboring children, if it or other neighboring children have already been cached, etc..). Then with really comprehensive database benchmarks, we can dynamically meter how much weight each data operation would be.
This would require to specify an abstract database architecture with a specific cache size, and enforce all clients to have a database compatible with this abstraction.
Maybe just enforcing one cache (without all the neighboring children, depth, size, information) can already be a huge improvement.
Also if we have more memory in the runtime with PVM we can also implement some caching inside the runtime itself I guess.
I see we can do this RFC in multiple step:
-
1- Tracking operations: have a better automatic refund.
-
inside the runtime: keep track of most time-intensive runtime-interface call:
crypto
,hashing
,Storage
,Trie
. -
benchmark them independantly from the
ref_time
. (we already do it forStorage
) -
have the weight related to them separated from
ref_time
in the dispatch info (e.g.:tracked_operation_ref_time
). -
tracked_operation_ref_time
gets an automatic precise refund at the end of the transaction by calculating the actual weight from the tracked call. -
(maybe we could even track wasm execution in the
tracked_logic_ref_time
, as I heard the expensive part of metering was branching when gas is exceeded, not actually counting the number of operation, but it feels difficult for less gain, also considering PVM)
-
-
2- Tracking
Storage
more precisely: even better refund-
enforce an architecture on the database: maybe just a cache size or what you propose with neighbor, depth etc..
-
add this information in the
Storage
runtime interface. -
use this information in the tracking and refund.
-
-
3- Have metering and execution stopped when max weight is reached.
from rfcs.
Related Issues (20)
- placed by mistake
- Bot for automatic merging apprroved RFCs/closing rejected RFCs HOT 17
- Mild gossip reform HOT 2
- Pre-RFC: XMS language (XCM Made Simple) HOT 8
- Governance parachain fallback HOT 2
- Research: FRAME alternative based on WASM components
- Define categories and scope of RFCs
- RFCs Web Page [mdbook] HOT 7
- Define the responsibilities so we can evaluate salary payment requests HOT 5
- Bot: Notify people about new fellowship referendas HOT 19
- [xcm-emulator] Make a generic `genesis` constructor method HOT 1
- Inquiry regarding scope for proposed Polkadot Provider API RFC HOT 10
- Add a changes trie HOT 4
- mdBook fails to build if there is a link in the RFC title
- Permisionless way to create HRMP channels between system parachains and other parachains HOT 19
- Stale Nomination Reward Curve HOT 14
- Adding a `CoreIndex` commitment to candidate receipts HOT 23
- Move the XCM spec and RFC process under the Polkadot Fellowship HOT 4
- Variable Existential Deposit 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 rfcs.