Skip to content

Use proper types for addresses and bytes for local db related logic#2318

Merged
findolor merged 11 commits intomainfrom
sql-value-from-impl
Dec 1, 2025
Merged

Use proper types for addresses and bytes for local db related logic#2318
findolor merged 11 commits intomainfrom
sql-value-from-impl

Conversation

@findolor
Copy link
Copy Markdown
Collaborator

@findolor findolor commented Nov 17, 2025

Chained PR

Motivation

Some of the data structures we had used String and &str types in place of Address, Bytes and U256. This PR aims to fix that by introducing the proper types and refactoring the code base.

Solution

  • Scan the local DB code base and replace all dimension types with their proper definitions.
  • Update tests with the new expected types
  • Update SqlStatement file to have proper from implementations for these new types

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

  • Refactor

    • Switched many internal models to strongly-typed primitives for hashes, addresses and numeric IDs for safer, consistent binary handling.
    • Standardized JSON serialization to camelCase across models.
    • Simplified parameter handling and reduced string-encoding conversions throughout data access paths.
  • Public API

    • Several query and client interfaces now accept/return native binary hash/address types (improved type safety; may affect callers).
  • Tests

    • Updated test fixtures to use the new typed constants and helpers.

✏️ Tip: You can customize this high-level summary in your review settings.

@findolor findolor added this to the LocalDB Implementation milestone Nov 17, 2025
@findolor findolor requested review from 0xgleb and hardyjosh November 17, 2025 11:31
@findolor findolor self-assigned this Nov 17, 2025
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 17, 2025

Walkthrough

Converted many local-db and raindex client APIs and data models from string/Bytes representations to strongly-typed primitives (Address, B256, U256, u32/ u64) and added From conversions into SqlValue; updated SQL parameter bindings and extensive tests accordingly.

Changes

