Skip to content

Conversation

@findolor
Copy link
Contributor

@findolor findolor commented Nov 10, 2025

Motivation

Solution

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 Polygon and Arbitrum networks and extended metaboard coverage.
  • Performance & Reliability

    • Introduced per-network sync tuning (per-network batching, concurrency, retry, rate-limit, finality and bootstrap thresholds) for more efficient, resilient data sync.
    • Updated sync manifest source to a CDN-backed endpoint for faster, more reliable bootstrap.
  • Chores

    • Replaced legacy single-orderbook config with per-network config and provided a commented template for manual use.

@findolor findolor self-assigned this Nov 10, 2025
@coderabbitai
Copy link

coderabbitai bot commented Nov 10, 2025

Walkthrough

Replaced a global local-db-sync.raindex block with per-subgraph local-db-sync entries for base, polygon, and arbitrum; added polygon under subgraphs and polygon/arbitrum under metaboards; updated local-db-remotes.raindex to a CDN manifest URL in settings.yaml. (≈36 words)

Changes

Cohort / File(s) Summary
Single configuration file
settings.yaml
Added polygon to subgraphs; added polygon and arbitrum to metaboards; replaced one global local-db-sync.raindex with per-subgraph local-db-sync blocks for base, polygon, and arbitrum (each: batch-size: 10000, max-concurrent-batches: 15, retry-attempts: 3, retry-delay-ms: 1000, rate-limit-delay-ms: 5000, finality-depth: 50, bootstrap-block-threshold: 2500); updated local-db-remotes.raindex URL to https://raindex-bootstrap-db.lon1.cdn.digitaloceanspaces.com/manifest.yaml; replaced concrete flare orderbook block with a commented template and retained per-subgraph orderbook blocks for base, polygon, and arbitrum.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Validate YAML syntax and indentation in settings.yaml.
  • Verify the CDN manifest URL and any expected authentication or availability requirements.
  • Confirm that polygon and arbitrum identifiers match consumers elsewhere.
  • Check the chosen per-subgraph sync parameter values for operational suitability.

Possibly related PRs

Suggested reviewers

  • hardyjosh
  • 0xgleb

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add sync settings for remote repository' accurately describes the main change: adding configuration for remote repository synchronization across multiple subgraphs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch remote-repo-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 2302f11 and 20848f2.

