Skip to content

v5 base#2195

Closed
Siddharth2207 wants to merge 8 commits intomainfrom
2025-10-11-base-obv5
Closed

v5 base#2195
Siddharth2207 wants to merge 8 commits intomainfrom
2025-10-11-base-obv5

Conversation

@Siddharth2207
Copy link
Copy Markdown
Contributor

@Siddharth2207 Siddharth2207 commented Oct 11, 2025

Motivation

v5 base

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 the Base network, enabling indexing and display of OrderBook data from its initial index block.
  • Chores

    • Updated remote registry and settings endpoints used by web and desktop apps.
    • Adjusted Base network numeric/decimal mappings to ensure accurate display of values.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Oct 11, 2025

Walkthrough

Added a top-level base network entry in subgraph/networks.json, updated the base decimal-float address in subgraph/src/float.ts, and changed three URL constants used by the webapp and Tauri app (REGISTRY_URL, REMOTE_SETTINGS_URL). No control-flow changes.

Changes

Cohort / File(s) Summary
Subgraph network config
subgraph/networks.json
Added top-level base network with OrderBook { address: 0x52CEB8eBEf648744fFDDE89F7Bc9C3aC35944775, startBlock: 36667253 }.
Subgraph float mapping
subgraph/src/float.ts
Updated getDecimalFloatAddress mapping for base to 0x2F665EcE3345bF09197DAd22A50dFB623BD310A7 (replaced previous address).
Webapp constants
packages/webapp/src/lib/constants.ts
Updated exported REGISTRY_URL to a different Rain strategies registry commit URL.
Webapp remote settings loader
packages/webapp/src/routes/+layout.ts
Updated REMOTE_SETTINGS_URL to a different Raindex settings.yaml commit; load logic unchanged.
Tauri remote settings loader
tauri-app/src/lib/services/loadRemoteSettings.ts
Updated REMOTE_SETTINGS_URL constant to the same Raindex settings.yaml commit; fetch/validation logic unchanged.

Sequence Diagram(s)

sequenceDiagram
  participant Webapp
  participant Tauri
  participant Subgraph
  participant FloatModule

  rect #f0f8ff
    Webapp->>Webapp: read REGISTRY_URL & REMOTE_SETTINGS_URL
    Webapp->>Tauri: request remote settings
  end

  rect #f7fff0
    Tauri->>Tauri: loadRemoteSettings(REMOTE_SETTINGS_URL)
    Tauri-->>Tauri: fetch -> validate response.ok -> return text
  end

  rect #fff7f0
    Subgraph->>FloatModule: getDecimalFloatAddress("base")
    FloatModule-->>Subgraph: return 0x2F665E... (updated)
    Subgraph->>Subgraph: read `OrderBook` address from `networks.json` (0x52CEB8...)
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • polygon sg #2161 — Modifies subgraph/networks.json and updates getDecimalFloatAddress in subgraph/src/float.ts.
  • polygon v5 ob #2162 — Updates registry and remote-settings URLs in webapp and Tauri paths (same constants changed here).
  • arb and base sg #1964 — Touches subgraph/networks.json base OrderBook configuration (address/startBlock).

Suggested labels

enhancement

Suggested reviewers

  • hardyjosh

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The title “v5 base” is too brief and does not clearly communicate the primary change of introducing Base network support and related configuration updates. It is not descriptive enough for teammates to understand the scope at a glance, nor is it a complete sentence. As a result, it fails to summarize the main intent of the pull request. Please revise the title to explicitly state the main change, for example “Add support for Base network (v5)” or “Introduce Base network configuration and updates (v5)”. A clear, descriptive title will help reviewers and maintainers understand the scope at a glance. This will improve the readability of project history.
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 (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ 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-10-11-base-obv5

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
Copy Markdown
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: URL update verified; note duplication concern.

The URL update is correct and consistent with the webapp changes. However, this constant is duplicated in packages/webapp/src/routes/+layout.ts (line 15).

As noted in the review of packages/webapp/src/routes/+layout.ts, consider extracting REMOTE_SETTINGS_URL to a shared constants file to maintain a single source of truth across the webapp and tauri-app.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8327126 and 2da76c5.

📒 Files selected for processing (3)
  • packages/webapp/src/lib/constants.ts (1 hunks)
  • packages/webapp/src/routes/+layout.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/src/routes/+layout.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/webapp/src/routes/+layout.ts
packages/**

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • packages/webapp/src/lib/constants.ts
  • packages/webapp/src/routes/+layout.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
⏰ 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). (17)
  • GitHub Check: test
  • GitHub Check: standard-tests (ubuntu-latest, test-js-bindings)
  • GitHub Check: standard-tests (ubuntu-latest, rainix-wasm-test)
  • GitHub Check: standard-tests (ubuntu-latest, rainix-sol-legal)
  • GitHub Check: standard-tests (ubuntu-latest, rainix-wasm-artifacts)
  • GitHub Check: standard-tests (ubuntu-latest, ob-rs-test, true)
  • GitHub Check: standard-tests (ubuntu-latest, rainix-sol-artifacts)
  • GitHub Check: standard-tests (ubuntu-latest, rainix-rs-static)
  • GitHub Check: standard-tests (ubuntu-latest, rainix-sol-test)
  • GitHub Check: standard-tests (ubuntu-latest, rainix-sol-static)
  • GitHub Check: standard-tests (ubuntu-latest, rainix-rs-artifacts, true)
  • GitHub Check: test
  • GitHub Check: Deploy-Docs-Preview
  • GitHub Check: Deploy-Preview-Push
  • GitHub Check: build-tauri (ubuntu-22.04, true)
  • GitHub Check: git-clean
  • GitHub Check: test
🔇 Additional comments (2)
packages/webapp/src/routes/+layout.ts (1)

14-15: Remote settings URL verified. Commit c60b0d7e3ff41207eac83968e0b74c715f6ea1a4 exists and settings.yaml is accessible (HTTP 200).

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

1-2: Commit and registry path verified
Commit c60b0d7e3ff41207eac83968e0b74c715f6ea1a4 exists in rain.strategies and the /registry path is accessible (HTTP 200).

Comment thread packages/webapp/src/routes/+layout.ts Outdated
Comment on lines +14 to +15
const REMOTE_SETTINGS_URL =
'https://raw.githubusercontent.com/rainlanguage/rain.strategies/e5fb0899864c9a2b084dd97312f78ccac1444cab/settings.yaml';
'https://raw.githubusercontent.com/rainlanguage/rain.strategies/c60b0d7e3ff41207eac83968e0b74c715f6ea1a4/settings.yaml';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Consider extracting REMOTE_SETTINGS_URL to a shared constant.

The same URL constant is duplicated in tauri-app/src/lib/services/loadRemoteSettings.ts (line 2). This violates the DRY principle and can lead to inconsistencies if one location is updated but not the other.

Consider extracting this constant to a shared location, such as a common constants file that both the webapp and tauri-app can import. This ensures a single source of truth for the remote settings URL.

🤖 Prompt for AI Agents
In packages/webapp/src/routes/+layout.ts around lines 14-15 the
REMOTE_SETTINGS_URL is hardcoded and duplicated in
tauri-app/src/lib/services/loadRemoteSettings.ts; extract this value into a
shared constants module (e.g., packages/shared/src/constants.ts or
packages/common/constants.ts), export REMOTE_SETTINGS_URL from there, update
both packages to depend on that shared package (or add a path alias) and replace
the local hardcoded constants with imports from the shared module, then remove
the duplicate literal and ensure TypeScript build/config (tsconfig paths or
workspace package.json) allows both webapp and tauri-app to resolve the new
shared module.

Copy link
Copy Markdown
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)
packages/webapp/src/routes/+layout.ts (1)

14-15: Duplication issue persists: REMOTE_SETTINGS_URL duplicated across webapp and tauri-app.

This constant remains duplicated in tauri-app/src/lib/services/loadRemoteSettings.ts (line 2), which was previously flagged. The duplication creates a maintenance burden and risk of inconsistency. Additionally, the commit hash c7dbf55fa24d42863b173e39bcd8d67a092dfbfc now appears in three locations across the codebase (this file, tauri-app, and packages/webapp/src/lib/constants.ts).

Consider extracting both the commit hash and the full URLs to a shared constants module to establish a single source of truth. Based on coding guidelines, the webapp and UI components live under packages/*, so a shared package would be appropriate.

</thinking_end -->

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c195759 and bc3c5c7.

📒 Files selected for processing (3)
  • packages/webapp/src/lib/constants.ts (1 hunks)
  • packages/webapp/src/routes/+layout.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/routes/+layout.ts
  • 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/routes/+layout.ts
  • 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/routes/+layout.ts
  • 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
⏰ 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). (17)
  • GitHub Check: test
  • GitHub Check: standard-tests (ubuntu-latest, rainix-wasm-test)
  • GitHub Check: standard-tests (ubuntu-latest, rainix-sol-legal)
  • 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-sol-artifacts)
  • GitHub Check: standard-tests (ubuntu-latest, rainix-wasm-artifacts)
  • GitHub Check: standard-tests (ubuntu-latest, rainix-rs-artifacts, true)
  • GitHub Check: standard-tests (ubuntu-latest, rainix-sol-static)
  • GitHub Check: standard-tests (ubuntu-latest, rainix-sol-test)
  • GitHub Check: standard-tests (ubuntu-latest, ob-rs-test, true)
  • GitHub Check: build-tauri (ubuntu-22.04, true)
  • GitHub Check: test
  • GitHub Check: test
  • GitHub Check: git-clean
  • GitHub Check: Deploy-Preview-Push
  • GitHub Check: Deploy-Docs-Preview
🔇 Additional comments (1)
packages/webapp/src/routes/+layout.ts (1)

14-15: Remote settings URL is valid
Commit c7dbf55fa24d42863b173e39bcd8d67a092dfbfc exists, settings.yaml is present at that ref, and the URL returns HTTP 200.

Comment on lines 1 to +2
export const REGISTRY_URL =
'https://raw.githubusercontent.com/rainlanguage/rain.strategies/e5fb0899864c9a2b084dd97312f78ccac1444cab/registry';
'https://raw.githubusercontent.com/rainlanguage/rain.strategies/c7dbf55fa24d42863b173e39bcd8d67a092dfbfc/registry';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

🧩 Analysis chain

Verify the registry URL accessibility.

Ensure that:

  1. The registry file exists at the specified commit path
  2. The URL is publicly accessible

Also note that the commit hash c7dbf55fa24d42863b173e39bcd8d67a092dfbfc is now duplicated across three files. Consider extracting it as a base constant (e.g., RAIN_STRATEGIES_COMMIT) and composing the URLs from it.

Run the following script to verify:


🏁 Script executed:

#!/bin/bash
# Verify the registry URL is valid and accessible

COMMIT="c7dbf55fa24d42863b173e39bcd8d67a092dfbfc"
REPO="rainlanguage/rain.strategies"

# Check if registry file exists at this commit
echo "Checking if registry file exists..."
gh api repos/$REPO/contents/registry?ref=$COMMIT --jq '.name' 2>&1

# Verify URL accessibility
echo -e "\nVerifying registry URL accessibility..."
curl -I -s "https://raw.githubusercontent.com/$REPO/$COMMIT/registry" | head -n 1

Length of output: 97


🏁 Script executed:

#!/bin/bash
rg -n "c7dbf55fa24d42863b173e39bcd8d67a092dfbfc"

Length of output: 492


Centralize the shared commit hash
The hash c7dbf55fa24d42863b173e39bcd8d67a092dfbfc appears in three places (packages/webapp/src/lib/constants.ts, src/routes/+layout.ts, and tauri-app/src/lib/services/loadRemoteSettings.ts). Extract it as a single RAIN_STRATEGIES_COMMIT constant and build each URL from that.

🤖 Prompt for AI Agents
In packages/webapp/src/lib/constants.ts lines 1-2, extract the hardcoded commit
hash c7dbf55fa24d42863b173e39bcd8d67a092dfbfc into a new exported constant
RAIN_STRATEGIES_COMMIT and redefine REGISTRY_URL by composing the base path with
that constant; then update the other two files (src/routes/+layout.ts and
tauri-app/src/lib/services/loadRemoteSettings.ts) to import
RAIN_STRATEGIES_COMMIT from this module and build their URLs from it so the
commit hash is centralized and reused.

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