Skip to content

Instrument LOG0-LOG4 gas function #492

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: instrument_call_gas_func
Choose a base branch
from

Conversation

MishkaRogachev
Copy link
Contributor

@MishkaRogachev MishkaRogachev commented Jul 18, 2025

For NIT-3481

Instrument LOG0-LOG4 opcodes with multigas calculations:

  • Base makeGasLog func

Note: waits #486 to be merged, temporary points on instrument_call_gas_func branch

@cla-bot cla-bot bot added the s CLA signed label Jul 18, 2025
@MishkaRogachev MishkaRogachev force-pushed the instrument_log0_4_gas_func branch from 9170c6c to a260a06 Compare July 18, 2025 11:58
if err != nil {
return multigas.ZeroGas(), 0, err
}

// TODO(NIT-3484): Update multi dimensional gas here
if gas, overflow = math.SafeAdd(gas, params.LogGas); overflow {
if overflow = multiGas.SafeIncrement(multigas.ResourceKindComputation, params.LogGas); overflow {
Copy link
Contributor Author

@MishkaRogachev MishkaRogachev Jul 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My assumption: HistoryGrowth := requestedSize * params.LogDataGas (8), others cost values are computation. Not sure about bloomHistoryGrowthCost, is it charged outside of VM?

Based on:

historyGrowthCost := sizeHistoryGrowthCost + bloomHistoryGrowthCost

@relyt29

@MishkaRogachev MishkaRogachev force-pushed the instrument_log0_4_gas_func branch from a260a06 to 0da73bc Compare July 18, 2025 12:51
@MishkaRogachev MishkaRogachev changed the base branch from cbp-feature to instrument_call_gas_func July 18, 2025 12:52
@MishkaRogachev MishkaRogachev marked this pull request as ready for review July 18, 2025 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s CLA signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants