-
Notifications
You must be signed in to change notification settings - Fork 13
Flare, Base settings for v5. #2285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughUpdated two GitHub raw URL constants in webapp and Tauri, added top-level Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used📓 Path-based instructions (4)packages/webapp/**/*.{svelte,ts}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
packages/{webapp,ui-components}/**/*.{svelte,ts}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
packages/**📄 CodeRabbit inference engine (AGENTS.md)
Files:
tauri-app/**📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (3)📓 Common learnings📚 Learning: 2025-04-09T12:58:03.399ZApplied to files:
📚 Learning: 2025-04-09T13:00:24.640ZApplied to files:
⏰ 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)
🔇 Additional comments (2)
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. Comment |
There was a problem hiding this 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
📒 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.jsonsubgraph/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.jsonsubgraph/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.jsonsubgraph/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.
| "base": { | ||
| "OrderBook": { | ||
| "address": "0x52CEB8eBEf648744fFDDE89F7Bc9C3aC35944775", | ||
| "startBlock": 36667253 | ||
| } | ||
| }, | ||
| "flare": { | ||
| "OrderBook": { | ||
| "address": "0x8Dbc50485e7C6994923B9A2c603a2B6b2d8Eef64", | ||
| "startBlock": 49782578 | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Verify OrderBook addresses and start blocks for new networks.
Please confirm:
- The OrderBook addresses are correct for each network:
- Base:
0x52CEB8eBEf648744fFDDE89F7Bc9C3aC35944775 - Flare:
0x8Dbc50485e7C6994923B9A2c603a2B6b2d8Eef64
- Base:
- The start blocks accurately reflect the OrderBook deployment block:
- Base: block 36667253
- Flare: block 49782578
- 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 2Length 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 -10Length 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:
- The Graph subgraph manifest / docs (network examples). [The Graph Docs]. (thegraph.com)
- Examples/tutorials showing
network: base/base-sepoliain subgraph.yaml. (docs.chainstack.com) - The Graph blog post announcing Base support. (thegraph.com)
- 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:
- 1: https://thegraph.com/docs/it/subgraphs/developing/creating/subgraph-manifest/?utm_source=openai
- 2: https://docs.chainstack.com/docs/writing-a-subgraph-to-get-the-friendtech-real-time-trading-data?utm_source=openai
- 3: https://thegraph.com/blog/the-graph-indexing-data-coinbase-Base-l2/?utm_source=openai
- 4: https://forum.thegraph.com/t/support-for-one-of-the-fastest-growing-networks-flare-networks/3032?utm_source=openai
🏁 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.jsonLength 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.
There was a problem hiding this 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
📒 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_URLconstant.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
b2e056bb58f0e467a515132ce7a1b25bc624bd09exists in the rain.strategies repository, both/registryand/settings.yamlpaths 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.
packages/webapp/src/lib/constants.ts
Outdated
| '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'; |
There was a problem hiding this comment.
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:
- Extracting this constant to a shared configuration file
- Or importing it from this file into the Tauri service (if cross-package imports are feasible)
- 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.
Motivation
Flare, Base settings for v5.
Checks
By submitting this for review, I'm confirming I've done the following:
Summary by CodeRabbit
New Features
Updates