-
Notifications
You must be signed in to change notification settings - Fork 686
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
New Function Call Cost Model (Without parameter estimation) #6992
Comments
Relevant for this discussion, slides that explain exactly where we charge which fee. https://docs.google.com/presentation/d/10nqplCDpmLdzeZbVx9POwBqEYH6aSFcZOgZPA2vMK_g/edit?usp=sharing |
Introduces the concept of prefetching data from the DB while applying chunks. This is non-speculative prefetching only for now. In other words, the future is not speculatively predicted, only data is fetched that is guaranteed to be useful. More details on that inside `runtime/runtime/src/prefetch.rs`. No protocol change is needed for this. In general, prefetching how it has been implemented is (supposed to be) invisible in all possible ways, other than trie storage latency. Performance wise, this is going to make the worst-case assumption for all action receipts better. The worst case is that two accounts and one access keys have to be fetched from disk for every receipt. This IO cost dominates the gas cost for action receipt creation. Prefetching this data opens the door to potentially reducing this cost. This could affect all actions but is particularly relevant for redistributing gas costs around function call actions, see also #6992. ---- ### Test plan Tests check that the prefetcher loads the trie nodes that are expected into the staging area and that they are removed from it afterwards.
Introduces the concept of prefetching data from the DB while applying chunks. This is non-speculative prefetching only for now. In other words, the future is not speculatively predicted, only data is fetched that is guaranteed to be useful. More details on that inside `runtime/runtime/src/prefetch.rs`. No protocol change is needed for this. In general, prefetching how it has been implemented is (supposed to be) invisible in all possible ways, other than trie storage latency. Performance wise, this is going to make the worst-case assumption for all action receipts better. The worst case is that two accounts and one access keys have to be fetched from disk for every receipt. This IO cost dominates the gas cost for action receipt creation. Prefetching this data opens the door to potentially reducing this cost. This could affect all actions but is particularly relevant for redistributing gas costs around function call actions, see also near#6992. ---- Tests check that the prefetcher loads the trie nodes that are expected into the staging area and that they are removed from it afterwards.
Introduces the concept of prefetching data from the DB while applying chunks. This is non-speculative prefetching only for now. In other words, the future is not speculatively predicted, only data is fetched that is guaranteed to be useful. More details on that inside `runtime/runtime/src/prefetch.rs`. No protocol change is needed for this. In general, prefetching how it has been implemented is (supposed to be) invisible in all possible ways, other than trie storage latency. Performance wise, this is going to make the worst-case assumption for all action receipts better. The worst case is that two accounts and one access keys have to be fetched from disk for every receipt. This IO cost dominates the gas cost for action receipt creation. Prefetching this data opens the door to potentially reducing this cost. This could affect all actions but is particularly relevant for redistributing gas costs around function call actions, see also near#6992. ---- Tests check that the prefetcher loads the trie nodes that are expected into the staging area and that they are removed from it afterwards.
Putting the table in a comment, outside the reach of bots.. Variables:
On the sender side
On the receiver side
|
So far it looks like we don't necessarily want to change the set of parameters too much. We probably want to change the parameter values as described in #7227. But this issue for figuring out the set of parameters making up the model can be closed now. |
Introduces the concept of prefetching data from the DB while applying chunks. This is non-speculative prefetching only for now. In other words, the future is not speculatively predicted, only data is fetched that is guaranteed to be useful. More details on that inside `runtime/runtime/src/prefetch.rs`. No protocol change is needed for this. In general, prefetching how it has been implemented is (supposed to be) invisible in all possible ways, other than trie storage latency. Performance wise, this is going to make the worst-case assumption for all action receipts better. The worst case is that two accounts and one access keys have to be fetched from disk for every receipt. This IO cost dominates the gas cost for action receipt creation. Prefetching this data opens the door to potentially reducing this cost. This could affect all actions but is particularly relevant for redistributing gas costs around function call actions, see also #6992. ---- ### Test plan Tests check that the prefetcher loads the trie nodes that are expected into the staging area and that they are removed from it afterwards.
This issue is to discuss what the correct gas cost model is for a function call. (Independent of numerical values.)
Today, after some refactoring done already, this is the gas cost for a function call. (Without WASM cost.)
Variables:
A
: Message size = bytes of method name + argumentB
: Contract code size in bytesOn the sender side
On the receiver side
Possible changes
wasm_contract_loading_base
. It could be absorbed byaction_function_call_exec
.wasm_contract_loading_bytes
into storage loading and executable loading.Related issues: #6353 #4826
The text was updated successfully, but these errors were encountered: