Skip to content

Conversation

@fafk
Copy link

@fafk fafk commented Oct 30, 2025

Summary by CodeRabbit

  • New Features
    • Added support for the Linea blockchain network

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 30, 2025

Walkthrough

A new chain identifier LINEA with chain ID 59144 is added to the SupportedChainId enum. This extends the supported blockchain networks without modifying any existing logic or structure.

Changes

Cohort / File(s) Summary
Chain Configuration Updates
packages/config/src/chains/types.ts
Added enum member LINEA = 59144 to SupportedChainId enum

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 Linea joins the chain parade,
Fifty-nine-one-four-four, a new blockade!
With whiskers twitching, carrots in sight,
Another network hops into light! 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "Add Linea to suppored chains" directly and clearly relates to the main change in the changeset, which adds a new LINEA enum member to the SupportedChainId enum. The title is specific, concise, and accurately summarizes the primary objective of the pull request. It avoids vague language and noise, making it clear to teammates what the change accomplishes. While there is a minor spelling error ("suppored" instead of "supported"), this does not affect the clarity or relatedness of the title to the actual changeset.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add-linea-to-supported-chains

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.

@github-actions
Copy link
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bd5c1d9 and c121199.

📒 Files selected for processing (1)
  • packages/config/src/chains/types.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: alfetopito
PR: cowprotocol/cow-sdk#391
File: src/trading/getEthFlowTransaction.ts:80-85
Timestamp: 2025-08-12T09:15:28.459Z
Learning: In the CoW SDK codebase, ETH_FLOW_ADDRESSES and BARN_ETH_FLOW_ADDRESSES are typed as Record<SupportedChainId, string>, which requires all SupportedChainId enum values to have corresponding string entries. TypeScript compilation will fail if any chainId is missing from these mappings, making runtime guards for missing addresses unnecessary in these specific cases.
📚 Learning: 2025-03-21T15:14:59.767Z
Learnt from: anxolin
PR: cowprotocol/cow-sdk#251
File: src/bridging/providers/across/AcrossApi.ts:5-10
Timestamp: 2025-03-21T15:14:59.767Z
Learning: In AcrossApi.ts, interfaces like AvailableRoutesRequest and Route use string types for chain IDs (originChainId, destinationChainId) because they're mapping to an external API contract from Across, which expects chain IDs as strings, rather than using internal enum types like TargetChainId.

Applied to files:

  • packages/config/src/chains/types.ts
📚 Learning: 2025-08-12T09:15:28.459Z
Learnt from: alfetopito
PR: cowprotocol/cow-sdk#391
File: src/trading/getEthFlowTransaction.ts:80-85
Timestamp: 2025-08-12T09:15:28.459Z
Learning: In the CoW SDK codebase, ETH_FLOW_ADDRESSES and BARN_ETH_FLOW_ADDRESSES are typed as Record<SupportedChainId, string>, which requires all SupportedChainId enum values to have corresponding string entries. TypeScript compilation will fail if any chainId is missing from these mappings, making runtime guards for missing addresses unnecessary in these specific cases.

Applied to files:

  • packages/config/src/chains/types.ts

BASE = 8453,
ARBITRUM_ONE = 42161,
AVALANCHE = 43114,
LINEA = 59144,
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify all chain-specific mappings include LINEA.

The addition of LINEA with chain ID 59144 is correct. However, based on learnings, adding a new member to SupportedChainId requires corresponding entries in all Record<SupportedChainId, ...> typed objects throughout the codebase (e.g., ETH_FLOW_ADDRESSES, BARN_ETH_FLOW_ADDRESSES). TypeScript compilation will fail if these mappings are incomplete.

Based on learnings.

Run the following script to identify all chain-specific mappings that may need updates:


🏁 Script executed:

#!/bin/bash
# Description: Find all Record<SupportedChainId, ...> mappings and verify LINEA is included

# Search for Record<SupportedChainId type definitions
echo "=== Record<SupportedChainId mappings ==="
rg -nP "Record<SupportedChainId" -A 10

# Search for common chain mapping objects that might need LINEA
echo -e "\n=== ETH_FLOW_ADDRESSES ==="
rg -nP "ETH_FLOW_ADDRESSES\s*[=:]" -A 15

echo -e "\n=== BARN_ETH_FLOW_ADDRESSES ==="
rg -nP "BARN_ETH_FLOW_ADDRESSES\s*[=:]" -A 15

# Search for other potential chain configuration objects
echo -e "\n=== Other potential chain mappings ==="
rg -nP "SupportedChainId\.\w+\s*:" -C 2

Length of output: 12503


🏁 Script executed:

#!/bin/bash
# Verify if LINEA is in ALL_SUPPORTED_CHAIN_IDS and ALL_SUPPORTED_CHAINS_MAP

echo "=== ALL_SUPPORTED_CHAIN_IDS constant ==="
rg -nP "ALL_SUPPORTED_CHAIN_IDS\s*[=:]" -A 15

echo -e "\n=== LINEA in chainIds.ts ==="
rg -n "LINEA" packages/config/src/chains/const/chainIds.ts

echo -e "\n=== Full ALL_SUPPORTED_CHAINS_MAP ==="
rg -n "ALL_SUPPORTED_CHAINS_MAP" -A 20 packages/config/src/chains/const/chainIds.ts

Length of output: 2711


🏁 Script executed:

#!/bin/bash
# Check where chain imports come from and if linea exists

echo "=== Imports at top of chainIds.ts ==="
head -20 packages/config/src/chains/const/chainIds.ts

echo -e "\n=== Search for any linea references in config ==="
rg -n "linea" -i packages/config/src/

echo -e "\n=== Check contracts.ts for chain-specific constants ==="
head -40 packages/config/src/chains/const/contracts.ts

Length of output: 2939


Add Linea chain configuration to complete the integration.

The LINEA enum was added to types.ts, but the chain registry is incomplete. TypeScript compilation will fail because ETH_FLOW_ADDRESSES and BARN_ETH_FLOW_ADDRESSES (typed as Record<SupportedChainId, string>) require all enum values.

Required changes:

  1. Create packages/config/src/chains/details/linea.ts with ChainInfo for Linea (chain ID 59144)
  2. Import linea in packages/config/src/chains/const/chainIds.ts
  3. Add [SupportedChainId.LINEA]: linea entry to ALL_SUPPORTED_CHAINS_MAP in the same file

Without these, mapAddressToSupportedNetworks() won't generate LINEA entries for the chain-specific address mappings.

Based on learnings.

🤖 Prompt for AI Agents
In packages/config/src/chains/types.ts around line 19 the SupportedChainId enum
added LINEA = 59144 but the chain registry is missing; create
packages/config/src/chains/details/linea.ts exporting a ChainInfo object for
Linea (chainId 59144) following the structure of other chain files, then open
packages/config/src/chains/const/chainIds.ts, import the new linea export and
add the entry [SupportedChainId.LINEA]: linea to ALL_SUPPORTED_CHAINS_MAP; after
that verify any Records typed over SupportedChainId (e.g., ETH_FLOW_ADDRESSES,
BARN_ETH_FLOW_ADDRESSES) compile and update mapAddressToSupportedNetworks() will
include LINEA.

@alfetopito
Copy link
Contributor

Covered by #606

@alfetopito alfetopito closed this Nov 5, 2025
@alfetopito alfetopito deleted the add-linea-to-supported-chains branch November 5, 2025 16:01
@github-actions github-actions bot locked and limited conversation to collaborators Nov 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants