Skip to content

fix(images): compile NEAR into the parser_app enclave binary - #464

Merged
prasanna-anchorage merged 1 commit into
mainfrom
shahankhatchadourian/near-containerfile-chain-features
Aug 7, 2026
Merged

fix(images): compile NEAR into the parser_app enclave binary#464
prasanna-anchorage merged 1 commit into
mainfrom
shahankhatchadourian/near-containerfile-chain-features

Conversation

@shahan-khatchadourian-anchorage

Copy link
Copy Markdown
Contributor

Follow-up to #430, per prasanna's approval note.

images/parser_app/Containerfile:19 lists the chain visualizers compiled into the enclave image:

ARG CHAIN_FEATURES="ethereum solana sui tron unspecified"

CARGOFLAGS (line 5) passes --no-default-features, so this list is authoritative — a chain absent from it is not linked into the binary. parser_app's default feature set is ["ethereum", "near", "solana", "sui", "tron", "unspecified"], so the image shipped without NEAR support even though #430 makes NEAR reachable over gRPC. This adds near, restoring the mirror the surrounding comment describes.

Why this fails at runtime rather than at build time

  • src/parser/app/src/chain_conversion.rs:12 maps ProtoChain::Near => RegistryChain::Near with no #[cfg] gate.
  • src/parser/app/src/registry.rs:37 gates the converter registration behind #[cfg(feature = "near")].

Without the feature the image builds clean, deploys clean and passes CI. A CHAIN_NEAR request then resolves its chain successfully, finds no registered converter, and fails — only in production, only once a real NEAR transaction arrives.

Notes

CHAIN_FEATURES appears in this one file and nowhere else — no Makefile override and no check comparing it against the crate's default set, so nothing would have caught the drift. A guard test is deliberately left out here to keep the fix to the one line; worth raising separately if the drift recurs.

Also flagged as MEDIUM by @pepe-anchor on #430 (2026-08-05).

🤖 Generated with Claude Code

CARGOFLAGS passes --no-default-features, so CHAIN_FEATURES is the
authoritative list of chains linked into the image. It omitted near while
parser_app's default feature set includes it, so the enclave binary shipped
without a NEAR converter.

proto_to_registry maps ProtoChain::Near unconditionally, but the registry
registration is behind #[cfg(feature = "near")]. Without the feature the image
builds and deploys clean and only fails when a real NEAR request arrives: the
chain resolves and no converter is registered.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

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.

Pull request overview

Ensures the parser_app enclave image actually links NEAR support by including the near feature in the CHAIN_FEATURES list used for the --no-default-features build, preventing runtime “no registered converter” failures for CHAIN_NEAR requests.

Changes:

  • Add near to CHAIN_FEATURES in the enclave image build so it mirrors src/parser/app/Cargo.toml’s default feature set.
  • Restore NEAR converter availability in production images built from images/parser_app/Containerfile.

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

@prasanna-anchorage
prasanna-anchorage merged commit e581059 into main Aug 7, 2026
20 checks passed
@prasanna-anchorage
prasanna-anchorage deleted the shahankhatchadourian/near-containerfile-chain-features branch August 7, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants