Skip to content
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

Moves where the TransactionExecutionDetails::accounts_data_len_delta is interpreted #34692

Conversation

brooksprumo
Copy link
Contributor

Problem

After executing a transaction, we build and return a TransactionExecutionResult. This value is used later when committing transactions.

For recording the accounts data size delta, currently we are modifying the value stored into the execution result during execute based on the transaction's status, and then using the delta in commit. Since this code is split, it's possible to miss one side vs the other. Also, we're conditionally changing what actually happened during transaction execution. It would be better to not change the delta, but instead move the interpretation to commit.

Summary of Changes

The commits are:

  1. Move where we check the transaction status and get the delta,
  2. Refactor using the delta to be a bit simpler (IMO)

@brooksprumo brooksprumo self-assigned this Jan 8, 2024
@brooksprumo brooksprumo marked this pull request as ready for review January 8, 2024 17:51
Copy link

codecov bot commented Jan 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (30fa449) 81.8% compared to head (815888b) 81.8%.
Report is 15 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #34692   +/-   ##
=======================================
  Coverage    81.8%    81.8%           
=======================================
  Files         824      824           
  Lines      222687   222686    -1     
=======================================
+ Hits       182245   182258   +13     
+ Misses      40442    40428   -14     

@@ -4916,7 +4915,7 @@ impl Bank {
durable_nonce_fee,
return_data,
executed_units,
accounts_data_len_delta,
accounts_data_len_delta: accounts_resize_delta,
Copy link
Contributor

Choose a reason for hiding this comment

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

Could rename variable definition to be accounts_data_len_delta.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, that'll just move this change to the destructing line. Would you prefer that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 815888b

@brooksprumo brooksprumo merged commit 642a7e0 into solana-labs:master Jan 9, 2024
34 of 35 checks passed
@brooksprumo brooksprumo deleted the accounts-data-size/transaction-execution-details/accounts-data-len-delta branch January 9, 2024 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants