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

v2.1: Fix flaky test_transaction_result_does_not_affect_bankhash (backport of #3916) #4578

Merged
merged 2 commits into from
Jan 23, 2025

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Jan 22, 2025

Problem

  • test_transaction_result_does_not_affect_bankhash is flaky due to random keypairs/pubkeys
  • The flakiness comes down to rent collection (rather updating rent epoch)
  • In successful transactions, we collect rent during transaction processing for writable accounts
    • in this case, that will be the mint_keypair's pubkey
  • In bank.freeze, we collect rent on partition(s)
    • in this case, that will be the mint_keypair IF the randomly generated key is in the partition
  • IF the mint pubkey falls in the bank's rent collection partitions, the bankhash is unaffected since the rent is collected in both cases

Summary of Changes

  • Use deterministic keys in the test, and in other tests

Fixes #


This is an automatic backport of pull request #3916 done by [Mergify](https://mergify.com).

(cherry picked from commit c5473e4)

# Conflicts:
#	ledger/src/blockstore_processor.rs
@mergify mergify bot requested a review from a team as a code owner January 22, 2025 17:35
@mergify mergify bot added the conflicts label Jan 22, 2025
Copy link
Author

mergify bot commented Jan 22, 2025

Cherry-pick of c5473e4 has failed:

On branch mergify/bp/v2.1/pr-3916
Your branch is up to date with 'origin/v2.1'.

You are currently cherry-picking commit c5473e4b3.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   ledger/src/genesis_utils.rs
	modified:   runtime/src/genesis_utils.rs

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   ledger/src/blockstore_processor.rs

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@steviez steviez assigned steviez and unassigned apfitzge Jan 22, 2025
@t-nelson
Copy link

Screenshot 2025-01-22 at 7 14 17 PM

derp

@steviez steviez force-pushed the mergify/bp/v2.1/pr-3916 branch from b0d3b6b to c2b2d50 Compare January 23, 2025 03:11
Copy link

@steviez steviez left a comment

Choose a reason for hiding this comment

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

I was working on other stuff today so rushed through the merge conflict; should be corrected now + paper-trail explaining why it previously failed

.last_blockhash
);
// AND should not affect bankhash IF the rent is collected during freeze.
assert_eq!(ok_bank_details == bank_details, fee_payer_in_rent_partition);
Copy link

Choose a reason for hiding this comment

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

This is the assertion we need to do as noted by what we have in master:

assert_eq!(ok_bank_details == bank_details, fee_payer_in_rent_partition);

which you can also see is what was added in the initial PR:
https://github.com/anza-xyz/agave/pull/3916/files#diff-281d947e593a76f3c3380804162dc8cf426fcc33e0ae1192589c8193221cd1e2R3626

assert_eq!(blockhash_ok, bank.last_blockhash());
assert!(bankhash_ok != bank.hash());
assert_eq!(bankhash_ok == bank.hash(), fee_payer_in_rent_partition);
Copy link

Choose a reason for hiding this comment

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

So the merge conflict needed to bring this check from c5473e4, but keep the rest from v2.1 head

@steviez steviez requested a review from brooksprumo January 23, 2025 06:19
@brooksprumo
Copy link

What's the justification/catalyst to backport this?

@bw-solana
Copy link

What's the justification/catalyst to backport this?

Came up in backport meeting. Motivations is just reducing the amount of times we have to hit the retry button in CI when backporting to 2.1

@t-nelson t-nelson merged commit 36cf5cd into v2.1 Jan 23, 2025
28 checks passed
@t-nelson t-nelson deleted the mergify/bp/v2.1/pr-3916 branch January 23, 2025 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants