Skip to content

feat: add Axelar GMP proof oracle - #133

Merged
reednaa merged 20 commits into
mainfrom
feat/axelar-oracle
Oct 29, 2026
Merged

reednaa merged 20 commits into
mainfrom
feat/axelar-oracle

Conversation

@reednaa

@reednaa reednaa commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

EVM side of the cross-VM proof transport (counterparts: lifi-intent-svm #129, intent-soroban #1). Branched from main. LayerZero is in #137.

Contracts

  • AxelarOracle: submit checks IAttester(source).hasAttested(payloads), encodes with MessageEncodingLib, and calls the gateway. DeliveryMode.Relayed requires msg.value > 0 and pays it to the gas service (refund to msg.sender); SelfRelay requires zero value and skips the gas service. A nonzero destinationConfig wraps the message in the Solana envelope. recipientOracle is passed through unchecked; a wrong recipient loses only that delivery and can be resubmitted.
  • execute is permissionless but records proofs only after gateway.validateContractCall approves the exact (commandId, sourceChain, sourceAddress, keccak256(payload)). The original strings go to the gateway; the lowercased chain key goes to the chain map.
  • AxelarStrings: chain name ↔ chain-map key (ASCII-lowercased, packed left-aligned, 1–32 bytes, no NUL) and address string → bytes32. The address format is inferred from shape: 0x + 40 hex (EVM, left-padded), 56-char contract StrKey with CRC16-XModem checksum (Stellar), or canonical 32-byte base58 via OpenZeppelin Base58 (Solana). Chain names, EVM and StrKey are decoded a word at a time.
  • SolanaEnvelope: Axelar 1.1.1 ExecutablePayload Borsh layout with the destination config as the single read-only, non-signer account; message length bounded to 36 + 320 bytes.
  • Chain maps reuse the shared ChainMap (setChainMap is now public virtual). AxelarOracle.setChainMap(key, chainId) is onlyOwner, set-once and bijective, and rejects keys that are not packed lowercase names. Renouncing ownership freezes the map. No upgrade, pause or withdrawal.
  • MessageEncodingLib: reject trailing message bytes (TrailingMessageBytes).

Scripts: script/AxelarOracle.s.sol (CREATE2 deploy, no chain maps) and script/AxelarChainMap.s.sol (one route per call; refuses non-lowercase names before broadcasting). Usage is in the README.

Tests (test/oracle/axelar/): oracle unit and flow tests against a gateway fixture, AxelarStrings chain-name and address tests, differential tests against a reference decoder (OracleAddressReference), and symbolic AxelarStrings properties (solver settings in foundry.toml).

Verification (local): forge test 538 passed, 0 failed.

Not done: live provider delivery. Audit pending.

Adds transparent Axelar (paid/self-relay, Solana executable envelope, strict base58/StrKey identities) and LayerZero V2 oracles with constructor-only bounded chain mappings, plus Stellar transport tests. MessageEncodingLib now rejects trailing message bytes.
@reednaa reednaa changed the title feat: add Axelar GMP and LayerZero V2 proof oracles feat: add Axelar GMP proof oracle Oct 2, 2026
@reednaa
reednaa marked this pull request as ready for review October 2, 2026 12:25
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-02T12:26:56.228078Z 42b3632 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Drop MappedOracle/BoundedOracle. The oracle now inherits ChainMap with the
key being the ASCII-lowercased Axelar name packed left-aligned into a
uint256, so reverseChainIdMap yields the name.

- submit takes the destination OIF chain ID and the recipient's Axelar
  address string; a nonzero destinationConfig selects the Solana envelope.
- execute infers the sender format (0x hex, Stellar StrKey, Solana base58)
  and records proofs like HyperlaneOracle.
- Names are 1-32 bytes without NUL, no character set imposed; packing lives
  in the AxelarChainName library (word-at-a-time lowercasing).
- No Stellar message limits on EVM; destinations enforce their own.
- ChainMap.setChainMap is public virtual so the oracle can validate keys.
- OracleAddress moves to axelar/ and is decode-only.
- Chain-map script takes (oracle, name, chainId); README updated.
- Axelar tests move to test/oracle/axelar, with exhaustive key tests.
…ime decoding

- AxelarStrings replaces AxelarChainName and OracleAddress: chainKey,
  chainName, decodeAddress; error names (and selectors) unchanged.
- decodeAddress decodes EVM hex and Stellar StrKeys a word at a time
  with a one-word nibble-table CRC16 (EVM 14.2k -> 1.0k gas, Stellar
  57.5k -> 7.7k). Solana base58 is unchanged.
- Differential tests against the per-character reference decoder:
  every byte at every position, every length 0-100, calldata padding
  junk, single-bit IDs, real mainnet StrKeys, fuzzing.
- Chain-name sweep computes expectations in O(1) so it fits the gas
  cap under forge coverage (CI coverage step was out of gas).
- AxelarChainMap script rejects non-canonical names before broadcast.
Forge-native `--symbolic` properties comparing AxelarStrings with
independent branch-free specs: chain-name packing, unpacking and setter
canonicality; EVM address decoding; dispatch rejection; Stellar
bad-shape rejection; and a fixed-id Stellar round trip with symbolic
trailing calldata. Pins `[profile.default.symbolic]` and documents the
local-only run and forge 1.8.4's CRC limit in the README.
reednaa and others added 2 commits October 29, 2026 09:32
setChainMap accepted any 1-32-byte name without NUL or ASCII uppercase.
Axelar's ChainNameRaw only admits 1-20 ASCII bytes without '_', and the
chain map is set-once in both directions, so mapping a name Axelar
cannot route permanently consumed the OIF chain ID.

Enforce the ChainNameRaw grammar in setChainMap on top of the existing
packing check. Inbound lookup, submit and execute are unchanged.

Addresses sujithsomraaj/lifi-intent-audit-oct-26#1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@reednaa
reednaa merged commit 8de4ce0 into main Oct 29, 2026
2 checks passed
@reednaa
reednaa deleted the feat/axelar-oracle branch October 29, 2026 10:51
reednaa added a commit that referenced this pull request Oct 29, 2026
Independent differential review by Sujith Somraaj (20-29 October 2026) of
the Axelar GMP oracle (#133, scoped at e57f0b2) and the Chainlink CCIP
oracle (#138, scoped at b382bb1), both against base 7e32479.
1 Low and 2 Informational findings:
- Low 6.1.1 (AxelarOracle accepts chain names Axelar rejects): fixed in
  8e3efc7, verified.
- Info 6.2.1 (vendored CCIP receiver interface names OffRampRouter):
  fixed in 254835c, verified.
- Info 6.2.2 (default CCIP destination gas not sized to batch):
  acknowledged; callers size their own extraArgs.
Solana and Stellar counterpart programs were out of scope.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant