cow: always process KvMods to add OldData to mods when building StateDeltas#4804
Merged
Conversation
jannotti
reviewed
Nov 16, 2022
Contributor
|
+1 to remove, empty blocks are rare :) |
Contributor
Author
|
Removed the guard clause |
Codecov Report
@@ Coverage Diff @@
## master #4804 +/- ##
==========================================
- Coverage 54.68% 54.66% -0.03%
==========================================
Files 414 414
Lines 53550 53552 +2
==========================================
- Hits 29286 29273 -13
- Misses 21836 21851 +15
Partials 2428 2428
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Test that old data is populated by roundCowState.deltas()
algorandskiy
approved these changes
Nov 17, 2022
| kvMods[name] = ledgercore.KvValueDelta{Data: nil} | ||
| // needs an old data, else optimized away. | ||
| // if oldData = "" there is the best chance of a bug, so we use that | ||
| kvMods[name] = ledgercore.KvValueDelta{Data: nil, OldData: []byte("")} |
Contributor
There was a problem hiding this comment.
Suggested change
| kvMods[name] = ledgercore.KvValueDelta{Data: nil, OldData: []byte("")} | |
| kvMods[name] = ledgercore.KvValueDelta{Data: nil, OldData: []byte{}} |
michaeldiamant
approved these changes
Nov 17, 2022
Contributor
michaeldiamant
left a comment
There was a problem hiding this comment.
As intended, I confirmed the added tests fail in master while passing in the PR.
@cce Thanks again for your efforts to isolate + find the issue!
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.
Summary
Through debugging we noticed OldData was not set when it should be. Later we realized that roundCowState.deltas() was not always adding OldData to KvMods, and the early exit on empty sdeltas was the culprit.
Test Plan
Existing tests should pass, maybe we should have new tests for this kind of thing.