Cohort / File(s) Summary
SqlValue conversions
crates/common/src/local_db/query/sql_statement.rs
Added From/Into<SqlValue> implementations for Address, B256, Bytes, U256, Float, and u32; tests added/updated for formatting and hex casing.
Core query builders & bindings
crates/common/src/local_db/query/* (e.g., clear_orderbook_data/mod.rs, fetch_erc20_tokens_by_addresses/mod.rs, fetch_store_addresses/mod.rs, fetch_target_watermark/mod.rs, upsert_target_watermark/mod.rs, insert_db_metadata/mod.rs)
Replaced manual casts/strings with SqlValue::from(...) for chain_id, orderbook_address, etc.; removed temporary bindings and adjusted tests to expect typed SqlValue variants.
Order-related query APIs
crates/common/src/local_db/query/fetch_order_trades/mod.rs, .../fetch_order_trades_count/mod.rs, .../fetch_orders/mod.rs
Changed order/hash and many model fields to B256, Address, U256, Bytes; updated public function signatures (order_hash now B256/Option<B256>), SQL param construction, serde attributes, and tests.
Vault-related query APIs
crates/common/src/local_db/query/fetch_vault/mod.rs, .../fetch_vault_balance_changes/mod.rs, .../fetch_vaults/mod.rs
Migrated vault_id/token/owner/orderbook types to U256/Address; added #[serde(rename_all="camelCase")] on models; updated builders to pass typed values and adjusted tests.
Pipeline & events (hash types)
crates/common/src/local_db/pipeline/*, crates/common/src/local_db/pipeline/engine.rs, crates/common/src/local_db/pipeline/adapters/*
Switched block/tx hash types and EventsPipeline.block_hash signature from Bytes to B256; adapted engine, runner, environment, adapters, and tests to use B256.
Local DB insert & decoding paths
crates/common/src/local_db/insert.rs, crates/common/src/local_db/decode.rs, crates/common/src/local_db/fetch.rs
Replaced many hex/string encodings with typed Address/B256/U256/Bytes usage in SQL param construction, EventContext, and decoding logic; changed EventType::from_topic signature to accept &[u8].
Raindex client surface & conversions
crates/common/src/raindex_client/* (orders, trades, transactions, vaults, add/remove/orders, local_db/*)
Tightened API types to B256, Address, U256, Bytes; updated public method signatures (e.g., get_by_hash/get_transaction/get_add_orders_for_transaction/get_remove_orders_for_transaction), model fields, TryFrom conversions, wasm bindings, and tests.
RPC client models
crates/common/src/rpc_client.rs
Replaced many RPC model fields with typed primitives (B256, Address, Bytes) and updated tests to construct typed fixtures.
Tests & JS fixtures
packages/orderbook/test/js_api/raindexClient.test.ts, many Rust test modules
Centralized 32-byte constants in JS tests; updated numerous Rust and wasm tests to use address!, b256!, Bytes, U256, and typed expectations throughout.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

  • Heterogeneous, cross-cutting type migrations affecting public signatures, SQL binding behavior, serde mapping, wasm bindings, and many tests.
  • Areas needing extra attention:
    • Public API signature changes (fetch_order_trades, fetch_order_trades_count, fetch_vault_balance_changes, various RaindexClient methods) and all downstream callers.
    • New From<...> → SqlValue conversions: verify encoding, prefixing, hex casing and SQL expectations.
    • Serde changes (added rename_all and removed aliases): confirm deserialization compatibility for persisted/ingested rows.
    • EventsPipeline.block_hash signature change and all trait impls including wasm/non-wasm boundaries.
    • Extensive test updates: ensure tests match runtime formatting and SQL parameter types.

Possibly related issues

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 clearly and concisely describes the main change: replacing string-based types with proper Address, Bytes, and B256 types for local database logic, which is the core objective of this PR.
Docstring Coverage ✅ Passed Docstring coverage is 92.70% which is sufficient. The required threshold is 80.00%.
✨ 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 sql-value-from-impl

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

@findolor
Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 17, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
crates/common/src/local_db/query/fetch_orders/mod.rs (1)

193-245: Tests validate clause insertion and parameter shapes after type changes

The updated tests confirm:

  • active filter parameterization (?1 = 'all'/'active'/'inactive'),
  • replacement of all chain/orderbook markers,
  • lowercase normalization of bound orderbook address params, and
  • that chain IDs are deduped at the SqlValue level.

They don’t yet assert the exact bound values for owner/token/order hash params, but they do verify the presence of the clauses and the overall param count/type, which is sufficient for this refactor’s scope.

Also applies to: 257-306, 308-379

Comment thread crates/common/src/local_db/query/fetch_vaults/mod.rs
Comment thread crates/common/src/raindex_client/local_db/query/fetch_orders.rs
block_number: U256::from(1),
block_timestamp: U256::from(2),
transaction_hash: "0xabc".into(),
transaction_hash: Bytes::from(vec![0x0a, 0xbc]),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

transaction_hash should be B256, not dynamic size Bytes

block_number: U256::from(block),
block_timestamp: Some(U256::from(1)),
transaction_hash: format!("0x{:x}", block),
transaction_hash: B256::from_str(&format!("0x{block:064x}")).unwrap(),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

that's a very odd conversion. consider simply using b256! macro

block_timestamp: Some(U256::from(2)),
transaction_hash: "0xaabbccddeeff00112233445566778899aabbccddeeff00112233445566778899"
.to_string(),
transaction_hash: B256::from_str(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

consider using macros for these kind of cases. there are address!, b256!, fixed_bytes!, and bytes! macros available

#[serde(alias = "order_owner")]
pub order_owner: String,
#[serde(alias = "order_nonce")]
pub orderbook_address: Address,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

consider dropping the _address suffix now that the type signature communicates the same info

pub order_owner: String,
#[serde(alias = "order_nonce")]
pub orderbook_address: Address,
pub order_hash: Bytes,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

consider B256 over Bytes

pub order_hash: String,
pub owner: String,
#[serde(alias = "blockTimestamp")]
pub order_hash: Bytes,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ditto

#[serde(alias = "transaction_hash")]
pub transaction_hash: String,
#[serde(alias = "log_index")]
pub transaction_hash: Bytes,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ditto

exec: &E,
ob_id: &OrderbookIdentifier,
order_hash: &str,
order_hash: Bytes,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ditto

exec: &E,
ob_id: &OrderbookIdentifier,
order_hash: &str,
order_hash: Bytes,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ditto

Comment thread crates/common/src/rpc_client.rs Outdated
pub struct BlockResponse {
pub timestamp: U256,
pub hash: String,
pub hash: Bytes,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ditto

@findolor findolor requested a review from 0xgleb November 26, 2025 16:23
Base automatically changed from local-db-orders-query to main December 1, 2025 16:04
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: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
crates/common/src/raindex_client/orders.rs (1)

445-474: Parse and use the CSV id field instead of hardcoding to a constant.

The try_from_local_db_orders_csv function reads the id from CSV but discards it (via _id_str) and always sets id to 0x0000000000000000000000000000000000000000000000000000000000000001 for all parsed orders. This destroys per-row identity and breaks downstream code that differentiates orders by ID. The function is actively used in vault parsing and the id field is exposed via the WASM API.

Apply the suggested fix: parse id_str, convert it to B256, and use it in the struct. Also add test assertions for the id field to prevent regression.

use super::*;
use crate::raindex_client::orders::RaindexOrder;
use alloy::primitives::{hex::decode, Bytes};
use alloy::primitives::{hex::decode, Bytes, B256};
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

Avoid re‑encoding order bytes before abi_decode

TryInto<OrderV4> for &RaindexOrder currently converts Bytes → hex StringVec<u8> just to call abi_decode, which already works on raw bytes. You can simplify and remove the extra allocation:

-use alloy::primitives::{hex::decode, Bytes, B256};
+use alloy::primitives::{Bytes, B256};
@@
 impl TryInto<OrderV4> for &RaindexOrder {
     type Error = OrderDetailError;
     fn try_into(self) -> Result<OrderV4, Self::Error> {
-        let order = OrderV4::abi_decode(&decode(self.order_bytes().to_string())?)?;
-        Ok(order)
+        // Decode directly from the stored ABI bytes.
+        let order = OrderV4::abi_decode(self.order_bytes().as_ref())?;
+        Ok(order)
     }
 }

Please confirm that the OrderV4::abi_decode(&[u8]) overload is available in your alloy version; if not, keeping the existing code is fine functionally.

Also applies to: 117-122

🤖 Prompt for AI Agents
In crates/common/src/raindex_client/remove_orders.rs around lines 3 and again at
117-122, the code currently re-encodes order bytes by converting Bytes -> hex
String -> Vec<u8> before calling OrderV4::abi_decode; instead, pass the raw byte
slice directly to OrderV4::abi_decode (e.g. call
OrderV4::abi_decode(bytes.as_ref()) or &bytes[..]) and remove the hex::decode
step and intermediate allocations; apply the same replacement at both locations
and keep the rest of the conversion logic unchanged, but only do this if your
alloy version exposes OrderV4::abi_decode(&[u8]).

Comment on lines +142 to +150
#[cfg(target_family = "wasm")]
let order_hash = B256::from_str(&self.order_hash())?;
#[cfg(not(target_family = "wasm"))]
let order_hash = B256::from_str(&self.order_hash().to_string())?;

let local_trades = fetch_order_trades(
&local_db,
&OrderbookIdentifier::new(chain_id, orderbook),
&order_hash,
order_hash,
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

Unnecessary string round-trip in non-WASM path.

In the non-WASM branch, self.order_hash() already returns B256 (per the external context showing pub fn order_hash(&self) -> B256). The conversion B256::from_str(&self.order_hash().to_string()) is redundant and could fail unnecessarily.

Apply this diff:

 #[cfg(target_family = "wasm")]
 let order_hash = B256::from_str(&self.order_hash())?;
 #[cfg(not(target_family = "wasm"))]
-let order_hash = B256::from_str(&self.order_hash().to_string())?;
+let order_hash = self.order_hash();

This matches the pattern used in get_trade_count at line 265, which directly assigns self.order_hash() for non-WASM.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#[cfg(target_family = "wasm")]
let order_hash = B256::from_str(&self.order_hash())?;
#[cfg(not(target_family = "wasm"))]
let order_hash = B256::from_str(&self.order_hash().to_string())?;
let local_trades = fetch_order_trades(
&local_db,
&OrderbookIdentifier::new(chain_id, orderbook),
&order_hash,
order_hash,
#[cfg(target_family = "wasm")]
let order_hash = B256::from_str(&self.order_hash())?;
#[cfg(not(target_family = "wasm"))]
let order_hash = self.order_hash();
let local_trades = fetch_order_trades(
&local_db,
&OrderbookIdentifier::new(chain_id, orderbook),
order_hash,
🤖 Prompt for AI Agents
In crates/common/src/raindex_client/trades.rs around lines 142 to 150, the
non-WASM branch unnecessarily converts self.order_hash() to a string and
reparses it; instead, assign the B256 directly. Replace the non-wasm path so it
sets order_hash = self.order_hash() (matching the pattern used in
get_trade_count) and remove the to_string()/from_str round-trip to avoid
redundant work and potential parse errors.

Comment on lines 33 to 44
pub struct LogEntryResponse {
pub address: String,
pub topics: Vec<String>,
pub data: String,
pub address: Address,
pub topics: Vec<Bytes>,
pub data: Bytes,
pub block_number: U256,
pub block_timestamp: Option<U256>,
pub transaction_hash: String,
pub transaction_hash: B256,
pub transaction_index: String,
pub block_hash: String,
pub block_hash: B256,
pub log_index: U256,
pub removed: bool,
}
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 using B256 for topics instead of Vec<Bytes>.

Ethereum log topics are always 32-byte values (keccak256 hashes or padded values). Using Vec<B256> would be more semantically correct and provide compile-time size guarantees. However, if the current Vec<Bytes> approach works with the existing deserialization and downstream usage, this is a minor concern.

 pub struct LogEntryResponse {
     pub address: Address,
-    pub topics: Vec<Bytes>,
+    pub topics: Vec<B256>,
     pub data: Bytes,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
pub struct LogEntryResponse {
pub address: String,
pub topics: Vec<String>,
pub data: String,
pub address: Address,
pub topics: Vec<Bytes>,
pub data: Bytes,
pub block_number: U256,
pub block_timestamp: Option<U256>,
pub transaction_hash: String,
pub transaction_hash: B256,
pub transaction_index: String,
pub block_hash: String,
pub block_hash: B256,
pub log_index: U256,
pub removed: bool,
}
pub struct LogEntryResponse {
pub address: Address,
pub topics: Vec<B256>,
pub data: Bytes,
pub block_number: U256,
pub block_timestamp: Option<U256>,
pub transaction_hash: B256,
pub transaction_index: String,
pub block_hash: B256,
pub log_index: U256,
pub removed: bool,
}
🤖 Prompt for AI Agents
In crates/common/src/rpc_client.rs around lines 33 to 44, the LogEntryResponse
struct uses topics: Vec<Bytes> but Ethereum topics are fixed 32-byte values;
change the type to topics: Vec<B256> and update imports/usages accordingly,
ensuring serde (or your deserialization layer) can map the incoming hex/bytes
into B256 (add/from_bytes or derive Deserialize for B256 or implement a custom
serde visitor if needed), update any downstream code that expects Vec<Bytes> to
use Vec<B256> (or convert where necessary), and run cargo build/tests to confirm
deserialization and consumers compile.

@findolor findolor merged commit 43566c9 into main Dec 1, 2025
20 checks passed
@findolor findolor deleted the sql-value-from-impl branch December 1, 2025 20:29
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 1, 2025

@coderabbitai assess this PR size classification for the totality of the PR with the following criterias and report it in your comment:

S/M/L PR Classification Guidelines:

This guide helps classify merged pull requests by effort and complexity rather than just line count. The goal is to assess the difficulty and scope of changes after they have been completed.

Small (S)

Characteristics:

  • Simple bug fixes, typos, or minor refactoring
  • Single-purpose changes affecting 1-2 files
  • Documentation updates
  • Configuration tweaks
  • Changes that require minimal context to review

Review Effort: Would have taken 5-10 minutes

Examples:

  • Fix typo in variable name
  • Update README with new instructions
  • Adjust configuration values
  • Simple one-line bug fixes
  • Import statement cleanup

Medium (M)

Characteristics:

  • Feature additions or enhancements
  • Refactoring that touches multiple files but maintains existing behavior
  • Breaking changes with backward compatibility
  • Changes requiring some domain knowledge to review

Review Effort: Would have taken 15-30 minutes

Examples:

  • Add new feature or component
  • Refactor common utility functions
  • Update dependencies with minor breaking changes
  • Add new component with tests
  • Performance optimizations
  • More complex bug fixes

Large (L)

Characteristics:

  • Major feature implementations
  • Breaking changes or API redesigns
  • Complex refactoring across multiple modules
  • New architectural patterns or significant design changes
  • Changes requiring deep context and multiple review rounds

Review Effort: Would have taken 45+ minutes

Examples:

  • Complete new feature with frontend/backend changes
  • Protocol upgrades or breaking changes
  • Major architectural refactoring
  • Framework or technology upgrades

Additional Factors to Consider

When deciding between sizes, also consider:

  • Test coverage impact: More comprehensive test changes lean toward larger classification
  • Risk level: Changes to critical systems bump up a size category
  • Team familiarity: Novel patterns or technologies increase complexity

Notes:

  • the assessment must be for the totality of the PR, that means comparing the base branch to the last commit of the PR
  • the assessment output must be exactly one of: S, M or L (single-line comment) in format of: SIZE={S/M/L}
  • do not include any additional text, only the size classification
  • your assessment comment must not include tips or additional sections
  • do NOT tag me or anyone else on your comment

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 1, 2025

Tip

For best results, initiate chat on the files or code changes.

SIZE=L


🧠 Learnings used
Learnt from: rouzwelt
Repo: rainlanguage/rain.orderbook PR: 0
File: :0-0
Timestamp: 2025-05-21T21:24:42.275Z
Learning: For PR #1884, after each commit review, I should provide a new comment with a PR size report in the format: `TOTAL=number ADDITIONS=number DELETIONS=number`, excluding irrelevant files such as lock files (package-lock.json, cargo.lock, etc.).

Learnt from: rouzwelt
Repo: rainlanguage/rain.orderbook PR: 0
File: :0-0
Timestamp: 2025-05-21T21:24:42.275Z
Learning: After each commit in PR #1884, I should provide a new comment with the PR size report in the format: `TOTAL=number ADDITIONS=number DELETIONS=number`. The report should exclude irrelevant files such as lock files (e.g., package-lock.json, cargo.lock).

Learnt from: rouzwelt
Repo: rainlanguage/rain.orderbook PR: 0
File: :0-0
Timestamp: 2025-05-21T21:25:47.873Z
Learning: After each new commit review for rainlanguage/rain.orderbook repository, generate a PR size report in a separate comment with the format: "TOTAL=number ADDITIONS=number DELETIONS=number". This report should exclude irrelevant files such as lock files (e.g., package-lock.json, cargo.lock).

Learnt from: rouzwelt
Repo: rainlanguage/rain.orderbook PR: 0
File: :0-0
Timestamp: 2025-05-21T21:25:47.873Z
Learning: After each new commit review for rainlanguage/rain.orderbook repository, generate a PR size report in a separate comment with the exact format: "TOTAL=number\nADDITIONS=number\nDELETIONS=number". This report should exclude irrelevant files such as lock files (package-lock.json, yarn.lock, pnpm-lock.yaml, cargo.lock).

Learnt from: rouzwelt
Repo: rainlanguage/rain.orderbook PR: 0
File: :0-0
Timestamp: 2025-05-21T22:14:22.646Z
Learning: For PR #1884 in rainlanguage/rain.orderbook, I must consistently report the PR size after EVERY new commit in the exact format "TOTAL=number\nADDITIONS=number\nDELETIONS=number" without any formatting blocks. The report must exclude lock files (package-lock.json, yarn.lock, pnpm-lock.yaml, cargo.lock) and can be included either as part of the review or as a separate comment.

Learnt from: rouzwelt
Repo: rainlanguage/rain.orderbook PR: 0
File: :0-0
Timestamp: 2025-05-21T22:14:22.646Z
Learning: For PR #1884 in rainlanguage/rain.orderbook, I must consistently report the PR size after EVERY new commit in the exact format "TOTAL=number\nADDITIONS=number\nDELETIONS=number" without any additional text or formatting blocks. The report must exclude lock files (package-lock.json, yarn.lock, pnpm-lock.yaml, cargo.lock) and can be included either as part of the review or as a separate comment.

Learnt from: rouzwelt
Repo: rainlanguage/rain.orderbook PR: 0
File: :0-0
Timestamp: 2025-05-21T22:46:08.530Z
Learning: For PR #1884 in rainlanguage/rain.orderbook, the PR size report should be the only content in the comment - no text before it, no text after it, no formatting blocks, just the raw report in the exact format: "TOTAL=number\nADDITIONS=number\nDELETIONS=number". The report must exclude lock files (package-lock.json, yarn.lock, pnpm-lock.yaml, cargo.lock).

Learnt from: rouzwelt
Repo: rainlanguage/rain.orderbook PR: 0
File: :0-0
Timestamp: 2025-05-21T21:24:53.708Z
Learning: For PR #1884 in rainlanguage/rain.orderbook, provide a separate comment after each review with PR size statistics in the format: `TOTAL=number ADDITIONS=number DELETIONS=number`, excluding lock files like package-lock.json and cargo.lock.

Learnt from: rouzwelt
Repo: rainlanguage/rain.orderbook PR: 0
File: :0-0
Timestamp: 2025-05-21T21:24:53.708Z
Learning: For PR #1884 in rainlanguage/rain.orderbook, provide a separate comment after each review with PR size statistics in the format: `TOTAL=number ADDITIONS=number DELETIONS=number`, excluding lock files like package-lock.json and cargo.lock.

Learnt from: rouzwelt
Repo: rainlanguage/rain.orderbook PR: 0
File: :0-0
Timestamp: 2025-05-21T21:24:53.708Z
Learning: For PR #1884 in rainlanguage/rain.orderbook, provide a separate comment after each review with PR size statistics in the format: `TOTAL=number ADDITIONS=number DELETIONS=number`, excluding lock files like package-lock.json and cargo.lock.

Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 1971
File: .github/workflows/vercel-docs-prod.yaml:32-34
Timestamp: 2025-07-11T12:30:09.245Z
Learning: findolor prefers not to pin Node versions explicitly in GitHub Actions workflows when using Nix with webapp-shell, considering the current setup sufficient for deterministic builds in the rainlanguage/rain.orderbook project.

Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 1971
File: .github/workflows/vercel-docs-prod.yaml:10-14
Timestamp: 2025-07-11T12:29:49.284Z
Learning: In GitHub Actions workflows for the rainlanguage/rain.orderbook project, findolor is comfortable with job names that may seem misleading (like "Deploy-Docs-Preview" in a production workflow) when there's only one job in the workflow, as the context makes it clear enough.

Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 1956
File: crates/common/src/fuzz/mod.rs:64-64
Timestamp: 2025-07-04T09:02:57.301Z
Learning: In rainlanguage/rain.orderbook, user findolor prefers to limit type consistency changes to only the parts directly related to the current work scope. For example, when updating chain_id fields from u64 to u32 in fuzz-related code, unrelated files like tauri-app wallet commands can remain as u64 if they serve different purposes and aren't part of the current changes.

Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 2000
File: crates/common/src/raindex_client/vaults.rs:183-183
Timestamp: 2025-07-16T10:40:05.717Z
Learning: In the rainlanguage/rain.orderbook codebase, user findolor considers breaking changes from Option<U256> to U256 for required fields like decimals in RaindexVaultToken to be acceptable and safe, even when they affect multiple usage sites across the codebase.

Learnt from: rouzwelt
Repo: rainlanguage/rain.orderbook PR: 0
File: :0-0
Timestamp: 2025-05-21T21:24:53.708Z
Learning: For PR #1884 in rainlanguage/rain.orderbook, provide a separate comment after each review with PR size statistics in the format: `TOTAL=number ADDITIONS=number DELETIONS=number`, excluding lock files like package-lock.json and cargo.lock.

Learnt from: rouzwelt
Repo: rainlanguage/rain.orderbook PR: 0
File: :0-0
Timestamp: 2025-05-21T21:26:31.566Z
Learning: For PR #1884 and future PRs in rainlanguage/rain.orderbook repository, provide PR size reports in a separate comment with ONLY the exact format "TOTAL=number\nADDITIONS=number\nDELETIONS=number", without any additional text or explanation. Reports should exclude irrelevant files such as lock files (package-lock.json, yarn.lock, pnpm-lock.yaml, cargo.lock).

Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 2117
File: crates/js_api/src/gui/select_tokens.rs:421-424
Timestamp: 2025-09-02T08:04:34.729Z
Learning: User findolor in the rainlanguage/rain.orderbook codebase prefers not to change test code when tests are already passing, even if there appear to be type mismatches or potential issues. Working tests should be left alone unless there are actual errors.

Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 1994
File: crates/common/src/raindex_client/vaults.rs:59-59
Timestamp: 2025-07-16T05:52:05.576Z
Learning: User findolor prefers to handle documentation updates for getter methods in batch via dedicated PRs rather than addressing them individually during feature development, as mentioned for the formatted amount string fields in crates/common/src/raindex_client/vaults.rs.

@coderabbitai coderabbitai Bot mentioned this pull request Dec 2, 2025
4 tasks
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.

3 participants