Skip to content

fix!: change hrp prefix on ootle address to otl_ - #1634

Merged
sdbondi merged 3 commits into
tari-project:developmentfrom
sdbondi:change_address_hrp_to_otl
Nov 7, 2025
Merged

fix!: change hrp prefix on ootle address to otl_#1634
sdbondi merged 3 commits into
tari-project:developmentfrom
sdbondi:change_address_hrp_to_otl

Conversation

@sdbondi

@sdbondi sdbondi commented Nov 6, 2025

Copy link
Copy Markdown
Member

Description

fix!: change hrp prefix on ootle address to otl_
adds hard limit on log string, and panic message size limit

Motivation and Context

Previously, it was xtr_, which could be confused with the XTR currency.

How Has This Been Tested?

Manually

What process can a PR reviewer use to test or verify this change?

Breaking Changes

  • None
  • Requires data directory to be deleted
  • Other - Please specify

Summary by CodeRabbit

  • New Features

    • Enforced maximum sizes for log and panic messages, with truncation/validation and related error handling.
  • Changes

    • Network address prefix updated from "xtr_" to "otl_"; UI address examples updated.
    • Removed automatic fee recalculation when changing the transfer target.
    • Strengthened instruction types and added an explicit invalid-instruction error variant.
  • Chores

    • Package version bumped to 1.21.0

@coderabbitai

coderabbitai Bot commented Nov 6, 2025

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

Walkthrough

Migrates HRP/address prefixes from xtr_ to otl_, tightens several Instruction and InstructionArg types (e.g., RistrettoPublicKeyBytes, Hash, ValidatorFeePoolAddress, WorkspaceOffsetId), adds MaxString-based limits for EmitLog/panic messages with conversion/error paths, and adds an InvalidInstruction manifest error.

Changes

Cohort / File(s) Summary
Address HRP & UI examples
bindings/src/helpers/ootleAddress.ts, crates/ootle_address/src/hrp.rs, applications/tari_walletd/web_ui/src/routes/AssetVault/NFTs/steps/FormStep.tsx, bindings/test/ootleAddress.test.ts
Replaced xtr_* HRP/address literals with otl_*; updated UI helper text and test address accordingly.
Wallet UI minor change
applications/tari_walletd/web_ui/src/routes/AssetVault/NFTs/components/SendNft.tsx
Removed automatic fee estimation effect on target-account change; switched import type to regular import.
Bindings package bump
bindings/package.json
Package version updated from 1.20.1 → 1.21.0.
Instruction type refinements (bindings)
bindings/src/types/Instruction.ts
Changed typed fields to concrete types (e.g., owner_public_keyRistrettoPublicKeyBytes, CallFunction.addressHash, ClaimValidatorFees.addressValidatorFeePoolAddress) and adjusted imports.
InstructionArg/Workspace type
bindings/src/types/InstructionArg.ts, crates/transaction/src/args.rs
Replaced Workspace numeric/TS-hint with WorkspaceOffsetId type; removed TS annotation in Rust variant.
EmitLog / MaxString integration
crates/transaction/src/v1/instruction.rs, crates/transaction_manifest/src/generator.rs, crates/engine/src/transaction/processor.rs, crates/p2p/src/conversions/transaction.rs
EmitLog.message changed from StringMaxString<...>; conversions now use try_into()/into_string() with explicit error mapping when messages exceed allowed size; processor/p2p conversions updated accordingly.
MaxString implementation & serde/borsh hooks
crates/template_lib_types/src/max_string.rs
Added TryFrom<String> for MaxString<N>, new MaxStringError<N> with Display, and conditional Borsh (de)serialization that enforces max length.
Engine limits & panic handling
crates/engine_types/src/limits.rs, crates/engine/src/wasm/process.rs
Added max_panic_message_size (32 KiB) to EngineLimits; WasmProcess caps/truncates oversized panic messages, logs the truncation, and returns an explicit error for oversized panic messages.
Manifest error surface
crates/transaction_manifest/src/error.rs
Added InvalidInstruction { reason: String } variant; generator maps oversized log conversions to this error.

Sequence Diagram(s)

sequenceDiagram
    participant Gen as Manifest Generator
    participant Conv as try_into / MaxString
    participant Err as ManifestError
    participant Engine as Engine / P2P / Processor

    Gen->>Conv: log.message.try_into()
    alt within limit
        Conv-->>Gen: Ok(MaxString)
        Gen->>Engine: emit log (uses MaxString)
        Engine-->>Gen: success
    else exceeds limit
        Conv-->>Err: Err (conversion fails)
        Err-->>Gen: InvalidInstruction { reason }
        Gen->>Gen: propagate error
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Focus areas:
    • Consistency of MaxString conversions across instruction, manifest generator, p2p conversions, and processor.
    • Wasm panic truncation logic and integration of max_panic_message_size.
    • Propagation and compatibility of new concrete types (RistrettoPublicKeyBytes, Hash, ValidatorFeePoolAddress, WorkspaceOffsetId) through bindings and upstream/downstream code.
    • Complete replacement of xtr_otl_ to avoid missed literals.

Possibly related PRs

Poem

🐰 I hopped from xtr to otl with cheer,
Tightened logs so they sit crystal clear,
Types grew sharper, limits stood tall,
Panic messages capped to avoid a sprawl,
A rabbit applauds — small changes, big haul. ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 13.33% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: updating HRP prefixes from xtr_ to otl_ for Ootle addresses, which is the primary focus across multiple files.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0a54394 and d8c0375.

📒 Files selected for processing (1)
  • crates/engine/src/wasm/process.rs (1 hunks)

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.

@sdbondi
sdbondi force-pushed the change_address_hrp_to_otl branch from 6039faf to 7b0d834 Compare November 6, 2025 11:37

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7b0d834 and 0a54394.

📒 Files selected for processing (2)
  • crates/engine/src/wasm/process.rs (1 hunks)
  • crates/engine_types/src/limits.rs (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: test
  • GitHub Check: clippy
  • GitHub Check: machete
  • GitHub Check: check nightly
  • GitHub Check: fmt
  • GitHub Check: check stable

Comment thread crates/engine/src/wasm/process.rs
@github-actions

github-actions Bot commented Nov 6, 2025

Copy link
Copy Markdown

Test Results (CI)

496 tests   484 ✅  1h 34m 33s ⏱️
 80 suites    0 💤
  2 files     12 ❌

For more details on these failures, see this check.

Results for commit 0a54394.

@sdbondi
sdbondi merged commit f125b4c into tari-project:development Nov 7, 2025
10 of 11 checks passed
@sdbondi
sdbondi deleted the change_address_hrp_to_otl branch November 7, 2025 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants