Comments (1)
Concept of Gas and Fee
Gas
The concept of Gas represents the amount of computational effort required to execute specific operations on the state machine.
Gas is used to track the resource usage of operations during the execution
GasMeter
GasMeter: keeps track of the gas consumed during executions that lead to state transitions. It is reset on every transaction execution.
BlockGasMeter
BlockGasMeter: keeps track of the gas consumed in a block and enforces that the gas does not go over a predefined limit. This limit is defined in the Tendermint consensus parameters and can be changed via governance parameter change proposals.
why we need gas fee
Gas is used to evaluate the estimation effort or resource required to execute transactions, including read, write and computation.
EIP Gas Fee Model
EIP 1599
https://eips.ethereum.org/EIPS/eip-1559
- Basefee
- Capacity
- Miner tip
How to estimate gas for mutation and query
In this section, we are looking into ways to evaluate mutation and query.
https://ethereum.org/en/developers/docs/evm/opcodes/
Mutation gas
Regarding mutation, we are considering proposing a gas formula as shown below:
Mutation_(gas) = kvs_len * COMPUTAION_GAS_PRICE + data_bytes * STORAGE_GAS_PRICE
Query gas
KVQuert_(gas) = kv_query_count * COMPUTAION_GAS_PRICE
BlockGasMeter
It is necessary to set up a limit on the maximum gas for each block so that we can guarantee every node can finish the execution with the given minimum configuration.
Block Gas Check
-
Configurate BlockGasLimit based on the given configuration
- Put block_gas into BlockState
- Verify block_gas < BlockGasLimit inside check_tx
Reference
- https://ethereumprice.org/gas/
- https://eips.ethereum.org/EIPS/eip-1559
- https://docs.ethermint.zone/basics/gas.html
- https://www.youtube.com/watch?v=Yh8cHUB-KoU
- Ethereum gas, gas limit, gas price
from db3.
Related Issues (20)
- Build a fully test environment
- Recover the counter of database id from ownership column family
- Support the max delay to execute rollup
- Recover the contract event jobs after restarting the index node
- Add sdk support list in readme
- Add getDoc method for sdk
- multi-chain metadata support
- Optimize the grpc error information: return human readable error information
- Support the all solidity types for parsing the contract events
- Use contract address, network id and chain id to initialize the sdk
- The index node sends a lot of subscription message
- duplicated database bug
- upload to arweave and call smart contract atomicly
- support reconnect to the rollup node when index lost connection to the rollup node
- the rollup node lost document meta data when it was restarted
- fail to mint database and collection for Empty log from stream error
- Error batch No in the rollup list
- the backgroud rollup task exists for exceptions
- 文件同步到arweave无法正常完成
- Permissioned access or multi-user database HOT 1
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 db3.