Skip to content

feat: axelar oracle#137

Open
aalimsahin wants to merge 19 commits into
openintentsframework:mainfrom
aalimsahin:axelar-oracle
Open

feat: axelar oracle#137
aalimsahin wants to merge 19 commits into
openintentsframework:mainfrom
aalimsahin:axelar-oracle

Conversation

@aalimsahin

@aalimsahin aalimsahin commented Oct 8, 2025

Copy link
Copy Markdown

Description

This PR implements an Axelar-based oracle for cross-chain message attestation.

Oracle Implementation:

  • Extends BaseInputOracle for standardized attestation storage
  • Inherits ChainMap for protocol endpoint ID to canonical chain ID mapping
  • Uses MinimalOApp for ownerless LayerZero V2 integration

Public Interface:

  • submit() - Sends attested payloads cross-chain via Axelar General Message Passing Protocol
  • execute() - Receives and stores cross-chain attestations
  • setChainMap() - Maps Axelar chain names to canonical chain IDs (owner-only)

Design Decisions:

  • Payment for sending message: Payments for sending crosschain messages with Axelar can be made on both the source and destination chains. If the payment is made on the source chain, the message is triggered directly on the destination chain. However, there are two ways to calculate the payment amount: either through an onchain contract or offchain. I didn't include the onchain calculation because the documentation recommends offchain one.

Related Issues

There is no related issue.

Third-Party Integration Checklist

⚠️ CRITICAL: All third-party integrations must follow strict dependency guidelines

  • No external library imports - Confirmed no new dependencies added to foundry.toml
  • Interfaces copied locally - All required interfaces copied to src/oracles/[oracle-type]/external/[protocol-name]/
  • Proper documentation - Each copied interface includes source header with:
    • Protocol name and version
    • Original source URL
    • Commit hash and copy date
    • List of any modifications made
  • Self-contained - Integration works with only repository code
  • Minimal interfaces - Only copied the specific methods/events needed

Additional Notes

Summary by CodeRabbit

Release Notes

  • New Features

    • Added Axelar cross-chain oracle integration with gateway and gas service support.
  • Style

    • Improved code formatting and comment consistency across the codebase.
  • Tests

    • Added comprehensive test suite for Axelar oracle functionality.
  • Chores

    • Updated oracle metric snapshots and settlement output values.

✏️ Tip: You can customize this high-level summary in your review settings.

@reednaa reednaa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks fine to me.

Before we merge, we should consider a way to display which contracts (including oracles) have been audited and which have not.

Comment on lines +70 to +73
if (source == address(0)) revert InvalidAddress();
if (payloads.length == 0) revert EmptyPayloadsNotAllowed();

if (!IAttester(source).hasAttested(payloads)) revert NotAllPayloadsValid();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

(Opinion) Should be implemented in the outer submit function. The inner function is (mainly) concerned with messaging layer logic.

Comment on lines +83 to +85
function gateway() public view returns (IAxelarGateway) {
return IAxelarGateway(gatewayAddress);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Some strange code inherited from Axalar 😅

@codecov

codecov Bot commented Oct 13, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@aalimsahin aalimsahin requested a review from reednaa October 13, 2025 22:28
@coderabbitai

coderabbitai Bot commented Dec 26, 2025

Copy link
Copy Markdown

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key(s) in object: 'enabled'
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
📝 Walkthrough

Walkthrough

This pull request introduces a new Axelar oracle integration alongside comprehensive test coverage, snapshot value updates, and widespread comment formatting normalizations. The Axelar implementation adds cross-chain oracle capabilities via external Axelar interfaces and libraries, while the formatting changes standardize comment alignment across the codebase without functional impact.

Changes

Cohort / File(s) Summary
Axelar Oracle Integration
src/integrations/oracles/axelar/AxelarOracle.sol, src/integrations/oracles/axelar/external/axelar/executable/AxelarExecutable.sol, src/integrations/oracles/axelar/external/axelar/interfaces/IAxelarExecutable.sol, src/integrations/oracles/axelar/external/axelar/interfaces/IAxelarGasService.sol, src/integrations/oracles/axelar/external/axelar/interfaces/IAxelarGateway.sol, src/integrations/oracles/axelar/external/axelar/interfaces/IContractIdentifier.sol, src/integrations/oracles/axelar/external/axelar/interfaces/IImplementation.sol, src/integrations/oracles/axelar/external/axelar/interfaces/IInterchainGasEstimation.sol, src/integrations/oracles/axelar/external/axelar/interfaces/IOwnable.sol, src/integrations/oracles/axelar/external/axelar/interfaces/IUpgradable.sol, src/integrations/oracles/axelar/external/axelar/libs/AddressString.sol, src/integrations/oracles/axelar/external/axelar/mocks/MockAxelarGasService.sol, src/integrations/oracles/axelar/external/axelar/mocks/MockAxelarGateway.sol, src/integrations/oracles/axelar/external/axelar/types/GasEstimationTypes.sol
New Axelar oracle implementation with submit/execute flows, comprehensive interface definitions (gateway, gas service, executable), address-string conversion utilities, type definitions for gas estimation, and mock contracts for testing.
Snapshot Updates
snapshots/oracle.json, snapshots/outputSettler.json
Oracle metrics replace Bitcoin/Citrea/Hyperlane/Wormhole entries with new Axelar keys; outputSettler values updated across all CoinFill-related keys.
Comment Formatting Standardization
src/input/compact/InputSettlerCompact.sol, src/input/escrow/InputSettlerEscrow.sol, src/input/types/MandateOutputType.sol, src/integrations/CatsMulticallHandler.sol, src/integrations/oracles/bitcoin/BitcoinOracle.sol, src/integrations/oracles/bitcoin/external/interfaces/BtcStructs.sol, src/integrations/oracles/bitcoin/external/library/BtcScript.sol, src/integrations/oracles/hyperlane/external/hyperlane/interfaces/hooks/IPostDispatchHook.sol, src/integrations/oracles/hyperlane/external/hyperlane/libs/StandardHookMetadata.sol, src/integrations/oracles/polymer/external/core/prove_api/CrossL2ProverV2.sol, src/integrations/oracles/polymer/external/core/prove_api/SequencerSignatureVerifier.sol, src/integrations/oracles/polymer/external/libs/ReceiptParser.sol, src/integrations/oracles/polymer/external/mocks/MockCrossL2ProverV2.sol, src/integrations/oracles/polymer/external/optimism/rlp/RLPReader.sol, src/integrations/oracles/wormhole/external/callworm/WormholeVerifier.sol, src/integrations/oracles/wormhole/external/wormhole/Messages.sol, src/integrations/oracles/wormhole/external/wormhole/libraries/external/BytesLib.sol, src/libs/MandateOutputEncodingLib.sol, src/libs/MessageEncodingLib.sol, src/oracles/BaseInputOracle.sol, src/output/simple/FillerDataLib.sol, src/output/simple/FulfilmentLib.sol, test/input/BaseSettler.t.sol, test/input/BaseSettler.timestamps.t.sol, test/integration/SettlerCompact.crosschain.t.sol, test/libs/MessageEncodingLib.t.sol, test/oracle/bitcoin/BitcoinOracle.t.sol, test/oracle/bitcoin/CitreaOracle.t.sol
Cosmetic normalization of section header comments, spacing adjustments, and minor ASCII art alignment. No functional impact.
Axelar Oracle Test Suite
test/oracle/axelar/AxelarOracle.t.sol
Comprehensive Forge tests covering submit/execute flows, validation error paths, payload encoding/decoding, and mock gateway/gas service interactions.
Test Data Updates
test/oracle/bitcoin/blocksinfo.t.sol
Addition of next-block transaction constants (NEXT_TX_ID, NEXT_TX_INDEX, NEXT_TX_MERKLE_PROOF, NEXT_RAW_TX, NEXT_SATS_AMOUNT, NEXT_BLOCK_TIME).

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant AxelarOracle
    participant IAttester as IAttester<br/>(Validator)
    participant GasService
    participant Gateway
    participant Destination

    rect rgb(200, 220, 255)
        Note over Client,Destination: Submit Flow
        Client->>AxelarOracle: submit(chain, addr, source, payloads[])
        AxelarOracle->>IAttester: Validate all payloads attested
        alt Not all payloads valid
            AxelarOracle-->>Client: NotAllPayloadsValid()
        end
        AxelarOracle->>AxelarOracle: _submit() - encode message
        AxelarOracle->>GasService: payNativeGasForContractCall()
        activate GasService
        GasService-->>AxelarOracle: ✓ gas paid
        deactivate GasService
        AxelarOracle->>Gateway: callContract(chain, addr, encoded)
        activate Gateway
        Gateway-->>AxelarOracle: ✓ message broadcast
        deactivate Gateway
    end

    rect rgb(220, 255, 220)
        Note over Client,Destination: Execute Flow
        Gateway->>AxelarOracle: execute(commandId, sourceChain, sourceAddr, payload)
        AxelarOracle->>Gateway: validateContractCall()
        alt Not approved
            Gateway-->>AxelarOracle: NotApprovedByGateway()
        end
        AxelarOracle->>AxelarOracle: Extract app hash & payload hashes<br/>Record attestations
        AxelarOracle->>Client: OutputProven event
        activate Client
        Client-->>AxelarOracle: ✓ processed
        deactivate Client
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

The changes introduce substantial new Axelar integration logic (contract, interfaces, libraries, mocks, tests) requiring careful review of cross-chain message flow, gateway validation, and gas service integration. However, the majority of the diff consists of repetitive comment formatting across many files (low-effort per file), and the new test suite follows clear patterns. The Axelar contract implementation itself is straightforward without complex state mutations or intricate error paths.

Suggested reviewers

  • frangio

Poem

🐰 A cross-chain bridge now hops through Axelar's path,
With formatted comments—no formatting wrath!
Gas services paid, and messages sealed,
Oracle attestations perfectly healed.
From Bitcoin to Axelar, the network expands,
One more oracle oracle in code's helping hands! 🌉

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: axelar oracle' clearly and concisely summarizes the main change: introducing Axelar oracle functionality.
Description check ✅ Passed The PR description provides clear implementation details, public interface explanation, design decisions, and completes the third-party integration checklist with all items verified.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
test/input/BaseSettler.timestamps.t.sol (1)

6-8: Duplicate import of InputSettlerBase.

InputSettlerBase is imported on both line 6 and line 8.

🔎 Proposed fix
 import { InputSettlerBase } from "../../src/input/InputSettlerBase.sol";
-
-import { InputSettlerBase } from "../../src/input/InputSettlerBase.sol";
🧹 Nitpick comments (4)
src/integrations/oracles/hyperlane/external/hyperlane/libs/StandardHookMetadata.sol (1)

4-14: Minor documentation consistency: "verbatim copy" status compromised by spacing change.

The file header declares this a verbatim copy of Hyperlane's StandardHookMetadata (lines 27–30, commit d0d8049c13140b9230c60415a445da9048bb1caa), but the ASCII art spacing has been adjusted. While this is purely cosmetic and doesn't affect functionality, it technically breaks the verbatim claim. Consider either reverting the spacing to match the original exactly, or updating the comment to indicate the copy includes minor formatting adjustments.

src/integrations/oracles/wormhole/external/callworm/WormholeVerifier.sol (1)

191-202: Remove commented-out code.

This large block of commented-out code should be removed entirely rather than left in the source. Git history preserves the old implementation if reference is needed later.

🔎 Proposed fix
-            // signatures = new Structs.Signature[](signersLen);
-            // for (uint i = 0; i < signersLen; ++i) {
-            //     signatures[i].guardianIndex = uint8(bytes1(encodedVM[index:index+1]));
-            //     index += 1;
-
-            //     signatures[i].r = bytes32(encodedVM[index:index+32]);
-            //     index += 32;
-            //     signatures[i].s = bytes32(encodedVM[index:index+32]);
-            //     index += 32;
-            //     signatures[i].v = uint8(bytes1(encodedVM[index:index+1])) + 27;
-            //     index += 1;
-            //}
src/integrations/oracles/axelar/external/axelar/mocks/MockAxelarGasService.sol (1)

10-22: Consider tracking msg.value for more comprehensive test assertions.

The mock currently only counts calls. For tests that need to verify the correct gas payment amount was sent, tracking msg.value could be useful.

🔎 Optional enhancement
 contract MockAxelarGasService {
     uint256 public paidGasCounter;
+    uint256 public totalGasPaid;

     function payNativeGasForContractCall(
         address,
         string calldata,
         string calldata,
         bytes calldata,
         address
     ) external payable {
         paidGasCounter += 1;
+        totalGasPaid += msg.value;
     }
 }
test/oracle/axelar/AxelarOracle.t.sol (1)

286-287: Unnecessary vm.prank before mock helper call.

The vm.prank(address(_axelarGateway)) at line 286 is unnecessary since approveContractCall is a test helper on MockAxelarGateway that doesn't check msg.sender. The prank has no effect here and may confuse future readers.

🔎 Suggested simplification
-        vm.prank(address(_axelarGateway));
         _axelarGateway.approveContractCall(_commandId, _origin, messageSender.toString(), messageHash);
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 035fa57 and 2c9c26e.

📒 Files selected for processing (46)
  • snapshots/oracle.json
  • snapshots/outputSettler.json
  • src/input/compact/InputSettlerCompact.sol
  • src/input/escrow/InputSettlerEscrow.sol
  • src/input/types/MandateOutputType.sol
  • src/integrations/CatsMulticallHandler.sol
  • src/integrations/oracles/axelar/AxelarOracle.sol
  • src/integrations/oracles/axelar/external/axelar/executable/AxelarExecutable.sol
  • src/integrations/oracles/axelar/external/axelar/interfaces/IAxelarExecutable.sol
  • src/integrations/oracles/axelar/external/axelar/interfaces/IAxelarGasService.sol
  • src/integrations/oracles/axelar/external/axelar/interfaces/IAxelarGateway.sol
  • src/integrations/oracles/axelar/external/axelar/interfaces/IContractIdentifier.sol
  • src/integrations/oracles/axelar/external/axelar/interfaces/IImplementation.sol
  • src/integrations/oracles/axelar/external/axelar/interfaces/IInterchainGasEstimation.sol
  • src/integrations/oracles/axelar/external/axelar/interfaces/IOwnable.sol
  • src/integrations/oracles/axelar/external/axelar/interfaces/IUpgradable.sol
  • src/integrations/oracles/axelar/external/axelar/libs/AddressString.sol
  • src/integrations/oracles/axelar/external/axelar/mocks/MockAxelarGasService.sol
  • src/integrations/oracles/axelar/external/axelar/mocks/MockAxelarGateway.sol
  • src/integrations/oracles/axelar/external/axelar/types/GasEstimationTypes.sol
  • src/integrations/oracles/bitcoin/BitcoinOracle.sol
  • src/integrations/oracles/bitcoin/external/interfaces/BtcStructs.sol
  • src/integrations/oracles/bitcoin/external/library/BtcScript.sol
  • src/integrations/oracles/hyperlane/external/hyperlane/interfaces/hooks/IPostDispatchHook.sol
  • src/integrations/oracles/hyperlane/external/hyperlane/libs/StandardHookMetadata.sol
  • src/integrations/oracles/polymer/external/core/prove_api/CrossL2ProverV2.sol
  • src/integrations/oracles/polymer/external/core/prove_api/SequencerSignatureVerifier.sol
  • src/integrations/oracles/polymer/external/libs/ReceiptParser.sol
  • src/integrations/oracles/polymer/external/mocks/MockCrossL2ProverV2.sol
  • src/integrations/oracles/polymer/external/optimism/rlp/RLPReader.sol
  • src/integrations/oracles/wormhole/external/callworm/WormholeVerifier.sol
  • src/integrations/oracles/wormhole/external/wormhole/Messages.sol
  • src/integrations/oracles/wormhole/external/wormhole/libraries/external/BytesLib.sol
  • src/libs/MandateOutputEncodingLib.sol
  • src/libs/MessageEncodingLib.sol
  • src/oracles/BaseInputOracle.sol
  • src/output/simple/FillerDataLib.sol
  • src/output/simple/FulfilmentLib.sol
  • test/input/BaseSettler.t.sol
  • test/input/BaseSettler.timestamps.t.sol
  • test/integration/SettlerCompact.crosschain.t.sol
  • test/libs/MessageEncodingLib.t.sol
  • test/oracle/axelar/AxelarOracle.t.sol
  • test/oracle/bitcoin/BitcoinOracle.t.sol
  • test/oracle/bitcoin/CitreaOracle.t.sol
  • test/oracle/bitcoin/blocksinfo.t.sol
🔇 Additional comments (66)
src/integrations/oracles/hyperlane/external/hyperlane/interfaces/hooks/IPostDispatchHook.sol (1)

4-14: Verify intentionality of formatting changes to external code.

The ASCII art header (lines 4–14) has been reformatted for spacing. Since this file contains copied external Hyperlane interfaces, clarify whether this formatting change is intentional or an artifact. Keeping external code unmodified (except where necessary) helps with maintenance and tracking upstream changes.

If the change is intentional, it's acceptable but non-functional. If unintentional, consider reverting to preserve alignment with the upstream Hyperlane codebase.

src/integrations/oracles/polymer/external/mocks/MockCrossL2ProverV2.sol (1)

158-161: Comment formatting updates for clarity.

The comments on lines 158 and 160 have been adjusted to better document the proof structure assignments. These are purely documentation changes with no impact on the contract logic.

src/output/simple/FillerDataLib.sol (2)

12-12: Documentation formatting improvement.

Removing excess whitespace in the byte layout comment improves readability without changing substance. The byte offset and size description remain accurate.


20-26: Clean assembly implementation.

The use of "memory-safe" assembly with calldataload is appropriate and correct. The function properly extracts the 32-byte proposed solver from the calldata offset as documented.

test/integration/SettlerCompact.crosschain.t.sol (1)

428-428: No concerns—formatting normalization only.

These changes normalize comment spacing (adding a space after //) on previously commented-out code. No functional impact to the test logic.

Also applies to: 432-432

src/integrations/oracles/wormhole/external/wormhole/Messages.sol (1)

73-79: Editorial change—code logic unaffected.

The warning comment formatting has been updated without any change to underlying logic or behavior. The verifyVMInternal function correctly validates guardian sets, enforces quorum, and verifies signatures.

src/integrations/oracles/polymer/external/libs/ReceiptParser.sol (1)

64-71: LGTM – comment formatting only.

These changes are purely cosmetic adjustments to the indentation/alignment of the inline documentation for the Log struct. No executable code or logic is affected.

src/integrations/oracles/polymer/external/optimism/rlp/RLPReader.sol (1)

33-33: Documentation formatting improvements approved.

The normalization of spacing in natspec documentation for the ptr field (line 33) and _src parameter (line 240) improves consistency without affecting functionality or API contract. External code attribution and provenance remain properly documented.

Also applies to: 240-240

src/integrations/oracles/wormhole/external/wormhole/libraries/external/BytesLib.sol (1)

263-271: Comment-only formatting changes—low-impact but verify scope.

All changes in this file are inline comment reformatting (whitespace and text alignment). The library's logic, behavior, and public API are unchanged. However, since this is external third-party code (BytesLib by ConsenSys), please clarify whether these formatting updates are in scope for the Axelar oracle PR, or if they are part of a broader codebase-wide comment normalization effort.

Also applies to: 420-420, 484-484

src/integrations/oracles/wormhole/external/callworm/WormholeVerifier.sol (1)

60-60: Verify the relationship between these Wormhole changes and the Axelar oracle PR.

This PR is described as implementing an Axelar-based oracle, but these changes are in the Wormhole verifier. The modifications (comment edit on line 60 and signature parsing refactor on lines 191-202) appear unrelated to Axelar integration.

Please confirm whether:

  1. These changes are intentionally bundled in this PR
  2. The signature parsing refactor has been tested with existing Wormhole oracle functionality
  3. There's a dependency between the Wormhole changes and the Axelar implementation

Also applies to: 191-202

src/integrations/oracles/polymer/external/core/prove_api/SequencerSignatureVerifier.sol (1)

70-70: LGTM: Comment formatting improvement.

This whitespace adjustment improves comment readability with no functional impact.

test/oracle/bitcoin/BitcoinOracle.t.sol (1)

84-86: LGTM: Test comment formatting standardization.

These changes standardize comment headers and fix TODO spacing throughout the test file with no impact on test logic or coverage.

Also applies to: 249-249, 519-519, 728-728, 986-986, 1057-1057

src/oracles/BaseInputOracle.sol (1)

27-27: LGTM: Comment header formatting improvement.

Standardizes comment header spacing with no functional impact on the attestation storage implementation.

test/libs/MessageEncodingLib.t.sol (1)

27-33: LGTM: Formatting of commented-out code.

These indentation adjustments improve readability of the commented-out test block with no impact on active test logic.

src/input/escrow/InputSettlerEscrow.sol (1)

184-186: LGTM: Documentation and comment formatting improvements.

These changes improve comment readability and parameter documentation formatting with no impact on escrow, deposit, or signature handling logic.

Also applies to: 307-314, 445-445

src/integrations/oracles/bitcoin/BitcoinOracle.sol (1)

149-149: LGTM: Comment header formatting standardization.

These changes standardize section header spacing with no impact on the Bitcoin oracle verification, claim, or dispute logic.

Also applies to: 212-212

src/integrations/oracles/bitcoin/external/interfaces/BtcStructs.sol (1)

16-16: LGTM: Comment formatting improvement.

This change adds proper spacing after the comment marker with no impact on the struct definitions.

src/input/compact/InputSettlerCompact.sol (1)

197-197: LGTM: Comment header formatting standardization.

Standardizes section header spacing with no impact on the Compact integration or resource lock logic.

src/integrations/CatsMulticallHandler.sol (1)

36-36: LGTM!

Comment spacing normalization aligns with the broader formatting cleanup in this PR.

test/input/BaseSettler.t.sol (3)

88-88: LGTM!

Section header comment formatting is consistent with PR's style normalization.


271-271: LGTM!

Section header formatting aligns with codebase conventions.


500-500: LGTM!

Consistent section header formatting.

test/input/BaseSettler.timestamps.t.sol (1)

34-34: LGTM!

Section header formatting is consistent with the PR's style normalization.

src/libs/MandateOutputEncodingLib.sol (1)

17-35: LGTM!

Documentation formatting is cleaner and more readable. The encoding schema layout accurately reflects the data structure.

src/integrations/oracles/bitcoin/external/library/BtcScript.sol (2)

35-35: LGTM!

Section header formatting is consistent.


134-134: LGTM!

Section header formatting matches the decode helpers section above.

src/output/simple/FulfilmentLib.sol (1)

14-32: LGTM!

Documentation reformatting improves readability while maintaining accurate byte layout descriptions.

test/oracle/bitcoin/CitreaOracle.t.sol (9)

94-96: LGTM!

Comment formatting is consistent with PR's style normalization.


259-259: LGTM!

Section header formatting is consistent.


529-529: LGTM!

Section header formatting is consistent.


738-738: LGTM!

Section header formatting is consistent.


996-997: LGTM!

Commented-out code formatting is consistent.


1067-1067: LGTM!

Commented-out code formatting is consistent.


1626-1626: LGTM!

Commented-out code formatting is consistent.


1678-1678: LGTM!

Commented-out code formatting is consistent.


1725-1725: LGTM!

Commented-out code formatting is consistent.

src/integrations/oracles/polymer/external/core/prove_api/CrossL2ProverV2.sol (3)

55-81: LGTM!

Proof bytes layout documentation formatting is cleaner and maintains accurate byte offset information.


128-150: LGTM!

Solana proof bytes layout documentation is well-formatted and accurate.


246-258: LGTM!

IAVL proof encoding documentation formatting is consistent with the rest of the file.

src/integrations/oracles/axelar/external/axelar/interfaces/IOwnable.sol (1)

1-63: LGTM!

The interface is properly documented with source provenance (commit hash, URL, copy date), follows the third-party integration checklist requirements, and defines a clean ownership abstraction used by IUpgradable.

src/integrations/oracles/axelar/external/axelar/libs/AddressString.sol (1)

1-58: LGTM!

The address-string conversion utilities are correctly implemented with proper validation. The toAddress function validates the 0x prefix and 42-character length, and the hex character parsing logic correctly handles lowercase (a-f), uppercase (A-F), and numeric (0-9) ranges. Provenance documentation is complete.

test/oracle/bitcoin/blocksinfo.t.sol (1)

4-5: LGTM!

The comment formatting changes improve consistency across the file.

Also applies to: 28-28, 45-45, 62-62

src/input/types/MandateOutputType.sol (1)

27-27: LGTM!

Minor comment formatting adjustment for consistency.

snapshots/outputSettler.json (1)

1-9: LGTM!

Gas snapshot values updated. These should be verified by the CI pipeline's gas snapshot tests to ensure they match the actual measured gas consumption after the code changes in this PR.

src/libs/MessageEncodingLib.sol (1)

13-14: LGTM!

Documentation formatting cleanup. Removing the + prefix from the data structure description improves readability.

Also applies to: 17-18

src/integrations/oracles/axelar/external/axelar/interfaces/IContractIdentifier.sol (1)

1-22: LGTM!

Minimal interface for contract identification during upgrades, properly documented with source provenance.

src/integrations/oracles/axelar/external/axelar/interfaces/IImplementation.sol (1)

1-21: LGTM!

The interface is correctly copied from the Axelar GMP SDK with proper attribution including source URL, commit hash, and copy date. The interface definition is minimal and appropriate for the upgradeability pattern.

snapshots/oracle.json (1)

2-3: LGTM!

New gas snapshot entries for axelarOracleExecute and axelarOracleSubmit are added. The gas values are reasonable and consistent with other oracle implementations in the snapshot.

src/integrations/oracles/axelar/external/axelar/types/GasEstimationTypes.sol (1)

1-46: LGTM!

The gas estimation types are correctly copied from the Axelar GMP SDK with proper attribution. The struct packing is efficient, and the documentation clearly explains the purpose of each field.

src/integrations/oracles/axelar/external/axelar/interfaces/IUpgradable.sol (1)

1-32: LGTM!

The upgradable interface is correctly copied from the Axelar GMP SDK with proper attribution. The interface follows standard upgradeability patterns with appropriate error definitions and events.

src/integrations/oracles/axelar/external/axelar/interfaces/IInterchainGasEstimation.sol (1)

1-57: LGTM!

The interchain gas estimation interface is correctly copied from the Axelar GMP SDK with proper attribution. The interface provides the necessary abstractions for cross-chain gas fee estimation.

src/integrations/oracles/axelar/external/axelar/interfaces/IAxelarExecutable.sol (1)

1-54: LGTM!

The executable interface is correctly copied from the Axelar GMP SDK with proper attribution. The interface defines the standard cross-chain execution pattern with appropriate error definitions.

src/integrations/oracles/axelar/external/axelar/executable/AxelarExecutable.sol (1)

1-86: LGTM!

The AxelarExecutable abstract contract is correctly copied from the Axelar GMP SDK. The implementation follows the standard Axelar pattern:

  1. Constructor validates non-zero gateway address
  2. execute() validates with gateway before delegating to _execute()
  3. Derived contracts implement _execute() for custom logic

The gateway validation via validateContractCall ensures cross-chain messages are properly authenticated before execution.

src/integrations/oracles/axelar/AxelarOracle.sol (4)

29-37: LGTM!

The constructor correctly validates both the gateway (via AxelarExecutable) and the gas service addresses, preventing zero-address initialization.


48-60: LGTM!

The submit function has proper validation:

  1. Validates source is not zero address
  2. Validates payloads array is not empty
  3. Verifies all payloads are attested before submission

The attestation check via IAttester(source).hasAttested(payloads) ensures only valid payloads are broadcast.


73-86: LGTM!

The internal _submit function correctly:

  1. Encodes the message with source identifier and payloads
  2. Pays for gas via the gas service (with excess refunded to msg.sender)
  3. Calls the gateway to broadcast the message

The gas payment flow aligns with Axelar's recommended pattern of paying before the gateway call.


97-117: The identified concerns are already properly handled in the codebase.

The _getMappedChainId function in ChainMap.sol explicitly reverts with ZeroValue() if a chain is not mapped (if (chainId == 0) revert ZeroValue()), preventing attestations from being stored under unexpected keys. Additionally, StringToAddress.toAddress() in AddressString.sol validates the input format strictly—it requires exactly 42 characters starting with "0x" and reverts with InvalidAddressString() for any invalid address strings, including those that may come from the Axelar network.

Likely an incorrect or invalid review comment.

src/integrations/oracles/axelar/external/axelar/interfaces/IAxelarGateway.sol (1)

1-92: Well-documented external interface with proper provenance tracking.

The interface is appropriately minimal, containing only the functions needed for Axelar GMP integration. Good practice to document the source commit hash and copy date for external code.

src/integrations/oracles/axelar/external/axelar/mocks/MockAxelarGateway.sol (2)

29-35: Verify address(this) is intentional in the ContractCall event.

The mock emits address(this) as the sender in the ContractCall event rather than msg.sender. The real Axelar gateway would emit msg.sender. This is acceptable for a mock if tests don't rely on the sender value, but worth confirming this is the intended behavior.


47-78: Approval and validation logic is correctly paired.

The approveContractCall and validateContractCall functions use consistent key derivation with address(this) as the contractAddress, ensuring that test approvals can be properly validated. The validateContractCall correctly clears the approval flag after successful validation (line 55), preventing replay.

test/oracle/axelar/AxelarOracle.t.sol (4)

44-53: Setup correctly initializes test dependencies.

The test setup properly creates mock contracts, initializes the oracle, and configures chain mappings. The chain map uses keccak256(abi.encodePacked(chainName)) as the endpoint ID, which aligns with how Axelar chain names are mapped to canonical chain IDs.


109-178: Error path tests provide good coverage.

The tests correctly verify revert conditions:

  • NotAllPayloadsValid when payloads aren't proven on the settler
  • InvalidAddress when source address is zero
  • EmptyPayloadsNotAllowed when payload array is empty

The fuzz tests properly use vm.assume to filter invalid inputs.


289-296: Execute test correctly validates the full execution flow.

The test properly:

  1. Approves the contract call on the mock gateway
  2. Expects the OutputProven event emission
  3. Calls execute and snapshots gas usage
  4. Asserts the proven state via isProven

180-188: Wrapper tests provide concrete regression examples.

The _w suffix wrapper tests (test_submit_works_w, test_execute_works_w) call the parameterized fuzz tests with concrete values. This is a good pattern for ensuring basic functionality works even when fuzz testing is disabled or constrained.

src/integrations/oracles/axelar/external/axelar/interfaces/IAxelarGasService.sol (2)

1-31: External interface properly documented with provenance.

The interface correctly documents its source, commit hash, and copy date. The error definitions are clear and the interface structure is appropriate for the Axelar gas service integration.


431-435: No action needed. The gasCollector() function signature matches the official Axelar SDK interface exactly as shown in authoritative sources (Arbiscan, Blastscan). While the lack of a view modifier is unconventional for a getter function, this is the original design from Axelar and should be preserved for compatibility.

bytes20 constant PHASH = bytes20(0x93AB15e523955F293Df3A68029eC41E6b1ca1790);

//Next block to test verification after subimssion
// Next block to test verification after subimssion

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Typo in comment: "subimssion" should be "submission".

🔎 Proposed fix
-// Next block to test verification after subimssion
+// Next block to test verification after submission
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Next block to test verification after subimssion
// Next block to test verification after submission
🤖 Prompt for AI Agents
In test/oracle/bitcoin/blocksinfo.t.sol around line 31, there's a typo in the
inline comment ("subimssion"); update the comment text to read "submission" so
it correctly documents "Next block to test verification after submission".

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.

3 participants