fix: refuse invalid EU registry payloads by default#34
Draft
LKSNDRTMLKV wants to merge 1 commit into
Draft
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 5 |
| Duplication | 4 |
AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
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.
Makes EU registry payload validation fail closed, behind an explicit override.
Draft — do not merge standalone. Implementing this surfaced a structural gap
that has to be closed in the same release. See "Why this is a draft".
What changed
Registration previously logged
"failed B1 validation — sending anyway (pre-go-live)"and submitted regardless. That comment is now stale — theregistry became operational on 20 July 2026, and IR (EU) 2026/1778 Art. 19(2)
obliges the operator to keep registry information "accurate, complete and up to
date at all times", with the registry applying its own conformity checks on
submission (Art. 8(7)).
Now: an invalid payload is refused, with a metric and an error log. The escape
hatch is
EuRegistrySyncConfig::allow_invalid_payloads, wired fromEU_REGISTRY_ALLOW_INVALID_PAYLOADSand off unless explicitly set — the safebehaviour is the one you get by doing nothing. It exists because our local rules
are an interpretation of the spec and may themselves produce a false positive
that shouldn't need a code change to work around.
What this uncovered
Every HTTP-layer register test was submitting a payload that does not
validate. The fixture carried an empty
country_codeanddata_carrier_uri;fail-open meant the only signal was a
warn!nobody asserted on. Five testsfailed the moment refusal was added. The fixture is now realistic.
Why this is a draft
Fixing the fixture only got as far as
operatorId.name.RegistrationPayloadrequires it non-empty, and
RegistrationRequesthas no operator legal-namefield —
mapping.rshardcodesname: String::new(), with a comment alreadyadmitting "the operator legal
nameis not yet threaded through the port".So no registration this node can currently build passes its own validation.
The fail-open was load-bearing for that gap, not merely lax. Merging this alone
would convert a silent defect into a refusal of every registration the moment
anyone sets
EU_REGISTRY_CLIENT_ID.The test suite is green here only because the HTTP-layer tests opt into the
override, each marked with a comment to remove it once the port carries the name.
Recommended sequencing
Bundle with the next core minor, alongside adding an operator legal name to
RegistrationRequest— the same batch asnotify_transfer(&TransferRecord),which is blocked on the same class of gap (a port that cannot express what the
registry requires). Two port fixes, one breaking release, then this becomes
deployable and the test opt-ins come out.
Verification
cargo test -p dpp-node --lib— 38/38. fmt and clippy clean.