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

Fix transaction logs and inner ixs for leader nodes #18395

Merged
merged 2 commits into from
Jul 6, 2021

Conversation

jstarry
Copy link
Member

@jstarry jstarry commented Jul 2, 2021

Problem

Leader nodes with rpc transaction history enabled can return corrupted transaction logs and inner instructions when they create and process a transaction batch which contains some invalid transactions.

Notes:

  • Since transaction entries with invalid transactions are rejected during replay by other validators, this doesn't impact non-leader nodes.
  • Leader nodes without rpc transaction history enabled won't return logs or inner instructions over rpc so the corrupted logs and inner instructions aren't an issue.

Summary of Changes

  • Ensure that the tx log collector and inner instruction recorder lists are appended to even when iterating over invalid transactions

Fixes #

@jstarry jstarry added the v1.7 label Jul 2, 2021
@jstarry jstarry force-pushed the fix-leader-logs branch 2 times, most recently from 6115d2c to 8aa1fd3 Compare July 5, 2021 14:22
@jstarry jstarry force-pushed the fix-leader-logs branch from 8aa1fd3 to c9d91a6 Compare July 5, 2021 16:14
@jstarry jstarry requested a review from mvines July 5, 2021 23:42
@mvines mvines requested a review from CriesofCarrots July 6, 2021 04:56
Copy link
Member

@mvines mvines left a comment

Choose a reason for hiding this comment

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

lgtm! @CriesofCarrots - can you please scroll through this PR too, I think you're more familiar with some parts of the changes here than I

rent_debits: Vec<RentDebits>,
) {
let slot = bank.slot();
let (inner_instructions, transaction_logs) = if !self.enable_cpi_and_log_storage {
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this removal intended? The presence/absence of --enable-cpi-and-log-storage validator flag has no effect now.

Copy link
Contributor

Choose a reason for hiding this comment

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

As context, using the Option to pass into the TransactionStatusService was a contortion to avoid having to collect empty Vecs for when --enable-cpi-and-log-storage is not present: #14922 (comment)

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for catching this! I thought this flag was redundant with the enable_cpi_recording and enable_log_recording flags. I added it back and I believe the option handling should match the previous behavior as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks!

@mergify mergify bot dismissed CriesofCarrots’s stale review July 6, 2021 17:06

Pull request has been modified.

@jstarry jstarry added the automerge Merge this Pull Request automatically once CI passes label Jul 6, 2021
@codecov
Copy link

codecov bot commented Jul 6, 2021

Codecov Report

Merging #18395 (7f92af7) into master (af18ca4) will decrease coverage by 0.0%.
The diff coverage is 96.9%.

@@            Coverage Diff            @@
##           master   #18395     +/-   ##
=========================================
- Coverage    82.5%    82.5%   -0.1%     
=========================================
  Files         436      436             
  Lines      121916   121922      +6     
=========================================
- Hits       100700   100678     -22     
- Misses      21216    21244     +28     

@mergify mergify bot merged commit 5dd399d into solana-labs:master Jul 6, 2021
@jstarry jstarry deleted the fix-leader-logs branch July 6, 2021 19:35
mergify bot pushed a commit that referenced this pull request Jul 6, 2021
* Fix transaction logs and inner ixs for leader nodes

* Fix cpi log storage flag

(cherry picked from commit 5dd399d)

# Conflicts:
#	runtime/src/bank.rs
mergify bot added a commit that referenced this pull request Jul 6, 2021
…#18448)

* Fix transaction logs and inner ixs for leader nodes (#18395)

* Fix transaction logs and inner ixs for leader nodes

* Fix cpi log storage flag

(cherry picked from commit 5dd399d)

# Conflicts:
#	runtime/src/bank.rs

* resolve conflict

Co-authored-by: Justin Starry <[email protected]>
@brooksprumo brooksprumo mentioned this pull request Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge this Pull Request automatically once CI passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants