Use hash to generate state change ID instead of sort order#530
Draft
aditya1702 wants to merge 2 commits intopgx-migrationfrom
Draft
Use hash to generate state change ID instead of sort order#530aditya1702 wants to merge 2 commits intopgx-migrationfrom
aditya1702 wants to merge 2 commits intopgx-migrationfrom
Conversation
Use FNV-64a hash of the sort key to derive a stable, content-based ID for state changes. This prevents PK collisions when new categories are added and old ledgers are reprocessed incrementally. - Rename StateChangeOrder → StateChangeID across all 29 files - Rename SortKey → HashKey, generateSortKey → generateHashKey - Compute hash in StateChangeBuilder.Build() via FNV-64a - Remove sort + positional assignment from indexer.processTransaction - Update migration to use state_change_id column name
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.
What
[TODO: Short statement about what is changing.]
Why
[TODO: Why this change is being made. Include any context required to understand the why.]
Known limitations
[TODO or N/A]
Issue that this PR addresses
[TODO: Attach the link to the GitHub issue or task. Include the priority of the task here in addition to the link.]
Checklist
PR Structure
allif the changes are broad or impact many packages.Thoroughness
Release