You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement the processing of the EVM gas usage. (#3715)
## Motivation
Running the EVM has its cost, known famously as gas/fuel. We need to
have adequate tracking of gas usage.
## Proposal
The following was done:
* For each operation done in storage, we track whether it maps from or
to 0 (meaning inexistent) and whether it changes the value. In a
separate set of tests, we identified when the corresponding gas costs.
* The identified gas costs are then subtracted from the gas_usage
returned by REVM. This is because the storage costs are being billed at
the end when the block is created. Double-counting the costs would be
inadequate.
* The `consume_fuel` and other are multiplied in order to take the
`VmRuntime` as arguments. The additional values are added to the
`Resources` and other entries.
* In a classical REVM run, the runs from separate contracts are grouped
together. However, we do not do that and run the different contracts
separately. Therefore, the other calls are set to zero. The grouping of
the different runs is then done in the `Resources` data types.
* The service tests are bounded in gas usage by the hardcoded value of
20_000_000.
* The metrics are corrected accordingly.
## Test Plan
The CI.
## Release Plan
Normal release of Linera.
## Links
None.
Copy file name to clipboardExpand all lines: CLI.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -473,7 +473,8 @@ View or update the resource control policy
473
473
###### **Options:**
474
474
475
475
*`--block <BLOCK>` — Set the base price for creating a block
476
-
*`--fuel-unit <FUEL_UNIT>` — Set the price per unit of fuel
476
+
*`--wasm-fuel-unit <WASM_FUEL_UNIT>` — Set the price per unit of Wasm fuel
477
+
*`--evm-fuel-unit <EVM_FUEL_UNIT>` — Set the price per unit of EVM fuel
477
478
*`--read-operation <READ_OPERATION>` — Set the price per read operation
478
479
*`--write-operation <WRITE_OPERATION>` — Set the price per write operation
479
480
*`--byte-read <BYTE_READ>` — Set the price per byte read
@@ -489,7 +490,8 @@ View or update the resource control policy
489
490
*`--message-byte <MESSAGE_BYTE>` — Set the additional price for each byte in the argument of a user message
490
491
*`--service-as-oracle-query <SERVICE_AS_ORACLE_QUERY>` — Set the price per query to a service as an oracle
491
492
*`--http-request <HTTP_REQUEST>` — Set the price for performing an HTTP request
492
-
*`--maximum-fuel-per-block <MAXIMUM_FUEL_PER_BLOCK>` — Set the maximum amount of fuel per block
493
+
*`--maximum-wasm-fuel-per-block <MAXIMUM_WASM_FUEL_PER_BLOCK>` — Set the maximum amount of Wasm fuel per block
494
+
*`--maximum-evm-fuel-per-block <MAXIMUM_EVM_FUEL_PER_BLOCK>` — Set the maximum amount of EVM fuel per block
493
495
*`--maximum-service-oracle-execution-ms <MAXIMUM_SERVICE_ORACLE_EXECUTION_MS>` — Set the maximum time in milliseconds that a block can spend executing services as oracles
494
496
*`--maximum-block-size <MAXIMUM_BLOCK_SIZE>` — Set the maximum size of a block, in bytes
495
497
*`--maximum-blob-size <MAXIMUM_BLOB_SIZE>` — Set the maximum size of data blobs, compressed bytecode and other binary blobs, in bytes
@@ -533,7 +535,8 @@ Create genesis configuration for a Linera deployment. Create initial user chains
533
535
Possible values: `no-fees`, `testnet`
534
536
535
537
*`--block-price <BLOCK_PRICE>` — Set the base price for creating a block. (This will overwrite value from `--policy-config`)
536
-
*`--fuel-unit-price <FUEL_UNIT_PRICE>` — Set the price per unit of fuel. (This will overwrite value from `--policy-config`)
538
+
*`--wasm-fuel-unit-price <WASM_FUEL_UNIT_PRICE>` — Set the price per unit of Wasm fuel. (This will overwrite value from `--policy-config`)
539
+
*`--evm-fuel-unit-price <EVM_FUEL_UNIT_PRICE>` — Set the price per unit of EVM fuel. (This will overwrite value from `--policy-config`)
537
540
*`--read-operation-price <READ_OPERATION_PRICE>` — Set the price per read operation. (This will overwrite value from `--policy-config`)
538
541
*`--write-operation-price <WRITE_OPERATION_PRICE>` — Set the price per write operation. (This will overwrite value from `--policy-config`)
539
542
*`--byte-read-price <BYTE_READ_PRICE>` — Set the price per byte read. (This will overwrite value from `--policy-config`)
@@ -549,7 +552,8 @@ Create genesis configuration for a Linera deployment. Create initial user chains
549
552
*`--message-byte-price <MESSAGE_BYTE_PRICE>` — Set the additional price for each byte in the argument of a user message. (This will overwrite value from `--policy-config`)
550
553
*`--service-as-oracle-query-price <SERVICE_AS_ORACLE_QUERY_PRICE>` — Set the price per query to a service as an oracle
551
554
*`--http-request-price <HTTP_REQUEST_PRICE>` — Set the price for performing an HTTP request
552
-
*`--maximum-fuel-per-block <MAXIMUM_FUEL_PER_BLOCK>` — Set the maximum amount of fuel per block. (This will overwrite value from `--policy-config`)
555
+
*`--maximum-wasm-fuel-per-block <MAXIMUM_WASM_FUEL_PER_BLOCK>` — Set the maximum amount of Wasm fuel per block. (This will overwrite value from `--policy-config`)
556
+
*`--maximum-evm-fuel-per-block <MAXIMUM_EVM_FUEL_PER_BLOCK>` — Set the maximum amount of EVM fuel per block. (This will overwrite value from `--policy-config`)
553
557
*`--maximum-service-oracle-execution-ms <MAXIMUM_SERVICE_ORACLE_EXECUTION_MS>` — Set the maximum time in milliseconds that a block can spend executing services as oracles
554
558
*`--maximum-block-size <MAXIMUM_BLOCK_SIZE>` — Set the maximum size of a block. (This will overwrite value from `--policy-config`)
555
559
*`--maximum-bytecode-size <MAXIMUM_BYTECODE_SIZE>` — Set the maximum size of decompressed contract or service bytecode, in bytes. (This will overwrite value from `--policy-config`)
0 commit comments