📒 Files selected for processing (1)
  • settings.yaml (4 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-04-30T06:32:43.860Z
Learnt from: findolor
Repo: rainlanguage/rain.strategies PR: 29
File: settings.yaml:2-6
Timestamp: 2025-04-30T06:32:43.860Z
Learning: The `network-id` field is intentionally omitted for the flare network in the `settings.yaml` configuration file, unlike other networks which include both `chain-id` and `network-id` fields.

Applied to files:

  • settings.yaml
🔇 Additional comments (4)
settings.yaml (4)

48-48: ✅ Polygon and Arbitrum network coverage is now complete.

The addition of polygon and arbitrum subgraph and metaboard entries extends coverage across four active networks (flare, base, polygon, arbitrum). The entries reference valid Goldsky API endpoints.

Also applies to: 57-58


64-69: Clarify intent behind flare orderbook removal.

The flare orderbook entry (lines 64-69) is now commented out while base, polygon, and arbitrum remain active. This appears intentional given the matching sync configurations below. However, verify that:

  1. Flare network support is being phased out or temporarily disabled
  2. No active deployments depend on the flare orderbook configuration
  3. This aligns with the broader deployment strategy

Also applies to: 70-87


128-151: Verify consistency: all active orderbooks have corresponding sync settings.

Confirm that the sync configurations for base, polygon, and arbitrum align with the active orderbooks defined above (lines 70–87). The absence of flare sync settings is consistent with the commented-out flare orderbook, which is correct.


125-125: The CDN manifest URL is valid and properly configured.

The verification confirms:

  • HTTP/2 200 response with valid YAML content
  • All three required networks present with complete orderbook definitions (base, polygon, arbitrum)
  • Recent metadata indicates active maintenance (last modified Nov 13, 2025)
  • CDN is accessible with acceptable performance

No issues identified.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@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 1378c75 and b338a4b.

📒 Files selected for processing (1)
  • settings.yaml (4 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-04-30T06:32:43.860Z
Learnt from: findolor
Repo: rainlanguage/rain.strategies PR: 29
File: settings.yaml:2-6
Timestamp: 2025-04-30T06:32:43.860Z
Learning: The `network-id` field is intentionally omitted for the flare network in the `settings.yaml` configuration file, unlike other networks which include both `chain-id` and `network-id` fields.

Applied to files:

  • settings.yaml
🔇 Additional comments (5)
settings.yaml (5)

14-25: Network configurations are correct and consistent.

Polygon and arbitrum entries properly include chain IDs, network IDs (matching chain IDs), currencies, and RPC URLs from trusted providers. Structure matches existing networks and preserves flare's intentional omission of network-id.


45-61: Subgraph and metaboard entries are properly configured.

Goldsky API URLs follow consistent patterns and versioning. All four networks (flare, base, polygon, arbitrum) now have corresponding subgraph and metaboard entries.


76-87: Orderbook addresses have inconsistent checksumming format.

The arbitrum orderbook address (line 83) is all lowercase (0x8df8075e4077dabf1e95f49059e4c1eea33094ab), while all other orderbook addresses use mixed-case checksummed format. Although Ethereum addresses are case-insensitive at the protocol level, using consistent checksummed addresses is the industry standard. Verify this is intentional or apply checksummed format.


101-122: Deployer entries are properly configured for all networks.

Polygon and arbitrum deployer entries follow the same structure as existing networks with correct checksummed addresses and network references.


124-125: Verify the CDN manifest URL is reachable and correctly configured.

The local-db-remotes.raindex URL has been updated to a DigitalOcean CDN manifest. Ensure this endpoint is operational and serves the expected manifest format for bootstrap database initialization.

Comment on lines 124 to 155
local-db-sync:
raindex:
batch-size: 1
max-concurrent-batches: 1
retry-attempts: 1
retry-delay-ms: 1
rate-limit-delay-ms: 1
finality-depth: 1
bootstrap-block-threshold: 1
flare:
batch-size: 10000
max-concurrent-batches: 15
retry-attempts: 3
retry-delay-ms: 1000
rate-limit-delay-ms: 5000
finality-depth: 50
base:
batch-size: 10000
max-concurrent-batches: 15
retry-attempts: 3
retry-delay-ms: 1000
rate-limit-delay-ms: 5000
finality-depth: 50
polygon:
batch-size: 10000
max-concurrent-batches: 15
retry-attempts: 3
retry-delay-ms: 1000
rate-limit-delay-ms: 5000
finality-depth: 50
arbitrum:
batch-size: 10000
max-concurrent-batches: 15
retry-attempts: 3
retry-delay-ms: 1000
rate-limit-delay-ms: 5000
finality-depth: 50
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Consolidate duplicate sync settings to reduce code duplication.

All four subgraphs (flare, base, polygon, arbitrum) have identical sync configurations (batch-size, max-concurrent-batches, retry logic, rate limits, finality-depth). This violates the DRY principle. Consider:

  1. Moving identical settings to a shared default if the architecture supports it, or
  2. Documenting why per-subgraph configurations are necessary despite being identical

If per-subgraph settings are required for flexibility but currently identical, consider adding a comment explaining the rationale.

🤖 Prompt for AI Agents
In settings.yaml around lines 127 to 155, the per-subgraph sync blocks (flare,
base, polygon, arbitrum) duplicate identical configuration values; consolidate
by extracting a shared default section (e.g., local-db-sync.default) and have
each subgraph reference or inherit from it, or add a short comment above the
blocks explaining why per-subgraph overrides are required; update the file to
remove repetition by moving shared keys to the default and only keeping
per-subgraph overrides when they differ, ensuring any config loader supports the
new default/inheritance or document the rationale if leaving duplicates.

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.

2 participants