fix: normalize OCR3 transmitter encoding in LocalRegistry#22062
fix: normalize OCR3 transmitter encoding in LocalRegistry#22062
Conversation
|
I see you updated files related to
|
|
✅ No conflicts with other open PRs targeting |
There was a problem hiding this comment.
Pull request overview
Risk Rating: HIGH (changes cross-component serialization semantics for OCR3 transmitters, which can affect runtime interoperability)
Normalizes OCR3 transmitter account encoding during LocalRegistry capability config unmarshalling so the registry-sync path produces the same hex-text representation expected across the loop boundary (not raw bytes).
Changes:
- Hex-encode OCR3
TransmittersonCapabilityConfiguration.Unmarshal()viahex.EncodeToString. - Update existing OCR3 config unmarshal test expectations to match hex-text normalization.
- Add a regression test to ensure transmitter bytes (including ASCII bytes) are normalized to hex text.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| core/services/registrysyncer/local_registry.go | Hex-encodes OCR3 transmitters during unmarshal to align producer-side serialization with loop-boundary expectations. |
| core/services/registrysyncer/local_registry_test.go | Updates OCR3 transmitter assertions and adds regression coverage for transmitter normalization behavior. |
Areas needing scrupulous human review:
core/services/registrysyncer/local_registry.goOCR3 transmitter normalization loop (around thehex.EncodeToStringchange): confirm downstream consumers expect no0xprefix and lowercase hex across all relevant chains/capabilities.
|




Summary
LocalRegistryunmarshals CapReg OCR3 configsWhy
Aptos capability startup can fall back to
ConfigForCapability(...)whenp2pToTransmitterMapis not present in the worker JSON config. In staging, that call goes through the external registry syncer intoLocalRegistry, then back across the loop bridge throughchainlink-common.Note:
registrysyncer.LocalRegistryis not just a local-CRE test path; it is also the synced local copy of the external onchain Capabilities Registry used in staging and other non-local environments.chainlink-commonexpects OCR transmitter accounts to be hex-encoded text on that loop boundary, butLocalRegistry.Unmarshal()was reconstructing them as raw bytes insideocrtypes.Account. That leaves the producer and consumer with different expectations and causes the same decode failure we previously worked around inchainlink-common.This fixes the producer-side contract instead of adding another tolerant fallback in the loop bridge.
Testing
GOWORK=off go test ./core/services/registrysyncer -run 'TestCapabilityConfiguration_Unmarshal' -count=1GOWORK=off go test ./core/services/cre -run TestNonExistent -count=1