Skip to content

Conversation

@Siddharth2207
Copy link
Contributor

@Siddharth2207 Siddharth2207 commented Nov 1, 2025

Motivation

Flare, Base settings for v5.

Checks

By submitting this for review, I'm confirming I've done the following:

  • made this PR as small as possible
  • unit-tested any new functionality
  • linked any relevant issues or PRs
  • included screenshots (if this involves a front-end change)

Summary by CodeRabbit

  • New Features

    • Added support for Base and Flare networks for on-chain indexing.
  • Updates

    • Switched registry and remote settings endpoints to new URLs.
    • Updated network address mappings used by indexing and runtime components.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 1, 2025

Walkthrough

Updated two GitHub raw URL constants in webapp and Tauri, added top-level base and flare entries to subgraph/networks.json, and changed the decimal float address mappings for base and flare in subgraph/src/float.ts. No control-flow or logic changes.

Changes

Cohort / File(s) Summary
URL constant updates
packages/webapp/src/lib/constants.ts, tauri-app/src/lib/services/loadRemoteSettings.ts
Updated REGISTRY_URL and REMOTE_SETTINGS_URL literal values to new GitHub raw URLs (commit hash changed to 28eecb662bc19dd9d43ec74941cfaf32e54cebbc).
Network configuration additions
subgraph/networks.json
Added top-level base and flare network entries, each with an OrderBook object containing address and startBlock.
Float address mappings
subgraph/src/float.ts
Updated decimal float address mappings for base and flare networks to 0x2F665EcE... (other mappings and fallback unchanged).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Files to double-check: packages/webapp/src/lib/constants.ts, tauri-app/src/lib/services/loadRemoteSettings.ts, subgraph/networks.json, subgraph/src/float.ts.

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • hardyjosh
  • findolor
  • 0xgleb

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "Flare, Base settings for v5." directly and accurately reflects the main changes in the pull request. The changeset primarily adds support for two new networks—Flare and Base—by introducing new network configurations in subgraph/networks.json, updating network-specific address mappings in subgraph/src/float.ts, and updating URL constants to point to new settings. The title is concise, specific, and clearly communicates the core purpose of the PR without vague language or misleading information.
✨ 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 2025-11-01-settings

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f1b21bf and 30db97c.

📒 Files selected for processing (2)
  • packages/webapp/src/lib/constants.ts (1 hunks)
  • tauri-app/src/lib/services/loadRemoteSettings.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
