Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func decodeOcr3Config(pbCfg *capabilitiespb.OCR3Config) ocrtypes.ContractConfig
}
transmitters := make([]ocrtypes.Account, len(pbCfg.Transmitters))
for i, t := range pbCfg.Transmitters {
transmitters[i] = ocrtypes.Account(hex.EncodeToString(t))
transmitters[i] = ocrtypes.Account(t)
}
Comment on lines 246 to 249
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change switches the in-process representation of ocrtypes.ContractConfig.Transmitters from a hex string (previously produced via hex.EncodeToString) to a raw-byte string (ocrtypes.Account(t) where t is protobuf []byte). Because ocrtypes.Account is a string type, this is a behavioral/API change for any downstream code that expects human-readable/hex transmitter addresses, and mixed-version plugin/core deployments (Hashicorp go-plugin handshake here doesn’t enforce a protocol version) could silently disagree on the encoding. Consider adding a transitional decode that accepts both formats (e.g., if the string is valid hex then decode, otherwise treat as raw bytes), or document/guard the change with an explicit versioned capability/handshake so incompatible components fail fast.

Copilot uses AI. Check for mistakes.
return ocrtypes.ContractConfig{
ConfigCount: pbCfg.ConfigCount,
Expand Down Expand Up @@ -512,9 +512,11 @@ func (c *capabilitiesRegistryServer) ConfigForCapability(ctx context.Context, re
}
transmitters := make([][]byte, len(cfg.Transmitters))
for i, t := range cfg.Transmitters {
transmitters[i], err = hex.DecodeString(string(t))
if err != nil {
return nil, fmt.Errorf("failed to decode transmitter: %w", err)
decoded, hexErr := hex.DecodeString(string(t))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the discussion that we had it sounds like hex.DecodeString never works because the transmitter string isn't in hex, so If the transmitter is base64 encoded lets just decode it here into a hex string and keep it in that format.

if hexErr == nil {
transmitters[i] = decoded
} else {
transmitters[i] = []byte(t)
}
}
Comment on lines 513 to 521
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By switching from hex.DecodeString(string(t)) to []byte(t), the server now treats cfg.Transmitters as containing raw address bytes encoded directly in a string. If any current core.CapabilitiesRegistry implementations still populate cfg.Transmitters as hex strings (as implied by the prior implementation), this will put ASCII hex on the wire rather than the intended raw bytes and won’t error anymore, leading to hard-to-debug misconfiguration. Consider supporting both encodings during rollout (decode hex when applicable), or enforce/validate the expected format (e.g., reject obvious hex strings when raw bytes are required, or add an explicit migration/version check).

Copilot uses AI. Check for mistakes.
ccp.Ocr3Configs[key] = &capabilitiespb.OCR3Config{
Expand Down
Loading