Skip to content

feat: add LayerZero V2 proof oracle - #137

Draft
reednaa wants to merge 16 commits into
mainfrom
feat/layerzero-oracle
Draft

reednaa wants to merge 16 commits into
mainfrom
feat/layerzero-oracle

Conversation

@reednaa

@reednaa reednaa commented Oct 2, 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 half of the former combined #133 (now Axelar only).

  • LayerZeroOracle: pinned libraries, DVNs, confirmations, executor; single Type-3 gas option; at most 16 constructor-only bijective chain mappings, no owner, upgrade, pause or withdrawal.
  • common/ (shared, identical in both PRs, merges cleanly in either order): BoundedOracle, strict EVM / Stellar StrKey / Solana base58 identities (OracleAddress).
  • MessageEncodingLib: reject trailing message bytes (TrailingMessageBytes).

Tests: test/oracle/transport/{LayerZeroOracle.t.sol,EndpointFixture.sol,OracleAddress.t.sol,BoundAttester.sol}.

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

Not done: deployment, live provider delivery. Not audited.

@reednaa
reednaa force-pushed the feat/layerzero-oracle branch from 828c74a to 33e561c Compare October 5, 2026 06:01
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.
Bring in b8a4178 (AxelarOracle on shared ChainMap; MappedOracle/BoundedOracle removed). LayerZero tests move from test/oracle/transport to test/oracle/layerzero.
Drop MappedOracle/BoundedOracle (removed in b8a4178). The oracle now
inherits BaseInputOracle and ChainMap with key = uint256(eid).

- setChainMap(uint256 eid, uint256 chainId, Security) is the only way to
  add a route: it validates the EID fits uint32 and the Security config,
  maps through ChainMap.setChainMap (ZeroValue/AlreadySet/ChainMapConfigured)
  and pins libraries, executor and ULN config in the same call. The plain
  ChainMap.setChainMap(uint256,uint256) is overridden to revert
  SecurityRequired so no route can open on endpoint defaults.
- Security gains maxMessageSize (nonzero), pinned in the executor config,
  replacing BoundedOracle's fixed 2,778-byte MAX_MESSAGE.
- No Stellar count/size admission checks; destinations enforce their own.
- submit/lzReceive inline export/record like HyperlaneOracle
  (NotAllPayloadsValid; OutputProven on every record). Unmapped
  destinations and origins revert ZeroValue; route(eid), UnknownChain and
  the uint32 ChainMapConfigured event are removed (use chainIdMap).
- Tests cover the disabled 2-arg setter, uint32 bound, security
  validation, unmapped send/receive, and malformed-message rollback.

This branch has not been deployed

No deployments
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