packages/webapp/**/*.{svelte,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Webapp must pass Svelte lint/format checks (npm run svelte-lint-format-check -w @rainlanguage/webapp)

Files:

  • packages/webapp/src/lib/constants.ts
packages/{webapp,ui-components}/**/*.{svelte,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

If you modify frontend code, you must include a screenshot of the built webapp reflecting the change

Files:

  • packages/webapp/src/lib/constants.ts
packages/**

📄 CodeRabbit inference engine (AGENTS.md)

JavaScript/Svelte projects live under packages/* (webapp, ui-components, orderbook)

Files:

  • packages/webapp/src/lib/constants.ts
tauri-app/**

📄 CodeRabbit inference engine (AGENTS.md)

Desktop app code is in tauri-app (Rust + Svelte); src-tauri is not part of the Cargo workspace

Files:

  • tauri-app/src/lib/services/loadRemoteSettings.ts
🧠 Learnings (3)
📓 Common learnings
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 1917
File: packages/webapp/src/routes/+layout.ts:73-79
Timestamp: 2025-06-11T11:49:05.862Z
Learning: In this codebase it is intentional to have both `subgraph` (holding a `SubgraphCfg` object) and `subgraphUrl` (holding just the URL string). Wherever only the URL is needed as a prop, the `subgraphUrl` variable is retained, and no renaming to `subgraph` is expected.
📚 Learning: 2025-04-09T12:58:03.399Z
Learnt from: hardingjam
Repo: rainlanguage/rain.orderbook PR: 1565
File: packages/webapp/src/lib/services/loadRegistryUrl.ts:5-19
Timestamp: 2025-04-09T12:58:03.399Z
Learning: In the rain.orderbook application, URL validation for registry URLs is handled at the frontend/component level before the `loadRegistryUrl` function is called, so additional validation within this function is not necessary.

Applied to files:

  • packages/webapp/src/lib/constants.ts
📚 Learning: 2025-04-09T13:00:24.640Z
Learnt from: hardingjam
Repo: rainlanguage/rain.orderbook PR: 1565
File: packages/webapp/src/__tests__/registryManager.test.ts:227-238
Timestamp: 2025-04-09T13:00:24.640Z
Learning: In the rain.orderbook project, error handling was added to the RegistryManager to handle localStorage exceptions, addressing part of the verification agent's suggestions. The team should also consider testing extremely long URLs that might approach browser limits.

Applied to files:

  • packages/webapp/src/lib/constants.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: git-clean
  • GitHub Check: test
🔇 Additional comments (2)
packages/webapp/src/lib/constants.ts (1)

1-4: Verification passed — commit and both files are accessible.

The commit hash 28eecb662bc19dd9d43ec74941cfaf32e54cebbc exists in the rain.strategies repository, and both registry and settings.yaml files are present and accessible at the specified paths. Both URLs return HTTP 200 status.

tauri-app/src/lib/services/loadRemoteSettings.ts (1)

1-2: Commit hash verified and settings.yaml file confirmed present.

All checks passed: the commit 28eecb662bc19dd9d43ec74941cfaf32e54cebbc exists in the rain.strategies repository, the settings.yaml file is present at that commit, and the URL is accessible (HTTP 200).


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.

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: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0cd67f0 and 407f2fc.

📒 Files selected for processing (4)
  • packages/webapp/src/lib/constants.ts (1 hunks)
  • subgraph/networks.json (1 hunks)
  • subgraph/src/float.ts (1 hunks)
  • tauri-app/src/lib/services/loadRemoteSettings.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
packages/webapp/**/*.{svelte,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Webapp must pass Svelte lint/format checks (npm run svelte-lint-format-check -w @rainlanguage/webapp)

Files:

  • packages/webapp/src/lib/constants.ts
packages/{webapp,ui-components}/**/*.{svelte,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

If you modify frontend code, you must include a screenshot of the built webapp reflecting the change

Files:

  • packages/webapp/src/lib/constants.ts
packages/**

📄 CodeRabbit inference engine (AGENTS.md)

JavaScript/Svelte projects live under packages/* (webapp, ui-components, orderbook)

Files:

  • packages/webapp/src/lib/constants.ts
subgraph/**

📄 CodeRabbit inference engine (AGENTS.md)

Subgraph and related tooling live under subgraph/

Files:

  • subgraph/networks.json
  • subgraph/src/float.ts
tauri-app/**

📄 CodeRabbit inference engine (AGENTS.md)

Desktop app code is in tauri-app (Rust + Svelte); src-tauri is not part of the Cargo workspace

Files:

  • tauri-app/src/lib/services/loadRemoteSettings.ts
🧠 Learnings (7)
📓 Common learnings
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 1916
File: packages/ui-components/src/lib/__fixtures__/settings-12-11-24.json:182-195
Timestamp: 2025-06-10T12:04:54.107Z
Learning: In test fixture files like `packages/ui-components/src/lib/__fixtures__/settings-12-11-24.json`, network configuration inconsistencies (such as matchain using Polygon's RPC, chainId, and currency while having its own network key) are acceptable since they are used for testing purposes only.
📚 Learning: 2025-04-09T12:58:03.399Z
Learnt from: hardingjam
Repo: rainlanguage/rain.orderbook PR: 1565
File: packages/webapp/src/lib/services/loadRegistryUrl.ts:5-19
Timestamp: 2025-04-09T12:58:03.399Z
Learning: In the rain.orderbook application, URL validation for registry URLs is handled at the frontend/component level before the `loadRegistryUrl` function is called, so additional validation within this function is not necessary.

Applied to files:

  • packages/webapp/src/lib/constants.ts
📚 Learning: 2025-04-09T13:00:24.640Z
Learnt from: hardingjam
Repo: rainlanguage/rain.orderbook PR: 1565
File: packages/webapp/src/__tests__/registryManager.test.ts:227-238
Timestamp: 2025-04-09T13:00:24.640Z
Learning: In the rain.orderbook project, error handling was added to the RegistryManager to handle localStorage exceptions, addressing part of the verification agent's suggestions. The team should also consider testing extremely long URLs that might approach browser limits.

Applied to files:

  • packages/webapp/src/lib/constants.ts
📚 Learning: 2025-06-10T12:04:54.107Z
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 1916
File: packages/ui-components/src/lib/__fixtures__/settings-12-11-24.json:182-195
Timestamp: 2025-06-10T12:04:54.107Z
Learning: In test fixture files like `packages/ui-components/src/lib/__fixtures__/settings-12-11-24.json`, network configuration inconsistencies (such as matchain using Polygon's RPC, chainId, and currency while having its own network key) are acceptable since they are used for testing purposes only.

Applied to files:

  • subgraph/networks.json
📚 Learning: 2025-10-06T11:28:30.692Z
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 2145
File: crates/common/src/raindex_client/local_db/query/fetch_orders/query.sql:6-7
Timestamp: 2025-10-06T11:28:30.692Z
Learning: In `crates/common/src/raindex_client/local_db/query/fetch_orders/query.sql`, the orderbook_address is currently hardcoded to '0x2f209e5b67A33B8fE96E28f24628dF6Da301c8eB' because the system only supports a single orderbook at the moment. Multiorderbook logic is not yet implemented and will be added in the future.

Applied to files:

  • subgraph/networks.json
  • subgraph/src/float.ts
📚 Learning: 2025-10-29T13:29:29.578Z
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 2278
File: packages/webapp/src/lib/services/startLocalDbSync.ts:23-29
Timestamp: 2025-10-29T13:29:29.578Z
Learning: In packages/webapp/src/lib/services/startLocalDbSync.ts, the hard-coded default orderbook address '0x2f209e5b67A33B8fE96E28f24628dF6Da301c8eB' is a temporary placeholder that will be removed when new sync logic is introduced in the Raindex client, as documented in the NOTE comment.

Applied to files:

  • subgraph/networks.json
  • subgraph/src/float.ts
📚 Learning: 2025-07-21T16:34:31.193Z
Learnt from: 0xgleb
Repo: rainlanguage/rain.orderbook PR: 1911
File: crates/subgraph/src/types/impls.rs:7-15
Timestamp: 2025-07-21T16:34:31.193Z
Learning: In the rainlanguage/rain.orderbook codebase, user 0xgleb considers breaking changes that remove unsafe default behaviors to be intentional and acceptable. Specifically, the get_decimals() method in crates/subgraph/src/types/impls.rs was intentionally changed to return MissingDecimals error instead of defaulting to 18 decimals, as defaulting to 18 is considered unsafe and should never have been done.

Applied to files:

  • subgraph/src/float.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: test
  • GitHub Check: git-clean
  • GitHub Check: build-tauri (ubuntu-22.04, true)
  • GitHub Check: Deploy-Docs-Preview
  • GitHub Check: Deploy-Preview-Push
🔇 Additional comments (3)
tauri-app/src/lib/services/loadRemoteSettings.ts (1)

1-2: LGTM! URL update is consistent with webapp.

The REMOTE_SETTINGS_URL has been updated to match the same commit hash used in packages/webapp/src/lib/constants.ts, ensuring consistency across the application.

packages/webapp/src/lib/constants.ts (1)

1-4: Remote settings verification successful—no issues found.

All three verification points passed:

  • URLs are accessible
  • settings.yaml contains complete configurations for base (chain-id: 8453, ETH) and flare (chain-id: 14, FLR) networks
  • Registry is accessible and contains strategy information

The updated constants reference the correct commit with proper network, subgraph, metaboard, orderbook, and deployer configurations for both networks.

subgraph/src/float.ts (1)

17-19: Shared DecimalFloat addresses are intentional CREATE2 deployments—no action required.

The identical decimal float addresses for base and flare networks (0x2F665EcE3345bF09197DAd22A50dFB623BD310A7) are not a copy-paste error. CREATE2 deterministic deployments produce identical addresses across EVM chains when the deployer address, salt, and init_code remain the same, and this is a standard pattern in the Rain Protocol ecosystem. The DecimalFloat contract, imported from the rain.interpreter library, is a utility contract appropriately deployed to the same address across multiple chains, while OrderBook contracts (application-specific) correctly maintain distinct addresses per network.

Likely an incorrect or invalid review comment.

Comment on lines +14 to +24
"base": {
"OrderBook": {
"address": "0x52CEB8eBEf648744fFDDE89F7Bc9C3aC35944775",
"startBlock": 36667253
}
},
"flare": {
"OrderBook": {
"address": "0x8Dbc50485e7C6994923B9A2c603a2B6b2d8Eef64",
"startBlock": 49782578
}
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 OrderBook addresses and start blocks for new networks.

Please confirm:

  1. The OrderBook addresses are correct for each network:
    • Base: 0x52CEB8eBEf648744fFDDE89F7Bc9C3aC35944775
    • Flare: 0x8Dbc50485e7C6994923B9A2c603a2B6b2d8Eef64
  2. The start blocks accurately reflect the OrderBook deployment block:
    • Base: block 36667253
    • Flare: block 49782578
  3. The network names "base" and "flare" match The Graph's network identifiers

Starting from an incorrect block can cause the subgraph to miss events or take longer to sync.


🏁 Script executed:

#!/bin/bash
# Search for any existing references to these addresses or networks in the codebase

echo "=== Searching for Base OrderBook address ==="
rg -i "52CEB8eBEf648744fFDDE89F7Bc9C3aC35944775" -C 2

echo -e "\n=== Searching for Flare OrderBook address ==="
rg -i "8Dbc50485e7C6994923B9A2c603a2B6b2d8Eef64" -C 2

echo -e "\n=== Searching for existing base/flare network references ==="
rg -i "(\"base\"|\"flare\").*network" -C 2

Length of output: 686


🏁 Script executed:

#!/bin/bash
# Check if there's any documentation or comments about network deployment in the codebase

echo "=== Searching for deployment or network documentation ==="
rg -i "deployment|network.*identifier|graph.*network" -C 2 | head -50

echo -e "\n=== Checking for any README or docs mentioning networks ==="
fd -e md -e txt | xargs grep -l -i "base\|flare" 2>/dev/null | head -10

Length of output: 4780


🌐 Web query:

The Graph supported networks identifiers base flare

💡 Result:

Short answer:

  • Base — use network identifier "base" (testnets/examples also use "base-sepolia"). [1][2]
  • Flare — not currently a supported network on The Graph (community requests exist, but no official support listed). [3][4]

Sources:

  1. The Graph subgraph manifest / docs (network examples). [The Graph Docs]. (thegraph.com)
  2. Examples/tutorials showing network: base / base-sepolia in subgraph.yaml. (docs.chainstack.com)
  3. The Graph blog post announcing Base support. (thegraph.com)
  4. Community forum discussion asking for Flare support (no official support announced). (forum.thegraph.com)

If you want, I can look up the exact network identifier for a specific hosting (Hosted Service vs Graph Network) or check again for any recent Flare integration announcements.

Citations:


🏁 Script executed:

#!/bin/bash
# Check if this is a The Graph subgraph or uses different indexing infrastructure

echo "=== Looking for subgraph.yaml or subgraph configuration ==="
fd -name "subgraph.yaml" -o -name "subgraph.yml"

echo -e "\n=== Searching for The Graph indexing references ==="
rg -i "graph-node|the graph|hosted service" -C 2 | head -30

echo -e "\n=== Checking subgraph directory structure ==="
ls -la subgraph/ 2>/dev/null || echo "subgraph/ directory not found"

echo -e "\n=== Looking at networks.json to understand context ==="
head -30 subgraph/networks.json

Length of output: 2094


🌐 Web query:

Flare network The Graph 2025 support

💡 Result:

Short answer: No — as of Nov 1, 2025 The Graph does not list Flare Network as a supported chain and there is no public announcement of an official integration. The Graph maintains a public "Supported Networks" list (90+ chains) and Flare does not appear there. [1][2]

Sources

  • The Graph — Supported networks listing (network index page). [1]
  • The Graph community forum thread asking about Flare (no indication of an official integration). [2]

Remove or document "flare" network—it is not currently supported by The Graph.

The Graph does not list Flare Network as a supported chain, so the "flare" entry in networks.json will fail during subgraph deployment or indexing. Either remove this entry or move it to a separate configuration for custom indexing infrastructure. The "base" identifier is correct.

Additionally, verify the OrderBook addresses and start blocks externally (Etherscan, Block Explorer) before deploying, as incorrect start blocks cause the subgraph to miss events or sync inefficiently.

🤖 Prompt for AI Agents
In subgraph/networks.json around lines 14 to 24, the "flare" network entry is
not supported by The Graph and will break deployment; either delete the entire
"flare" object from this file or move it into a separate custom-config (e.g.,
networks.custom.json) used only by your internal indexing infra, and if you keep
it add a clear comment documenting that Flare is unsupported by The Graph and
should not be used for public deployments; finally, before committing verify the
OrderBook contract addresses and startBlock values against the appropriate block
explorer for each network and correct any mismatches.

@Siddharth2207 Siddharth2207 self-assigned this Nov 1, 2025
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

♻️ Duplicate comments (1)
tauri-app/src/lib/services/loadRemoteSettings.ts (1)

1-2: Code duplication: See comment in packages/webapp/src/lib/constants.ts.

This REMOTE_SETTINGS_URL constant is duplicated from packages/webapp/src/lib/constants.ts (lines 3-4). Please refer to the code duplication comment in that file for recommendations on consolidating these constants.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b38cfb7 and f1b21bf.

📒 Files selected for processing (2)
  • packages/webapp/src/lib/constants.ts (1 hunks)
  • tauri-app/src/lib/services/loadRemoteSettings.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
packages/webapp/**/*.{svelte,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Webapp must pass Svelte lint/format checks (npm run svelte-lint-format-check -w @rainlanguage/webapp)

Files:

  • packages/webapp/src/lib/constants.ts
packages/{webapp,ui-components}/**/*.{svelte,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

If you modify frontend code, you must include a screenshot of the built webapp reflecting the change

Files:

  • packages/webapp/src/lib/constants.ts
packages/**

📄 CodeRabbit inference engine (AGENTS.md)

JavaScript/Svelte projects live under packages/* (webapp, ui-components, orderbook)

Files:

  • packages/webapp/src/lib/constants.ts
tauri-app/**

📄 CodeRabbit inference engine (AGENTS.md)

Desktop app code is in tauri-app (Rust + Svelte); src-tauri is not part of the Cargo workspace

Files:

  • tauri-app/src/lib/services/loadRemoteSettings.ts
🧠 Learnings (3)
📓 Common learnings
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 1917
File: packages/webapp/src/routes/+layout.ts:73-79
Timestamp: 2025-06-11T11:49:05.862Z
Learning: In this codebase it is intentional to have both `subgraph` (holding a `SubgraphCfg` object) and `subgraphUrl` (holding just the URL string). Wherever only the URL is needed as a prop, the `subgraphUrl` variable is retained, and no renaming to `subgraph` is expected.
📚 Learning: 2025-04-09T12:58:03.399Z
Learnt from: hardingjam
Repo: rainlanguage/rain.orderbook PR: 1565
File: packages/webapp/src/lib/services/loadRegistryUrl.ts:5-19
Timestamp: 2025-04-09T12:58:03.399Z
Learning: In the rain.orderbook application, URL validation for registry URLs is handled at the frontend/component level before the `loadRegistryUrl` function is called, so additional validation within this function is not necessary.

Applied to files:

  • packages/webapp/src/lib/constants.ts
📚 Learning: 2025-04-09T13:00:24.640Z
Learnt from: hardingjam
Repo: rainlanguage/rain.orderbook PR: 1565
File: packages/webapp/src/__tests__/registryManager.test.ts:227-238
Timestamp: 2025-04-09T13:00:24.640Z
Learning: In the rain.orderbook project, error handling was added to the RegistryManager to handle localStorage exceptions, addressing part of the verification agent's suggestions. The team should also consider testing extremely long URLs that might approach browser limits.

Applied to files:

  • packages/webapp/src/lib/constants.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (15)
  • GitHub Check: test
  • GitHub Check: build-tauri (ubuntu-22.04, true)
  • GitHub Check: standard-tests (ubuntu-latest, rainix-wasm-test)
  • GitHub Check: standard-tests (ubuntu-latest, test-js-bindings)
  • GitHub Check: standard-tests (ubuntu-latest, rainix-rs-static)
  • GitHub Check: standard-tests (ubuntu-latest, rainix-wasm-artifacts)
  • GitHub Check: standard-tests (ubuntu-latest, rainix-sol-legal)
  • GitHub Check: standard-tests (ubuntu-latest, rainix-sol-static)
  • GitHub Check: standard-tests (ubuntu-latest, rainix-rs-artifacts, true)
  • GitHub Check: standard-tests (ubuntu-latest, rainix-sol-artifacts)
  • GitHub Check: standard-tests (ubuntu-latest, rainix-sol-test)
  • GitHub Check: standard-tests (ubuntu-latest, ob-rs-test, true)
  • GitHub Check: git-clean
  • GitHub Check: Deploy-Preview-Push
  • GitHub Check: Deploy-Docs-Preview
🔇 Additional comments (3)
tauri-app/src/lib/services/loadRemoteSettings.ts (2)

4-10: LGTM: Error handling and logic are solid.

The function properly handles non-ok responses and returns the fetched text. The updated URL constant will be tested by the existing test suite.


12-77: LGTM: Comprehensive test coverage.

The test suite properly covers:

  • Successful settings load
  • Non-ok HTTP status errors
  • Network/fetch failures
  • Text parsing errors

All tests correctly reference the updated REMOTE_SETTINGS_URL constant.

packages/webapp/src/lib/constants.ts (1)

2-4: Verification successful — all URLs are accessible and contain expected Flare and Base network configurations.

The commit b2e056bb58f0e467a515132ce7a1b25bc624bd09 exists in the rain.strategies repository, both /registry and /settings.yaml paths return HTTP 200, and the settings file contains valid network configurations for Flare (chain-id 14) and Base (chain-id 8453) as expected for v5 settings.

Comment on lines 2 to 4
'https://raw.githubusercontent.com/rainlanguage/rain.strategies/b2e056bb58f0e467a515132ce7a1b25bc624bd09/registry';
export const REMOTE_SETTINGS_URL =
'https://raw.githubusercontent.com/rainlanguage/rain.strategies/cf96aab81a59704ea8d9300130ac888eb86f5eff/settings.yaml';
'https://raw.githubusercontent.com/rainlanguage/rain.strategies/b2e056bb58f0e467a515132ce7a1b25bc624bd09/settings.yaml';
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Code duplication: REMOTE_SETTINGS_URL is defined in multiple locations.

The REMOTE_SETTINGS_URL constant is duplicated in tauri-app/src/lib/services/loadRemoteSettings.ts (line 1-2). This creates a maintenance burden where updates must be synchronized across both files.

Consider:

  1. Extracting this constant to a shared configuration file
  2. Or importing it from this file into the Tauri service (if cross-package imports are feasible)
  3. Or using an environment variable/build-time constant
🤖 Prompt for AI Agents
In packages/webapp/src/lib/constants.ts around lines 2 to 4, REMOTE_SETTINGS_URL
is duplicated across packages (also defined in
tauri-app/src/lib/services/loadRemoteSettings.ts); extract this URL into a
single shared source of truth and update both consumers to import it (or read it
from an environment/build-time constant) to avoid drift. Create a new shared
config module (or move the constant into an existing cross-package lib or into
the monorepo root config), export REMOTE_SETTINGS_URL from there, and replace
the hardcoded definitions in both packages with imports (or reference
process/env build constant) ensuring tests/builds still resolve the module.
Ensure the new module is added to package exports or workspace TS paths so both
webapp and tauri-app can import it without circular deps.

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.

4 participants