Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Count compute units even when transaction errors #22182

Merged
merged 1 commit into from
Dec 31, 2021

Conversation

carllin
Copy link
Contributor

@carllin carllin commented Dec 30, 2021

Problem

Compute units and per program timings are not updated on transaction error, but simpler than
#22059

Summary of Changes

  1. Accumulate computation costs from erroring transactions in ProgramTimings
  2. Cost update service updates the cost model factoring in those error compute costs alongside the usual cost model update

Fixes #

Copy link
Contributor

@tao-stones tao-stones left a comment

Choose a reason for hiding this comment

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

looks great to me

@codecov
Copy link

codecov bot commented Dec 30, 2021

Codecov Report

Merging #22182 (6c3b02d) into master (33d0b5e) will increase coverage by 0.0%.
The diff coverage is 97.2%.

@@           Coverage Diff            @@
##           master   #22182    +/-   ##
========================================
  Coverage    81.1%    81.1%            
========================================
  Files         523      523            
  Lines      146367   146505   +138     
========================================
+ Hits       118704   118846   +142     
+ Misses      27663    27659     -4     

@carllin carllin merged commit d06e6c7 into solana-labs:master Dec 31, 2021
mergify bot pushed a commit that referenced this pull request Dec 31, 2021
(cherry picked from commit d06e6c7)

# Conflicts:
#	program-runtime/src/invoke_context.rs
#	program-runtime/src/timings.rs
#	program-test/src/lib.rs
#	programs/bpf_loader/src/syscalls.rs
#	runtime/src/cost_model.rs
#	runtime/src/message_processor.rs
mergify bot pushed a commit that referenced this pull request Dec 31, 2021
(cherry picked from commit d06e6c7)

# Conflicts:
#	program-runtime/src/invoke_context.rs
#	runtime/src/cost_model.rs
#	runtime/src/message_processor.rs
@Lichtso Lichtso mentioned this pull request Dec 31, 2021
Lichtso added a commit that referenced this pull request Dec 31, 2021
* Turns compute_units_consumed of ProcessInstructionResult into a &mut parameter.

* Removes second nesting level from test_process_instruction_compute_budget().

* Makes test_process_cross_program and test_native_invoke symmetric.

* Unifies test_process_cross_program(), test_native_invoke() and test_process_instruction_compute_budget() into test_process_instruction().
mergify bot added a commit that referenced this pull request Dec 31, 2021
…22199)

* Count compute units even when transaction errors (#22182)

(cherry picked from commit d06e6c7)

# Conflicts:
#	program-runtime/src/invoke_context.rs
#	runtime/src/cost_model.rs
#	runtime/src/message_processor.rs

* Resolve conflicts

Co-authored-by: carllin <[email protected]>
mergify bot added a commit that referenced this pull request Jan 1, 2022
@brooksprumo brooksprumo mentioned this pull request Jan 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants