Skip to content

Rename DotrainGuiStateV1 to OrderBuilderStateV1#93

Open
findolor wants to merge 6 commits intomainfrom
rename-gui-state-to-order-builder-state
Open

Rename DotrainGuiStateV1 to OrderBuilderStateV1#93
findolor wants to merge 6 commits intomainfrom
rename-gui-state-to-order-builder-state

Conversation

@findolor
Copy link
Copy Markdown
Contributor

@findolor findolor commented Feb 24, 2026

Motivation

The "GUI" terminology is being phased out across the Rain ecosystem in favor of "Order Builder", which more accurately describes the purpose of these types — they configure order building, not a GUI specifically. This rename aligns rain.metadata with the ongoing renaming effort in rain.orderbook.

Solution

Renames DotrainGuiStateV1 to OrderBuilderStateV1 across 4 files:

  • gui_state_v1.rsorder_builder_state_v1.rs: Renamed file and all struct references, trait implementations, doc comments, and tests
  • magic.rs: KnownMagic::DotrainGuiStateV1KnownMagic::OrderBuilderStateV1 (magic number value 0xffda7b2fb167c286 unchanged)
  • mod.rs (meta): KnownMeta::DotrainGuiStateV1KnownMeta::OrderBuilderStateV1
  • mod.rs (dotrain): Module declaration gui_state_v1order_builder_state_v1

No functional changes. Wire format is unchanged.

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
    • Renamed a public meta/state type used in saved metadata and round‑trip serialization for clearer naming; behavior and underlying identifiers remain unchanged.
  • Tests
    • Updated tests and metadata round‑trip checks to reflect the renamed type and ensure serialization/deserialization remain identical.
    • Updated a network-specific test to skip execution in CI to avoid unstable historical RPC queries.

Renames gui_state_v1.rs to order_builder_state_v1.rs and updates the
struct, KnownMagic variant, and KnownMeta variant accordingly. The magic
number value is unchanged.
@findolor findolor self-assigned this Feb 24, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 24, 2026

Walkthrough

Rename of the CLI metadata type DotrainGuiStateV1 to OrderBuilderStateV1 across the metadata system, updating enum variants, module exports, type definitions, conversions, CBOR (de)serialization, and tests; plus a small test runtime skip added for CI in a Solidity test.

Changes

Cohort / File(s) Summary
Enum & conversion updates
crates/cli/src/meta/magic.rs, crates/cli/src/meta/mod.rs
Renamed enum variant DotrainGuiStateV1OrderBuilderStateV1 (same u64 discriminant). Updated TryFrom<u64> for KnownMagic, TryFrom<KnownMagic> for KnownMeta, and RainMetaDocumentV1Item::unpack_into match arms to use the new variant.
Module export
crates/cli/src/meta/types/dotrain/mod.rs
Replaced exported module gui_state_v1 with order_builder_state_v1.
Type, impls, conversions, serialization, tests
crates/cli/src/meta/types/dotrain/order_builder_state_v1.rs
Renamed public struct and all internal references from DotrainGuiStateV1OrderBuilderStateV1. Updated wasm trait macro invocations, impl blocks, From/TryFrom conversions to/from RainMetaDocumentV1Item, CBOR packing/unpacking, magic checks, documentation strings, and updated tests and test helpers to use the new type and KnownMagic variant.
CI-safe test skip
test/lib/deploy/LibMetaBoardDeploy.t.sol
Added vm.skip(vm.envOr("CI", false)) to testIsStartBlockArbitrum() to skip the Arbitrum start-block check when running in CI; added explanatory comments.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ 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 accurately describes the primary change: renaming the DotrainGuiStateV1 type to OrderBuilderStateV1 across the codebase.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch rename-gui-state-to-order-builder-state

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

Caution

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

⚠️ Outside diff range comments (3)
crates/cli/src/meta/types/dotrain/order_builder_state_v1.rs (2)

13-23: 🧹 Nitpick | 🔵 Trivial

Nit: doc comment still references "dotrain instance".

Line 13: "Configuration for a value field in the dotrain instance" — consider updating to "order builder state" or simply "order builder" to match the new terminology.

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

