Skip to content

aptos: tolerate raw OCR transmitter accounts#1931

Closed
cawthorne wants to merge 10 commits intomainfrom
feature/aptos-cap-fix
Closed

aptos: tolerate raw OCR transmitter accounts#1931
cawthorne wants to merge 10 commits intomainfrom
feature/aptos-cap-fix

Conversation

@cawthorne
Copy link
Contributor

Summary

  • tolerate raw Aptos OCR transmitter account encodings in the capabilities registry decoder
  • preserve hex decoding for existing hex-form transmitters
  • add coverage for both forms

Why

The merged Aptos consensus-backed read capability depends on OCR config handling during worker startup. Local CRE Aptos runs can still emit raw transmitter account bytes here, so strict hex-only decoding breaks capability startup before reads can execute.

Testing

  • GOWORK=off go test ./pkg/loop/internal/core/services/capability -run "TestCapabilitiesRegistry|TestTransmitterAccountToBytes" -count=1

@github-actions
Copy link

github-actions bot commented Mar 26, 2026

📊 API Diff Results

No changes detected for module github.com/smartcontractkit/chainlink-common

View full report

@cawthorne cawthorne marked this pull request as ready for review March 26, 2026 13:33
@cawthorne cawthorne requested a review from a team as a code owner March 26, 2026 13:33
Copilot AI review requested due to automatic review settings March 26, 2026 13:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the capabilities registry OCR3 transmitter decoding to accept both hex-encoded accounts (including 0x/0X-prefixed forms) and raw transmitter account bytes, preventing Aptos OCR startup failures when raw bytes are emitted.

Changes:

  • Add tolerant OCR3 transmitter decoding via transmitterAccountToBytes (supports 0x/0X prefix, preserves existing unprefixed hex behavior, falls back to raw bytes).
  • Update ConfigForCapability to use the new transmitter decoding helper.
  • Add unit tests covering prefixed hex decoding, invalid prefixed hex errors, and raw-byte fallback.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
pkg/loop/internal/core/services/capability/capabilities_registry.go Introduces tolerant transmitter decoding and wires it into OCR3 config serialization.
pkg/loop/internal/core/services/capability/capabilities_registry_test.go Adds unit tests for the new transmitter decoding behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

jmank88
jmank88 previously approved these changes Mar 26, 2026
Co-authored-by: ilija42 <57732589+ilija42@users.noreply.github.com>
Copy link
Contributor

@ilija42 ilija42 left a comment

Choose a reason for hiding this comment

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

After looking at the surrounding code and git history, I'm not sure why we can't just leave the same decoding, why are we passing differently formatted address in now?

@cawthorne cawthorne closed this Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants