From 9c1e856674caedada778eb56e9690d963f2b37ae Mon Sep 17 00:00:00 2001 From: cawthorne Date: Fri, 17 Apr 2026 13:38:23 +0100 Subject: [PATCH 1/2] fix: normalize OCR3 transmitters in local registry --- .../services/registrysyncer/local_registry.go | 6 +++- .../registrysyncer/local_registry_test.go | 30 +++++++++++++++++-- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/core/services/registrysyncer/local_registry.go b/core/services/registrysyncer/local_registry.go index 730a8c89cc3..1e0cf0aadbc 100644 --- a/core/services/registrysyncer/local_registry.go +++ b/core/services/registrysyncer/local_registry.go @@ -2,6 +2,7 @@ package registrysyncer import ( "context" + "encoding/hex" "errors" "fmt" "math" @@ -116,7 +117,10 @@ func (c CapabilityConfiguration) Unmarshal() (capabilities.CapabilityConfigurati } transmitters := make([]ocrtypes.Account, len(pbCfg.Transmitters)) for i, t := range pbCfg.Transmitters { - transmitters[i] = ocrtypes.Account(t) + // OCR3 transmitter accounts cross the loop boundary as hex-encoded text. + // Keep LocalRegistry aligned with the external OCR config service so the + // imported registry path and the direct registry path serialize the same way. + transmitters[i] = ocrtypes.Account(hex.EncodeToString(t)) } if pbCfg.F > math.MaxUint8 { return capabilities.CapabilityConfiguration{}, fmt.Errorf("OCR3Config %q: F value %d exceeds uint8 max", name, pbCfg.F) diff --git a/core/services/registrysyncer/local_registry_test.go b/core/services/registrysyncer/local_registry_test.go index 32776d4d683..9dabe951acf 100644 --- a/core/services/registrysyncer/local_registry_test.go +++ b/core/services/registrysyncer/local_registry_test.go @@ -186,7 +186,7 @@ func TestCapabilityConfiguration_Unmarshal(t *testing.T) { t.Run("Ocr3Configs", func(t *testing.T) { signer := []byte{0x01, 0x02, 0x03} - transmitter := []byte("0xabc") + transmitter := []byte{0xde, 0xad, 0xbe, 0xef} raw := mustMarshalProto(t, &capabilitiespb.CapabilityConfig{ Ocr3Configs: map[string]*capabilitiespb.OCR3Config{ @@ -209,7 +209,7 @@ func TestCapabilityConfiguration_Unmarshal(t *testing.T) { require.Contains(t, got.Ocr3Configs, "__default__") cfg := got.Ocr3Configs["__default__"] assert.Equal(t, []ocrtypes.OnchainPublicKey{signer}, cfg.Signers) - assert.Equal(t, []ocrtypes.Account{ocrtypes.Account(transmitter)}, cfg.Transmitters) + assert.Equal(t, []ocrtypes.Account{ocrtypes.Account("deadbeef")}, cfg.Transmitters) assert.Equal(t, uint8(2), cfg.F) assert.Equal(t, []byte("onchain"), cfg.OnchainConfig) assert.Equal(t, uint64(5), cfg.OffchainConfigVersion) @@ -217,6 +217,32 @@ func TestCapabilityConfiguration_Unmarshal(t *testing.T) { assert.Equal(t, uint64(3), cfg.ConfigCount) }) + t.Run("Ocr3Configs normalizes transmitters to hex text", func(t *testing.T) { + raw := mustMarshalProto(t, &capabilitiespb.CapabilityConfig{ + Ocr3Configs: map[string]*capabilitiespb.OCR3Config{ + "aptos": { + Transmitters: [][]byte{ + {0x00, 0xff}, + []byte("ascii-bytes"), + }, + }, + }, + }) + cc := CapabilityConfiguration{Config: raw} + + got, err := cc.Unmarshal() + require.NoError(t, err) + + cfg := got.Ocr3Configs["aptos"] + assert.Equal(t, + []ocrtypes.Account{ + ocrtypes.Account("00ff"), + ocrtypes.Account("61736369692d6279746573"), + }, + cfg.Transmitters, + ) + }) + t.Run("OracleFactoryConfigs", func(t *testing.T) { raw := mustMarshalProto(t, &capabilitiespb.CapabilityConfig{ OracleFactoryConfigs: map[string]*valuespb.Map{ From 8643b5a95f2006747d2eb1075f3554c06198c232 Mon Sep 17 00:00:00 2001 From: cawthorne Date: Fri, 17 Apr 2026 14:16:37 +0100 Subject: [PATCH 2/2] test: make OCR3 config assertion explicit --- core/services/registrysyncer/local_registry_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/core/services/registrysyncer/local_registry_test.go b/core/services/registrysyncer/local_registry_test.go index 9dabe951acf..c0b8aa343f7 100644 --- a/core/services/registrysyncer/local_registry_test.go +++ b/core/services/registrysyncer/local_registry_test.go @@ -233,6 +233,7 @@ func TestCapabilityConfiguration_Unmarshal(t *testing.T) { got, err := cc.Unmarshal() require.NoError(t, err) + require.Contains(t, got.Ocr3Configs, "aptos") cfg := got.Ocr3Configs["aptos"] assert.Equal(t, []ocrtypes.Account{