Minor fixes from AI audit #2#11563
Conversation
…xAndContentLength` Prevents potential `ArgumentOutOfRangeException` in callers
…tContentLength`, fix related test
|
Claude finished @alexb5dh's task in 8m 18s —— View job PR Review — Minor Fixes from AI Audit #2
SummaryThe PR is a clean collection of targeted bug fixes. No critical, high, or medium issues found. All fixes are correct and well-tested. FindingsCritical / High / MediumNone. Low
Per-change notes
|
|
Claude finished @alexb5dh's task in 5m 57s —— View job PR Review — Minor Fixes from AI Audit #2
SummaryClean, targeted collection of bug fixes. All fixes are correct and well-tested. No critical, high, or medium issues found. FindingsCritical / High / MediumNone. Low
The new implementation is correct, but the test only asserts Per-change assessment
|
| BloomStructRef bloomStructRef = new(bloom.Bytes); | ||
|
|
||
| Assert.That(bloomStructRef.Equals((object)bloom), Is.True); | ||
| } |
There was a problem hiding this comment.
Low — test only covers the positive path for BloomStructRef.Equals(object?)
The fix to Equals(object?) has three observable behaviours, but only one is exercised here:
obj |
Expected |
|---|---|
equal Bloom |
true ✅ tested |
null |
false ❌ not tested |
non-equal Bloom |
false ❌ not tested |
an unrelated type (e.g. string) |
false ❌ not tested |
The old bug (GetType() == typeof(BloomStructRef) always false since ref structs can't be boxed) would have silently passed all the untested cases anyway, so it didn't matter before. Now that the implementation is correct, consider adding complementary cases to pin the contract:
// null → false
Assert.That(bloomStructRef.Equals((object?)null), Is.False);
// non-equal Bloom → false
Bloom different = new();
different.Set(Keccak.Zero.Bytes);
Assert.That(new BloomStructRef(different.Bytes).Equals((object)bloom), Is.False);
// wrong type → false
Assert.That(bloomStructRef.Equals("string"), Is.False);
Fixes for minor issues across different parts of codebase spotted by AI checks, continuation of #11406.
Changes
Fixes
GasUsednot being restored when TaikoTryAddTxfails.PeekNumberOfItemsRemaining- exits loop early when limit is reached.LightTxDecoderalso.supportTxHashcheck inReceiptStorageDecoder.GetContentLength. Also fixes invalid test, passing due to missing check.BloomStructRef.Equals(object)type check.AuRaSealValidator.ValidateParams.Error message improvements
PeekLongPrefixAndContentLength- prevents vagueArgumentOutOfRangeExceptionin callers.Other
Types of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?