Skip to content

Add metaboard neutralization, order caching, direct trades, quote chunking, and nginx hardening#83

Open
findolor wants to merge 1 commit into
review/alastair-order-caching-timeoutfrom
review/alastair-metaboard-direct-trades
Open

Add metaboard neutralization, order caching, direct trades, quote chunking, and nginx hardening#83
findolor wants to merge 1 commit into
review/alastair-order-caching-timeoutfrom
review/alastair-metaboard-direct-trades

Conversation

@findolor
Copy link
Copy Markdown
Collaborator

Motivation

This PR preserves direct-pushed commit 50e7fd9 for review after removing it from the intended main history. It is stacked on #82 and contains the second original direct-pushed commit.

Solution

  • Neutralize metaboard YAML lookups to avoid unused network work.
  • Add direct trade lookup/caching-related changes from the original commit.
  • Chunk order quote batches and include nginx/server hardening changes from the original commit.

Checks

Not run in this worktree while reconstructing the review stack.

Stack note: merge/review after #82. This PR is temporarily based on review/alastair-order-caching-timeout; once main is reset, the stack can be retargeted as needed.

…nking, and nginx hardening

- Neutralize metaboard YAML section to skip ~5s Goldsky lookups per request
- Add DirectTradesFetcher for batch SQLite trade queries
- Set quote batch chunk_size=4 to avoid RPC gas limit probe-and-split retries
- Harden nginx: rate limiting (10r/s burst 20), security headers, exploit scanner blocking
- Update disk device path and nix sandbox setting for new server

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 20, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ab0021b0-3dcf-4541-9f5b-78bf9a2c301f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch review/alastair-metaboard-direct-trades

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.

findolor added a commit that referenced this pull request Apr 20, 2026
Reverts the three direct commits pushed by Alastair so main returns to the reviewed d924310 tree state while preserving the changes for review in PRs #82, #83, and #84.
graphite-app Bot pushed a commit that referenced this pull request Apr 27, 2026
## Motivation

Three commits were pushed directly to `main` without the normal PR review flow:

- `543a103` - Add order caching and fix trades-by-address timeout
- `50e7fd9` - Add metaboard neutralization, order caching, direct trades, quote chunking, and nginx hardening
- `b1ebea3` - Skip RPC quotes for zero-balance orders and add stage timing

Branch protection currently prevents rewriting `main`, so this PR restores the reviewed tree state with a normal revert commit instead. The original changes are preserved for review in #82, #83, and #84.

## Solution

- Revert the three direct-pushed commits in newest-to-oldest order.
- Fold the revert into a single commit for review clarity.
- Leave the original changes available in the stacked review PRs.

## Checks

- `nix develop -c cargo fmt`
- `nix develop -c rainix-rs-static`

Note: `rainix-rs-static` passed, with existing warnings reported in the nested `rain.orderbook` crate.

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

## Release Notes

* **Removed Features**
  * Disabled trade-related API endpoints (`GET /trades/by-tx`, `GET /trades/by-address`, batch trade queries).
  * Removed in-memory caching layer for order listings.

* **Improvements**
  * Simplified application architecture by removing unnecessary caching mechanisms and dependencies.
  * Streamlined order retrieval logic.

* **Infrastructure**
  * Updated server configuration and system settings.
  * Removed local database storage layer integration.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
graphite-app Bot pushed a commit that referenced this pull request May 6, 2026
## Motivation

This PR preserves direct-pushed commit `b1ebea3` for review after removing it from the intended `main` history. It is stacked on #83 and contains the third original direct-pushed commit.

The zero-balance quote skip now belongs in Raindex so order pagination and totals are filtered before the REST API fetches quotes. This REST PR now delegates that predicate to the SDK instead of parsing/filtering balances locally.

## Depends On

- rainlanguage/raindex#2562 (`feat: add positive output vault balance order filter`)
- This PR bumps `lib/rain.orderbook` to `014016c699a2da4aa27d335bbf565e7347c2f762`, which is from that Raindex work and exposes `has_positive_output_vault_balance`.

## Solution

- Pass `has_positive_output_vault_balance: Some(true)` when listing orders by owner or token.
- Remove REST-side output balance parsing/filtering and quote the SDK-filtered orders directly.
- Keep stage timing instrumentation from the original commit.
- Update REST compatibility for the newer SDK bindings, take-order candidate signature, signed context field, and spec version 5 test fixtures.

## Checks

- `nix develop -c cargo fmt`
- `nix develop -c cargo check`
- `nix develop -c cargo test routes::orders`
- `nix develop -c cargo test`
- `nix develop -c rainix-rs-static` fails on existing clippy `too_many_arguments` errors in `src/routes/trades.rs` route handlers.

Stack note: merge/review after #82 and #83. This PR is based on `review/alastair-metaboard-direct-trades`.

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

* **New Features**
  * Orders now filtered to include only those with a positive output vault balance
  * Added support for version-5 Raindex registry configuration

* **Tests**
  * Expanded token listing tests and remote-token scenario coverage
  * Added/updated tests for version-5 Raindex registry compatibility

* **Chores**
  * Updated submodule reference and adjusted build/prep configuration paths
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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