Open nagisa opened 2 years ago
This issue has been automatically marked as stale because it has not had recent activity in the last 2 months. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity in the last 2 months. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
Is this still relevant? @nagisa
Yes.
Right now maintaining the gas counters involves a structure with 3 distinct fields as seen here. This specific format necessitates an operation such as (pseudocode)
at the beginning of every basic block. Given the frequency at which this code is called, this is still going to be comparatively expensive, especially due to the number of branches in the gas check. Replacing the structure with something like
remaining_instructions: u64
and utilizing the following implementationis likely the most efficient way to implement the tracking of gas in the hot code area. To enable this we would need to:
As a more straightforward option, we could continue operating in gas everywhere, but rather than counting the consumed gas and checking against the limit we could adjust the instrumentation to decrement from a counter that represents the remaining gas.