Repository navigation
refactor(validation): remove unreachable missing expected hash handling - #236
Merged
Merged
Conversation
J-Engine-Session: je:315b6759-775b-47a5-918a-b9e2804992fb
Collaborator
✅ Heimdall Review Status
|
jackchuma
marked this pull request as ready for review
November 7, 2026 00:09
0xth4nh
reviewed
Nov 7, 2026
0xth4nh
left a comment
Contributor
There was a problem hiding this comment.
Looks good to Thanh's Toshi
0xth4nh
approved these changes
Nov 7, 2026
jackchuma
deleted the
refactor/drop-unreachable-expected-hash-handling
branch
November 7, 2026 17:56
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 changed? Why?
expected.domainAndMessageHasheswas typed optional, but it can never be absent:TaskConfigSchemarequiresexpectedDomainAndMessageHashes(src/lib/config-schemas.ts:79), both hashes must match/^0x[a-fA-F0-9]{64}$/, andgetExpectedDatacopies it from the parsed config. This makes it required and deletes the branches that handled its absence.buildSigningComparisonsis the only producer ofSigningDataComparison: it returns[]when actual hashes are missing and otherwise always setsactual, so the!actualchecks downstream were dead.actual.domainAndMessageHashesstays optional because it really is absent when task-origin validation fails and simulation is skipped;hasBlockingErrorsstill blocks in that case through the task-origin check.Notes to reviewers
src/lib/validation-results-utils.ts.src/lib/validation-service.tschanges only a return type annotation.ValidationData['expected']['domainAndMessageHashes']now required. Its only producer isvalidateUpgrade, which always sets it from the schema-validated config;/api/validatereturns that value unchanged.SigningDataComparison.actualnow required. OnlybuildSigningComparisonscreates it and it always setsactual.'missing'match status. Neither could render for any config that passes schema validation.git revertundoes it.How has it been tested?
Added three tests in
src/lib/__tests__/validation-results-utils.test.tsthat pin the remaining signing outcomes (no test covered the signing path before): matching hashes give statusmatchand do not block; differing hashes givemismatchand block; absent actual hashes give no signing items. Each was written against the old code first and confirmed it can fail (mutated value: expected0x1901…, received0x1902…; expected"mismatch", received"match"; expected[], received one signing item).Why this cleanup
ValidationData.expected.domainAndMessageHashesandSigningDataComparison.actualbecame required; the "Signing Not Available" block and the signing'missing'status were removed. Nothing could reach them: the schema requires the hashes andbuildSigningComparisonsalways setsactual.