Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

[0.13] Update post-execution fee checks #1204

Merged
merged 61 commits into from
Feb 1, 2024
Merged

Conversation

fmoletta
Copy link
Contributor

@fmoletta fmoletta commented Jan 24, 2024

Closes #1193 & #1159
Changes:

  • Add run_post_execution_fee_checks
  • Use run_post_execution_fee_checks in account txs (declare, invoke, deploy account) to run fee checks before charging the fee. This is also used to revert transactions in case of failure for revertible account transactions (invoke).
  • Remove revertible behaviour from DeployAccount

Refactors:

  • Remove fee-related checks from charge_fee (as these are now run by run_post_execution_fee_checks
  • charge_fee no longer calculates the actual_fee and instead receives it. This is so that account transactions (that now run fee checks before charging) don't have to calculate the fee twice

@fmoletta fmoletta changed the base branch from main to update-check-fee-balance January 24, 2024 21:09
@codecov-commenter
Copy link

codecov-commenter commented Jan 25, 2024

Codecov Report

Attention: 10 lines in your changes are missing coverage. Please review.

Comparison is base (b6514d1) 89.40% compared to head (dc72ed7) 89.65%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1204      +/-   ##
==========================================
+ Coverage   89.40%   89.65%   +0.24%     
==========================================
  Files          50       50              
  Lines       14252    14304      +52     
==========================================
+ Hits        12742    12824      +82     
+ Misses       1510     1480      -30     
Files Coverage Δ
src/definitions/block_context.rs 97.82% <100.00%> (+0.12%) ⬆️
src/lib.rs 98.23% <100.00%> (ø)
src/state/state_api.rs 100.00% <100.00%> (ø)
src/transaction/declare.rs 90.51% <100.00%> (-0.04%) ⬇️
src/transaction/declare_v2.rs 87.98% <ø> (ø)
src/transaction/deploy_account.rs 80.14% <100.00%> (-0.08%) ⬇️
src/transaction/error.rs 100.00% <100.00%> (ø)
src/transaction/invoke_function.rs 95.18% <100.00%> (-0.02%) ⬇️
src/transaction/fee.rs 90.88% <89.69%> (+0.11%) ⬆️

... and 3 files with indirect coverage changes

@fmoletta fmoletta marked this pull request as ready for review January 25, 2024 15:27
Base automatically changed from update-check-fee-balance to main January 30, 2024 20:17
@juanbono juanbono added this pull request to the merge queue Feb 1, 2024
Merged via the queue into main with commit 15750f9 Feb 1, 2024
7 checks passed
@juanbono juanbono deleted the update-post-exec-tx-checks branch February 1, 2024 21:36
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.

[0.13] Update post execution checks
4 participants