Add set filter ID to the hashData for address filter - NIT-4688#4594
Add set filter ID to the hashData for address filter - NIT-4688#4594joshuacolvin0 merged 6 commits intomasterfrom
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #4594 +/- ##
==========================================
- Coverage 34.97% 34.05% -0.92%
==========================================
Files 495 497 +2
Lines 59049 59155 +106
==========================================
- Hits 20651 20148 -503
- Misses 34782 35443 +661
+ Partials 3616 3564 -52 |
❌ 10 Tests Failed:
View the top 3 failed tests by shortest run time
📣 Thoughts on this report? Let Codecov know! | Powered by Codecov |
|
PR Review Summary: add-filter-set-id-hashstore All findings verified by reading the code and running tests. Critical Issues (2)
parseHashListJSON now requires a valid "id" UUID field, but 6 of 8 sub-cases omit it. Confirmed by running the test: service_test.go:263: failed to parse JSON with Sha256 hashing_scheme: invalid filter set ID UUID: invalid UUID length: 0
Note: invalidSaltPayload (line 220) still works correctly because salt is parsed before id. Fix: Add "id": uuid.New().String() to every payload missing it.
s3_sync.go:97 — uuid.Parse("") fails if the provider hasn't added "id" yet, causing node startup failure. Unlike hashing_scheme (which handles missing values gracefully), id is a hard requirement with no fallback. Fix: Either make id optional or coordinate deployment with the provider. Important Issues (5)
return nil, err is bare, while the id error on line 99 wraps with fmt.Errorf. Inconsistent and harder to debug. Fix: return nil, fmt.Errorf("invalid salt UUID: %w", err)
uuid.Nil is the "not initialized" sentinel, but nothing prevents storing it as a real salt, which would silently bypass filtering. Fix: Validate in parseHashListJSON: if salt == uuid.Nil { return nil, fmt.Errorf("salt cannot be nil UUID") }
"id-set-fitler" should be "id-set-filter".
The id is parsed (with hard failure on absence) and stored in hashData, but no code reads it — no getter, no logging, no metrics. The log line at s3_sync.go:74 doesn't include it. Consider at minimum logging it. Suggestions (5)
Many tests use salt, _ := uuid.Parse(...). If a UUID constant is corrupted, the test silently gets uuid.Nil, and per issue 4, filtering is bypassed causing tests to pass for wrong reasons. Some tests already use
parsedPayload is unexported but has exported fields Id, Salt, Hashes. These should be lowercase. Also Id should be ID per Go conventions.
Exported function implementing a protocol-level contract (sha256("::0x")). Deserves a doc comment.
No doc comment, unlike its sibling hashListPayload on line 28.
If the provider switches algorithms, the code logs a warning but proceeds with SHA-256, silently producing wrong hashes and bypassing filtering. Strengths
Recommended Action
|
5d5779a to
f63cf0f
Compare
|
Merge conflict resolved! |
# Conflicts: # execution/gethexec/addressfilter/hash_store.go # execution/gethexec/sequencer.go # Conflicts: # execution/gethexec/sequencer.go # system_tests/tx_address_filter_test.go
f63cf0f to
38f8b72
Compare
|
rebased on master |
…reporting Add cmd/filtering-report binary with liveness/readiness endpoints - NIT-4766
diegoximenes
left a comment
There was a problem hiding this comment.
Oh, the base branch of the cmd/filtering-report was the branch of this PR.
They are independent PRs, different goals, no need to had this dependency, it complicates the life of the reviewers.
Not sure why you did that.
Address linear NIT-4688.
Propagate addresses-set-id into our addressfilter project