Skip to content

Add sync settings for remote repository#69

Open
findolor wants to merge 15 commits intomainfrom
remote-repo-settings
Open

Add sync settings for remote repository#69
findolor wants to merge 15 commits intomainfrom
remote-repo-settings

Conversation

@findolor
Copy link
Copy Markdown
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 Base orderbook support and expanded network coverage (Base, Polygon, Arbitrum).
  • Performance & Reliability

    • Per-network sync tuning (larger batch size, higher concurrency, retry/rate-limit/finality/bootstrap thresholds).
    • Sync manifest source updated to a CDN-backed endpoint for faster, more reliable bootstrap.
  • Chores

    • Config schema version incremented.
    • Legacy orderbook disabled (commented) and registry references updated to a newer commit.

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

coderabbitai bot commented Nov 10, 2025

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Bumped Rain schema version from 4→5 in multiple strategy files; updated registry pointers to a new commit; modified settings.yaml (version 4→5): added orderbooks.base-v6, commented out orderbooks.flare, replaced local-db-sync.raindex with per-subgraph sync blocks, and updated local-db-remotes.raindex URL. (≈38 words)

Changes

Cohort / File(s) Summary
Primary configuration
settings.yaml
Incremented version: 45; added orderbooks.base-v6 (address, network base, base subgraph, deployment-block, local-db-remote: raindex); commented-out orderbooks.flare block; updated local-db-remotes.raindex to https://raindex-bootstrap-db.lon1.digitaloceanspaces.com/manifest.yaml; replaced global local-db-sync.raindex with per-subgraph local-db-sync mappings for base, polygon, and arbitrum using batch-size 10000, max-concurrent-batches 15, retry 3/1000ms, rate-limit-delay 5000ms, finality-depth 50, bootstrap-block-threshold 2500.
Registry pointers
registry
Updated multiple strategy registry entries (fixed-limit, auction-dca, grid, dynamic-spread, canary, claims, fixed-spread, folio) to reference a new commit 37772a32... instead of 8fdd42b5... in their .rain source URLs.
Strategy files (version bumps)
src/auction-dca.rain, src/canary.rain, src/claims.rain, src/dynamic-spread.rain, src/fixed-limit.rain, src/fixed-spread.rain, src/folio.rain, src/grid.rain
Updated top-level version: 4version: 5 in each file only; no other logic or parameter changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • hardyjosh
  • 0xgleb
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Add sync settings for remote repository' is vague and does not clearly reflect the main changes in the PR, which involve version bumps to v5, configuration updates, and registry updates. Consider a more specific title that captures the primary changes, such as 'Bump to version 5 and update remote sync configuration' or 'Update settings, strategies, and registry to v5'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch remote-repo-settings

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

@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 thread settings.yaml
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
Copy Markdown

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.

Copy link
Copy Markdown

@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: 2

🤖 Fix all issues with AI agents
In `@settings.yaml`:
- Around line 64-69: The Flare orderbook block (key "flare") is commented out
but Flare is still present in other sections ("networks", "subgraphs",
"metaboards", "deployers"), causing inconsistent configuration; either fully
disable Flare by commenting out or removing the corresponding entries under
those sections (networks, subgraphs, metaboards, deployers) or add a clear
explanatory comment above the flare-related entries in each section explaining
why the orderbook is disabled while other Flare entries remain active so readers
understand the intentional mismatch (refer to the keys "flare", "networks",
"subgraphs", "metaboards", and "deployers" when updating).
- Around line 88-93: The base-v6 orderbook lacks an explicit local-db-sync entry
and currently appears to rely implicitly on the base entry; either add a
dedicated local-db-sync: base-v6 block mirroring the intended sync parameters
(e.g., network/subgraph/local-db-remote/deployment-block) so base-v6 has
explicit sync settings, or add a clear comment/documentation near the
local-db-sync and base-v6 entries stating that base-v6 intentionally inherits
the base local-db-sync configuration; update the local-db-sync mapping (or docs)
to reference the exact fields used by base-v6 so future readers know this is
deliberate.

Comment thread settings.yaml Outdated
Comment thread settings.yaml Outdated
Copy link
Copy Markdown

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@registry`:
- Around line 1-8: The registry file is missing the required settings URL entry;
add a line named "settings" that points to the settings.rain file at the same
pinned commit used by the other strategy URLs (the commit
37772a32dc5d2695d06a7315aa293f9ad3c5a605) so consumers can fetch both settings
and strategy sources—i.e., insert a "settings
https://raw.githubusercontent.com/rainlanguage/rain.strategies/37772a32dc5d2695d06a7315aa293f9ad3c5a605/src/settings.rain"
entry alongside the existing fixed-limit, auction-dca, grid, dynamic-spread,
canary, claims, fixed-spread, and folio lines.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4b4e7259-9670-4dba-886e-3317834ed619

📥 Commits

Reviewing files that changed from the base of the PR and between 13fd541 and 93fd32c.

📒 Files selected for processing (10)
  • registry
  • settings.yaml
  • src/auction-dca.rain
  • src/canary.rain
  • src/claims.rain
  • src/dynamic-spread.rain
  • src/fixed-limit.rain
  • src/fixed-spread.rain
  • src/folio.rain
  • src/grid.rain

Comment thread registry Outdated
Comment on lines +1 to +8
fixed-limit https://raw.githubusercontent.com/rainlanguage/rain.strategies/37772a32dc5d2695d06a7315aa293f9ad3c5a605/src/fixed-limit.rain
auction-dca https://raw.githubusercontent.com/rainlanguage/rain.strategies/37772a32dc5d2695d06a7315aa293f9ad3c5a605/src/auction-dca.rain
grid https://raw.githubusercontent.com/rainlanguage/rain.strategies/37772a32dc5d2695d06a7315aa293f9ad3c5a605/src/grid.rain
dynamic-spread https://raw.githubusercontent.com/rainlanguage/rain.strategies/37772a32dc5d2695d06a7315aa293f9ad3c5a605/src/dynamic-spread.rain
canary https://raw.githubusercontent.com/rainlanguage/rain.strategies/37772a32dc5d2695d06a7315aa293f9ad3c5a605/src/canary.rain
claims https://raw.githubusercontent.com/rainlanguage/rain.strategies/37772a32dc5d2695d06a7315aa293f9ad3c5a605/src/claims.rain
fixed-spread https://raw.githubusercontent.com/rainlanguage/rain.strategies/37772a32dc5d2695d06a7315aa293f9ad3c5a605/src/fixed-spread.rain
folio https://raw.githubusercontent.com/rainlanguage/rain.strategies/37772a32dc5d2695d06a7315aa293f9ad3c5a605/src/folio.rain
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Add the missing settings URL entry to the registry.

Lines 1-8 pin strategy URLs correctly, but the registry is missing a settings URL line, so the registry is incomplete for consumers expecting both settings and strategy sources.

Suggested patch
+settings https://raw.githubusercontent.com/rainlanguage/rain.strategies/37772a32dc5d2695d06a7315aa293f9ad3c5a605/settings.yaml
 fixed-limit https://raw.githubusercontent.com/rainlanguage/rain.strategies/37772a32dc5d2695d06a7315aa293f9ad3c5a605/src/fixed-limit.rain
 auction-dca https://raw.githubusercontent.com/rainlanguage/rain.strategies/37772a32dc5d2695d06a7315aa293f9ad3c5a605/src/auction-dca.rain
 grid https://raw.githubusercontent.com/rainlanguage/rain.strategies/37772a32dc5d2695d06a7315aa293f9ad3c5a605/src/grid.rain
 dynamic-spread https://raw.githubusercontent.com/rainlanguage/rain.strategies/37772a32dc5d2695d06a7315aa293f9ad3c5a605/src/dynamic-spread.rain
 canary https://raw.githubusercontent.com/rainlanguage/rain.strategies/37772a32dc5d2695d06a7315aa293f9ad3c5a605/src/canary.rain
 claims https://raw.githubusercontent.com/rainlanguage/rain.strategies/37772a32dc5d2695d06a7315aa293f9ad3c5a605/src/claims.rain
 fixed-spread https://raw.githubusercontent.com/rainlanguage/rain.strategies/37772a32dc5d2695d06a7315aa293f9ad3c5a605/src/fixed-spread.rain
 folio https://raw.githubusercontent.com/rainlanguage/rain.strategies/37772a32dc5d2695d06a7315aa293f9ad3c5a605/src/folio.rain

As per coding guidelines, registry file must list the settings URL and all strategy URLs pinned to a specific git commit hash.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@registry` around lines 1 - 8, The registry file is missing the required
settings URL entry; add a line named "settings" that points to the settings.rain
file at the same pinned commit used by the other strategy URLs (the commit
37772a32dc5d2695d06a7315aa293f9ad3c5a605) so consumers can fetch both settings
and strategy sources—i.e., insert a "settings
https://raw.githubusercontent.com/rainlanguage/rain.strategies/37772a32dc5d2695d06a7315aa293f9ad3c5a605/src/settings.rain"
entry alongside the existing fixed-limit, auction-dca, grid, dynamic-spread,
canary, claims, fixed-spread, and folio lines.

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