v2.2: Do not insert into accounts lt hash cache if freeze has started (backport of #6307)#6320
Merged
Conversation
(cherry picked from commit 273f713)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v2.2 #6320 +/- ##
=========================================
- Coverage 83.4% 83.4% -0.1%
=========================================
Files 806 806
Lines 373321 373344 +23
=========================================
- Hits 311564 311467 -97
- Misses 61757 61877 +120 🚀 New features to boost your workflow:
|
t-nelson
approved these changes
May 28, 2025
jstarry
approved these changes
May 28, 2025
nibty
pushed a commit
to x1-labs/tachyon
that referenced
this pull request
Jun 11, 2025
… (backport of anza-xyz#6307) (anza-xyz#6320) * Do not insert into accounts lt hash cache if freeze has started (anza-xyz#6307) (cherry picked from commit 273f713) * fix build due to sdk dependency renames --------- Co-authored-by: Brooks <brooks@anza.xyz>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When activating the accounts lt hash feature (SIMD-215) on testnet, there was a bank hash mismatch caused by a bad lt hash.
After investigating with @jstarry1, it was concluded this is possible when the leader is still executing transactions after bank freeze has started. This would allow putting an entry into the accounts lt hash cache that was not the initial value of the account, and instead the value after bank freeze finishes up any deferred changes to account state. Then, then calculating the lt hash for the slot, we'd compute the wrong final lt hash value, since the initial state of this account was incorrect in the cache.
Here's an example:
freeze()and begins finishing up deferred changes to account state.A.Tis executing that includes an instruction that modifies accountA.TloadsA, and as part of loadingA, we callinspect_account(). The value ofAthat gets loaded is after step (2). The modifiedAis added to the accounts lt hash cache.Tfinished executing and sees it is past the end of the block so it does not commit.Ais a modified account in this slot because of step (2). As part of subtracting out the old state of accountA, we look at the accounts lt hash cache and see there is an entry forA. However, this version ofAis the same as the modified version, and not the old version ofA. Thus, we calculate the accounts lt hash value.Summary of Changes
Disallow adding entries to the accounts lt hash cache if freeze has started.
Justification to Backport
The PR is a patch to fix a bug that can cause a leader to compute the wrong lattice hash for a slot. This results in a bank hash mismatch, which we'd like to avoid.
This is an automatic backport of pull request #6307 done by [Mergify](https://mergify.com).
Footnotes
https://discord.com/channels/428295358100013066/838890116386521088/1375339076370300958 ↩