In `@crates/cli/src/meta/types/dotrain/order_builder_state_v1.rs` around lines 13
- 23, Update the struct doc comment for ValueCfg to remove the outdated "dotrain
instance" wording and reference the new terminology (e.g., "order builder state"
or "order builder"); locate the ValueCfg definition and change the first line
comment to something like "Configuration for a value field in the order builder
state" so the documentation matches the current domain language.

40-44: 🧹 Nitpick | 🔵 Trivial

Stale doc comment: still says "Dotrain Instance V1 metadata".

The struct doc comment should be updated to reflect the new naming, e.g., "Order Builder State V1 metadata".

📝 Proposed fix
-/// Dotrain Instance V1 metadata - contains user's specific configuration
-/// for a deployed order referencing a dotrain template
+/// Order Builder State V1 metadata - contains user's specific configuration
+/// for a deployed order referencing a dotrain template
 #[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
 #[cfg_attr(target_family = "wasm", derive(Tsify))]
 pub struct OrderBuilderStateV1 {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/cli/src/meta/types/dotrain/order_builder_state_v1.rs` around lines 40
- 44, The struct doc comment for OrderBuilderStateV1 is stale ("Dotrain Instance
V1 metadata"); update the doc comment above the OrderBuilderStateV1 definition
to reflect the new name (e.g., "Order Builder State V1 metadata - contains
user's specific configuration for a deployed order referencing a dotrain
template") so the comment matches the struct name and purpose.
crates/cli/src/meta/magic.rs (1)

173-178: 🧹 Nitpick | 🔵 Trivial

Nit: test function name is stale.

test_dotrain_instance_meta_v1 should be renamed to match the new variant name (e.g., test_order_builder_state_v1) for consistency with the rest of the rename.

📝 Proposed fix
     #[test]
-    fn test_dotrain_instance_meta_v1() {
+    fn test_order_builder_state_v1() {
         let magic_number = KnownMagic::OrderBuilderStateV1;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/cli/src/meta/magic.rs` around lines 173 - 178, The test function name
is stale; rename the test function test_dotrain_instance_meta_v1 to match the
new variant naming (e.g., test_order_builder_state_v1) so it reflects
KnownMagic::OrderBuilderStateV1 and keeps consistency; update the function
declaration and any references to the old name in the file
crate::cli::meta::magic (the test containing the assert_hex) to the new name.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@crates/cli/src/meta/magic.rs`:
- Around line 42-43: Update the stale doc comment on the OrderBuilderStateV1
variant: replace "Dotrain instance meta v1" with a correct description such as
"Order builder state meta v1" so the documentation matches the enum variant
OrderBuilderStateV1 and its purpose.

---

Outside diff comments:
In `@crates/cli/src/meta/magic.rs`:
- Around line 173-178: The test function name is stale; rename the test function
test_dotrain_instance_meta_v1 to match the new variant naming (e.g.,
test_order_builder_state_v1) so it reflects KnownMagic::OrderBuilderStateV1 and
keeps consistency; update the function declaration and any references to the old
name in the file crate::cli::meta::magic (the test containing the assert_hex) to
the new name.

In `@crates/cli/src/meta/types/dotrain/order_builder_state_v1.rs`:
- Around line 13-23: Update the struct doc comment for ValueCfg to remove the
outdated "dotrain instance" wording and reference the new terminology (e.g.,
"order builder state" or "order builder"); locate the ValueCfg definition and
change the first line comment to something like "Configuration for a value field
in the order builder state" so the documentation matches the current domain
language.
- Around line 40-44: The struct doc comment for OrderBuilderStateV1 is stale
("Dotrain Instance V1 metadata"); update the doc comment above the
OrderBuilderStateV1 definition to reflect the new name (e.g., "Order Builder
State V1 metadata - contains user's specific configuration for a deployed order
referencing a dotrain template") so the comment matches the struct name and
purpose.

ℹ️ Review info

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a823381 and a712031.

📒 Files selected for processing (4)
  • crates/cli/src/meta/magic.rs
  • crates/cli/src/meta/mod.rs
  • crates/cli/src/meta/types/dotrain/mod.rs
  • crates/cli/src/meta/types/dotrain/order_builder_state_v1.rs

Comment thread crates/cli/src/meta/magic.rs Outdated
…rder-builder-state

# Conflicts:
#	crates/cli/src/meta/magic.rs
#	crates/cli/src/meta/mod.rs
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.

Caution

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

⚠️ Outside diff range comments (1)
crates/cli/src/meta/magic.rs (1)

179-185: 🧹 Nitpick | 🔵 Trivial

Test name is stale after the rename.

test_dotrain_instance_meta_v1 now tests KnownMagic::OrderBuilderStateV1. Consider renaming for consistency with the rest of the rename and with the other per-variant tests in this module.

📝 Proposed fix
-    #[test]
-    fn test_dotrain_instance_meta_v1() {
-        let magic_number = KnownMagic::OrderBuilderStateV1;
+    #[test]
+    fn test_order_builder_state_v1() {
+        let magic_number = KnownMagic::OrderBuilderStateV1;
         let magic_number_after_prefix = magic_number.to_prefix_bytes();
 
         assert_eq!(hex::encode(magic_number_after_prefix), "ffda7b2fb167c286");
     }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/cli/src/meta/magic.rs` around lines 179 - 185, The test function name
is stale—rename fn test_dotrain_instance_meta_v1() to reflect the variant being
asserted (e.g., fn test_known_magic_order_builder_state_v1() or fn
test_order_builder_state_v1_magic()) so it matches the checked value
KnownMagic::OrderBuilderStateV1 and the naming pattern of other per-variant
tests; update the test declaration and any references accordingly while leaving
the assertion body (hex::encode(magic_number_after_prefix) ==
"ffda7b2fb167c286") unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@crates/cli/src/meta/magic.rs`:
- Around line 179-185: The test function name is stale—rename fn
test_dotrain_instance_meta_v1() to reflect the variant being asserted (e.g., fn
test_known_magic_order_builder_state_v1() or fn
test_order_builder_state_v1_magic()) so it matches the checked value
KnownMagic::OrderBuilderStateV1 and the naming pattern of other per-variant
tests; update the test declaration and any references accordingly while leaving
the assertion body (hex::encode(magic_number_after_prefix) ==
"ffda7b2fb167c286") unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6c3cf35a-e9ce-4a45-bf60-44d4c34a0a6d

📥 Commits

Reviewing files that changed from the base of the PR and between a712031 and e056d2d.

📒 Files selected for processing (2)
  • crates/cli/src/meta/magic.rs
  • crates/cli/src/meta/mod.rs

@findolor findolor requested a review from hardyjosh April 17, 2026 06:58
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.

Caution

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

⚠️ Outside diff range comments (1)
crates/cli/src/meta/magic.rs (1)

179-185: 🧹 Nitpick | 🔵 Trivial

Stale test name: test_dotrain_instance_meta_v1 no longer reflects the variant under test.

Consider renaming to match the new variant for consistency with the other per-variant tests in this module.

✏️ Proposed rename
-    #[test]
-    fn test_dotrain_instance_meta_v1() {
+    #[test]
+    fn test_order_builder_state_v1() {
         let magic_number = KnownMagic::OrderBuilderStateV1;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/cli/src/meta/magic.rs` around lines 179 - 185, Rename the stale test
function test_dotrain_instance_meta_v1 to a name that reflects the variant under
test (e.g., test_order_builder_state_v1) to match the other per-variant tests;
update the test function identifier while keeping the body that references
KnownMagic::OrderBuilderStateV1 and its to_prefix_bytes() assertion unchanged so
the test still verifies hex::encode(magic_number_after_prefix) ==
"ffda7b2fb167c286".
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@crates/cli/src/meta/magic.rs`:
- Around line 179-185: Rename the stale test function
test_dotrain_instance_meta_v1 to a name that reflects the variant under test
(e.g., test_order_builder_state_v1) to match the other per-variant tests; update
the test function identifier while keeping the body that references
KnownMagic::OrderBuilderStateV1 and its to_prefix_bytes() assertion unchanged so
the test still verifies hex::encode(magic_number_after_prefix) ==
"ffda7b2fb167c286".

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0359ffc9-6427-4479-9702-9bdd9bfb4c86

📥 Commits

Reviewing files that changed from the base of the PR and between e056d2d and 14d8dcc.

📒 Files selected for processing (2)
  • crates/cli/src/meta/magic.rs
  • test/lib/deploy/LibMetaBoardDeploy.t.sol

findolor and others added 2 commits April 17, 2026 14:40
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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