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

Allow replacing tombstone with a non-tombstone #31494

Merged
merged 1 commit into from
May 4, 2023

Conversation

pgarg66
Copy link
Contributor

@pgarg66 pgarg66 commented May 4, 2023

Problem

The program loading fails at deployment due to existence of a tombstone.

Summary of Changes

This was observed in unit tests where the program was being deployed. During deployment, the bank tried to load the program, as the owner matches the loader. But the verification of the program failed, and it resulted in a tombstone in the cache.
After the successful deployment, the bank tries to add the new program to the cache, but the slot matches with the tombstone's slots (since delay visibility feature is not yet enabled, the effective slot for the program is same as the deployment slot).

This change allows the replacement of the tombstone with a non-tombstone entry even though the slots match between the two entry. Also adds a unit test to test this case.

Fixes #

@pgarg66 pgarg66 requested a review from Lichtso May 4, 2023 19:18
@codecov
Copy link

codecov bot commented May 4, 2023

Codecov Report

Merging #31494 (316d57d) into master (53aec4a) will increase coverage by 0.0%.
The diff coverage is 100.0%.

@@           Coverage Diff           @@
##           master   #31494   +/-   ##
=======================================
  Coverage    81.4%    81.4%           
=======================================
  Files         731      731           
  Lines      208720   208734   +14     
=======================================
+ Hits       169980   170008   +28     
+ Misses      38740    38726   -14     

@pgarg66 pgarg66 merged commit de43ac4 into solana-labs:master May 4, 2023
4 checks passed
@pgarg66 pgarg66 deleted the swap-tombstone-with-live-entry branch May 4, 2023 20:56
} else if existing.is_tombstone() && !entry.is_tombstone() {
// The old entry is tombstone and the new one is not. Let's give the new entry
// a chance.
second_level.swap_remove(entry_index);
Copy link
Member

Choose a reason for hiding this comment

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

for the record: this newly-added instance of .swap_remove() is fixed at #32973

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.

None yet

3 participants