Skip to content

Extract document and wallet logic into vendored tinydocs + tinywallet - #5476

Merged
senamakel merged 29 commits into
tinyhumansai:mainfrom
senamakel:vendor-tinywallet-tinydocs
Aug 10, 2026
Merged

Extract document and wallet logic into vendored tinydocs + tinywallet#5476
senamakel merged 29 commits into
tinyhumansai:mainfrom
senamakel:vendor-tinywallet-tinydocs

Conversation

@senamakel

@senamakel senamakel commented Aug 10, 2026

Copy link
Copy Markdown
Member

Vendors tinydocs and tinywallet as vendor/ submodules and moves host-agnostic logic out of this repo into them.

Both crates are merged to their main, and the gitlinks here point at those merge commits — so this no longer depends on anything unmerged.

The rule this split follows

A crate owns what is the same for every host; the host owns what depends on its own runtime, config, or threat model.

Crate Took This repo kept
tinydocs .docx spec types, size limits, validation, OOXML synthesis artifact pipeline, spawn_blocking hop, generation deadline
tinywallet address formats, BIP-39/BIP-32/SLIP-0010 derivation, asset catalogs, transaction signing, chain queries keyring custody, endpoint resolution, failover, the quote store, agent tools

What is live in this PR

  • Document generation fully delegated to tinydocs. The agent-facing JSON tool schema is unchanged — GenerateDocumentInput is the crate's DocumentSpec re-exported under its historical name, pinned by the_json_wire_shape_is_unchanged_by_the_extraction.
  • All four chains' key derivation delegated to tinywallet::key, deleting ~110 lines of hand-rolled BIP-32 and SLIP-0010 from web3/wallet/chains/. coins_bip39 and MnemonicBuilder are gone from web3/wallet/ entirely.
  • The Transport adapter (web3/wallet/transport.rs) — the host side of tinywallet's network seam, so tinywallet::client and tinywallet::tx are consumable. Endpoint resolution, the OPENHUMAN_WALLET_RPC_<CHAIN> overrides, tiny.place Solana failover, URL redaction and the shared reqwest client all stay here and are reused unchanged.

143 web3 tests plus 26 document-tool tests pass; --no-default-features clean; the Feature Forwarding Gate passes.

Behaviour changes — three, all deliberate

  1. tron_address_to_hex is stricter. The old implementation decoded without a length check, so a malformed address that base58check-decoded to the wrong length produced a short hex string and failed later at the TronGrid call. It validates first now.
  2. Two BTC error messages reworded. tinywallet reports a wrong-network address as distinct from a malformed one ("not on mainnet"), and names the failing role for a non-P2WPKH sender. Agent-facing strings, not a wire contract; the two loose assertions that pinned the old wording are updated.
  3. A non-hardened Solana derivation path now has its own error. Such a path is underivable on ed25519 rather than merely unsupported — silently hardening it would return a different account than the path names.

Everything else is parity, verified rather than assumed: my first tinywallet EVM validator accepted an uppercase 0X prefix, and I probed the real ethers-core path before swapping rather than trusting the diagnosis. It rejects 0X, so the crate was tightened to match. Widening validation on a wallet path is the wrong direction to drift.

Reviewer note on the Transport adapter

tinywallet splits transport failures into retryable and authoritative because a host's failover depends on it — retrying an authoritative "insufficient funds" gets the same answer, while retrying an ambiguous failure risks a double broadcast. This repo's RPC helpers flatten both into String, so the adapter cannot recover the distinction perfectly and classifies conservatively: anything it cannot prove is a transport failure is reported as authoritative, so an unclassifiable error stops a failover rather than driving one. A missed retry costs a request; a wrong retry can cost a duplicate transaction.

Not in this PR

The signing and broadcast paths in web3/wallet/chains/ are still the live ones. tinywallet::tx and tinywallet::client are merged, tested and now reachable through the adapter, but no call site consumes them yet — repointing those is follow-up work, as is porting x402's payment-flow logic (its wire types are in review as tinywallet#4).

This PR is therefore a strict subset: the seams are in place and proven against real call sites for derivation, with nothing half-migrated.

Summary by CodeRabbit

  • New Features

    • Added reliable DOCX document generation with preserved input formats, validation, and structured error handling.
    • Improved wallet address validation and key derivation across Bitcoin, EVM, Solana, and Tron networks.
    • Added network-aware endpoint handling for wallet operations, including failover and secure error reporting.
    • Tron address conversion now validates addresses before producing output.
  • Bug Fixes

    • Improved rejection and reporting of invalid document inputs and wallet addresses.
  • Documentation

    • Added guidance covering document generation, wallet validation, setup requirements, and supported configurations.

senamakel and others added 15 commits August 10, 2026 13:26
Adds the tinydocs and tinywallet repositories as submodules under the vendor directory, registering them in .gitmodules so they can be pulled in alongside the existing tinybus dependency.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Introduce a new document types module under the tools implementation to support structured document handling, along with the tinydocs vendor dependency required for its functionality.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Integrate the tinydocs library as a vendored dependency and implement the document engine within the openhuman tools framework, enabling document processing capabilities for the tooling system.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Introduce the document types module in the openhuman tools implementation, providing the core type definitions needed for document handling. This change also includes the tinydocs vendor dependency to support the new functionality.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The document types module now checks for the presence of the tinydocs vendor directory before attempting to use it, preventing a panic when the directory is absent. This ensures graceful fallback behavior during development or incomplete setups.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Replace inline Bitcoin, Solana, and Tron address parsing with calls to the
vendored tinywallet crate, which now owns the address format rules. This
removes duplicated logic and keeps OpenHuman-specific code focused on the
Result<String, String> shape the domain expects. The Tron hex conversion
now validates before decoding, catching malformed addresses earlier.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Adds a test module that probes the `validate_evm_address` function with a variety of address formats, including mixed case, missing prefix, and invalid characters, to verify the validator's behaviour across edge cases.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add the tinywallet crate as an optional path dependency behind the default-on `web3` feature. This crate provides host-agnostic parsing, validation, and encoding conversions for Bitcoin, EVM, Solana, and Tron addresses, keeping those rules out of the OpenHuman-specific codebase.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add the tinywallet crate as a dependency under the web3 feature flag, enabling wallet functionality for web3 operations. The new dependency provides Bitcoin address generation and transaction handling capabilities through its bitcoin, bs58, hex, and thiserror dependencies.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Replaced the inline EVM address validation and the per-chain address dispatch in execution.rs with calls to the vendored tinywallet crate, which now owns the address format logic for all four supported chains. This removes the duplicated ethers-core dependency and keeps the chain-to-tinywallet mapping centralized in the validate_address function.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…nydocs,vendor/tinywallet

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…sign rules

Add a new section to AGENTS.md describing the two vendored crates (tinydocs and tinywallet) that now own logic previously in this repo, explaining the split criterion, each crate's responsibilities, and the design consequences that developers should know before touching either seam.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update the pinned commits for the tinydocs and tinywallet vendor submodules to their latest versions.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@senamakel
senamakel requested a review from a team August 10, 2026 11:28
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 605675ac-154f-401c-98f7-9088f9bdaffa

📥 Commits

Reviewing files that changed from the base of the PR and between c0adae0 and 4cb7cb5.

📒 Files selected for processing (9)
  • AGENTS.md
  • src/openhuman/tools/impl/document/types.rs
  • src/openhuman/web3/wallet/chains/btc.rs
  • src/openhuman/web3/wallet/chains/evm.rs
  • src/openhuman/web3/wallet/chains/solana.rs
  • src/openhuman/web3/wallet/chains/tron.rs
  • src/openhuman/web3/wallet/execution.rs
  • src/openhuman/web3/wallet/mod.rs
  • src/openhuman/web3/wallet/transport.rs
🚧 Files skipped from review as they are similar to previous changes (9)
  • src/openhuman/web3/wallet/mod.rs
  • src/openhuman/web3/wallet/execution.rs
  • AGENTS.md
  • src/openhuman/web3/wallet/transport.rs
  • src/openhuman/web3/wallet/chains/solana.rs
  • src/openhuman/web3/wallet/chains/btc.rs
  • src/openhuman/tools/impl/document/types.rs
  • src/openhuman/web3/wallet/chains/evm.rs
  • src/openhuman/web3/wallet/chains/tron.rs

📝 Walkthrough

Walkthrough

The project now vendors TinyDocs and TinyWallet. Document generation, validation, truncation, wallet address validation, and wallet key derivation use the vendored crates. OpenHuman also provides TinyWallet transport integration.

Changes

Vendored integrations

Layer / File(s) Summary
Dependency and submodule wiring
.gitmodules, vendor/tinydocs, vendor/tinywallet, Cargo.toml, AGENTS.md
Added vendored submodules, optional dependencies, feature gates, and integration documentation.
TinyDocs document pipeline
src/openhuman/tools/impl/document/types.rs, src/openhuman/tools/impl/document/engine.rs
Re-exported document types and limits from TinyDocs. Delegated validation, DOCX generation, truncation, and error conversion to TinyDocs. Updated tests.
TinyWallet wallet operations
src/openhuman/web3/wallet/chains/*.rs, src/openhuman/web3/wallet/execution.rs
Delegated address validation and key derivation for Bitcoin, EVM, Solana, and Tron to TinyWallet. Preserved existing result shapes.
OpenHuman transport adapter
src/openhuman/web3/wallet/mod.rs, src/openhuman/web3/wallet/transport.rs
Added network endpoint resolution, JSON-RPC and REST operations, URL joining, and transport error classification for TinyWallet.

Estimated code review effort: 4 (Complex) | ~45 minutes

Suggested labels: rust-core

Poem

A rabbit checks each crate,
TinyDocs shapes documents straight.
TinyWallet derives each key,
Transport routes requests carefully.
Vendored paths now integrate.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: moving document and wallet logic into the vendored tinydocs and tinywallet crates.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

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

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@AGENTS.md`:
- Around line 210-212: Verify the uppercase 0X behavior in tinywallet and the
prior ethers-core path using the referenced parsing symbols, then update the
contradictory AGENTS.md statement to describe the actual compatibility result.
Keep the documented behavior precise and do not change implementation code or
broaden prefix acceptance.

In `@src/openhuman/tools/impl/document/types.rs`:
- Around line 123-124: Update validate_input to emit stable [document:types]
diagnostics for validation entry and completion/failure, including bounded
metadata such as title_chars, section_count, and error kind. Do not log document
text, author values, or error details; preserve the existing DocumentError
conversion and validation behavior.

In `@src/openhuman/web3/wallet/execution.rs`:
- Around line 345-352: Add stable non-sensitive [domain]-prefixed diagnostics to
the TinyWallet validation flows: in
src/openhuman/web3/wallet/execution.rs:345-352 log chain dispatch and
accepted/rejected validation results, propagating any available request or quote
correlation field; in src/openhuman/web3/wallet/chains/btc.rs:74-86 log
recipient/sender role and result; in
src/openhuman/web3/wallet/chains/evm.rs:344-345 and
src/openhuman/web3/wallet/chains/solana.rs:69-70 log validation results; and in
src/openhuman/web3/wallet/chains/tron.rs:37-50 log validation and conversion
results. Use the relevant visible validation functions and existing logging
conventions, and never include addr or untrusted error text.
🪄 Autofix

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

Plan: Pro Plus

Run ID: 7410ae06-ddda-4c68-984a-37bf5ee785db

📥 Commits

Reviewing files that changed from the base of the PR and between c7e15ba and beb3e0a.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (12)
  • .gitmodules
  • AGENTS.md
  • Cargo.toml
  • src/openhuman/tools/impl/document/engine.rs
  • src/openhuman/tools/impl/document/types.rs
  • src/openhuman/web3/wallet/chains/btc.rs
  • src/openhuman/web3/wallet/chains/evm.rs
  • src/openhuman/web3/wallet/chains/solana.rs
  • src/openhuman/web3/wallet/chains/tron.rs
  • src/openhuman/web3/wallet/execution.rs
  • vendor/tinydocs
  • vendor/tinywallet

Comment thread AGENTS.md Outdated
Comment thread src/openhuman/tools/impl/document/types.rs Outdated
Comment thread src/openhuman/web3/wallet/execution.rs Outdated

@tinysweeper tinysweeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

tinysweeper found nothing blocking. Approving.

             $0.0103 · 131,280 in / 32,356 out · 104,538 cached (80%) · z-ai/glm-5.2
critique:    $0.0044 · 46,576 in  / 14,946 out · 37,696 cached (81%)  · z-ai/glm-5.2
security:    $0.0029 · 32,482 in  / 10,010 out · 26,807 cached (83%)  · z-ai/glm-5.2
tests:       $0.0016 · 17,191 in  / 5,247 out  · 12,444 cached (72%)  · z-ai/glm-5.2
description: $0.0008 · 18,179 in  / 1,455 out  · 14,510 cached (80%)  · z-ai/glm-5.2

Comment thread src/openhuman/web3/wallet/chains/evm.rs Outdated
Comment thread src/openhuman/web3/wallet/execution.rs Outdated
Comment thread src/openhuman/tools/impl/document/types.rs
Comment thread src/openhuman/web3/wallet/chains/btc.rs Outdated
Comment thread src/openhuman/web3/wallet/chains/evm.rs
Comment thread src/openhuman/web3/wallet/chains/tron.rs
@tinysweeper

tinysweeper Bot commented Aug 10, 2026

Copy link
Copy Markdown

What this change touches

10 files, +342 -588 across 4 components. The code graph knows nothing about these files yet — normal for newly added files, and a cold index otherwise.

flowchart LR
  n0["src/openhuman/tools/impl/document<br/>2 files +194 -503<br/>1 finding"]:::flagged
  n1["src/openhuman/web3/wallet/chains<br/>4 files +50 -61<br/>4 findings"]:::flagged
  n2["root<br/>3 files +78 -8"]:::changed
  n3["src/openhuman/web3/wallet<br/>1 file +20 -16<br/>1 finding"]:::flagged
  classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
  classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
  classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
  classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Loading

Green: changed. Grey: untouched, reached through an import or a call. Orange: has findings. Red: has a finding that blocks the merge.

Component Files Lines Findings
src/openhuman/tools/impl/document changed 2 +194 -503 1 (medium)
src/openhuman/web3/wallet/chains changed 4 +50 -61 4 (medium)
(root) changed 3 +78 -8
src/openhuman/web3/wallet changed 1 +20 -16 1 (medium)
Changed files

src/openhuman/tools/impl/document

  • src/openhuman/tools/impl/document/engine.rs
  • src/openhuman/tools/impl/document/types.rs

src/openhuman/web3/wallet/chains

  • src/openhuman/web3/wallet/chains/btc.rs
  • src/openhuman/web3/wallet/chains/evm.rs
  • src/openhuman/web3/wallet/chains/solana.rs
  • src/openhuman/web3/wallet/chains/tron.rs

(root)

  • .gitmodules
  • AGENTS.md
  • Cargo.toml

src/openhuman/web3/wallet

  • src/openhuman/web3/wallet/execution.rs

tinysweeper 0.1.0

@tinysweeper tinysweeper Bot added the priority: p2 Soon. Real but survivable — a rough edge, a gap, a thing that will bite later. label Aug 10, 2026
senamakel and others added 9 commits August 10, 2026 16:05
Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Updated the tinywallet submodule to a new commit and added several new dependencies to Cargo.lock, including coins-bip39, ed25519-dalek, hmac, sha2, sha3, and zeroize. Removed unused imports for hmac and Sha512 from the solana module to clean up the code.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…llet

Update the pinned commits for the tinydocs and tinywallet vendor submodules to incorporate upstream changes.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…et crate

Replace the duplicated BIP-32 key derivation logic in both the BTC and Tron wallet modules with calls to the vendored tinywallet crate, which now owns the secp256k1 derivation and address construction. This removes over 100 lines of hand-rolled HMAC-SHA512 walking, path parsing, and Keccak address computation, centralizing the logic in a single tested implementation while keeping mnemonic custody in this crate.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Remove unused imports from the Bitcoin and Tron chain modules to eliminate compiler warnings and clean up the codebase.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a check to return an error when no wallet transport is configured, preventing a panic or undefined behavior when the transport is accessed but not set. This improves robustness by ensuring a clear failure mode instead of relying on the caller to verify the transport state.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
senamakel and others added 2 commits August 10, 2026 17:05
The tinywallet dependency in Cargo.toml now includes the "net", "asset", "client", and "tx" features, and the corresponding async-trait, serde, and serde_json dependencies have been added to Cargo.lock to support these new capabilities.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
A new `transport` module is introduced to host the endpoint resolution, failover, and redaction logic that belongs on the config side of tinywallet's `Transport` seam, keeping these concerns separate from the RPC layer.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@senamakel senamakel changed the title Extract document and wallet-address logic into vendored tinydocs + tinywallet crates Extract document and wallet logic into vendored tinydocs + tinywallet Aug 10, 2026
@coderabbitai coderabbitai Bot added the rust-core Core Rust runtime in src/: CLI, core_server, shared infrastructure. label Aug 10, 2026

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

Caution

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

⚠️ Outside diff range comments (1)
src/openhuman/web3/wallet/chains/btc.rs (1)

452-457: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Tighten the wrong-network assertion.

The assertion accepts "not on mainnet" or "invalid". Any generic parse failure now satisfies the test. The test no longer proves that tinywallet reports the wrong-network condition distinctly. Assert the wrong-network wording only.

💚 Proposed test tightening
-        // `tinywallet` reports a wrong-network address as a distinct condition
-        // from a malformed one, so the message names the required network.
-        assert!(
-            err.contains("not on mainnet") || err.contains("invalid"),
-            "got: {err}"
-        );
+        // `tinywallet` reports a wrong-network address as a distinct condition
+        // from a malformed one, so the message names the required network.
+        assert!(err.contains("not on mainnet"), "got: {err}");
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/openhuman/web3/wallet/chains/btc.rs` around lines 452 - 457, Update the
assertion in the wrong-network wallet test to require only the specific “not on
mainnet” wording, removing the generic “invalid” alternative while preserving
the existing error output in the failure message.
🧹 Nitpick comments (1)
src/openhuman/web3/wallet/transport.rs (1)

107-138: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add structured logging to the new transport flow.

The three Transport methods perform external calls and classify errors. Neither method logs anything. The classification branch at Lines 98-105 decides whether a caller retries, and no log records that decision. A production failover problem leaves no trace.

Add debug! entries with a stable, grep-friendly prefix for the resolved network, the method or path, and the classification outcome. Log the redacted endpoint only.

As per coding guidelines: "New or changed flows should log entry/exit, branches, external calls, retries/timeouts, state transitions, and errors using stable, grep-friendly prefixes."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/openhuman/web3/wallet/transport.rs` around lines 107 - 138, Update the
Transport implementation methods json_rpc, rest_get, and rest_post to add debug!
logs around each external call, using stable grep-friendly prefixes that include
the resolved network, method or path, and classification outcome. Log only
redacted endpoint information, and include the classify decision so
retry/failover behavior is observable without exposing sensitive data.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/openhuman/web3/wallet/mod.rs`:
- Around line 37-40: Gate the wallet transport submodule declaration in `wallet`
with `#[cfg(feature = "web3")]` so `transport` is compiled only when the `web3`
feature is enabled. Leave the stub facade and its existing signature unchanged
for feature-disabled builds.

In `@src/openhuman/web3/wallet/transport.rs`:
- Around line 61-63: Update the EVM branch in resolve so a missing
network.evm_chain_id returns an error, matching the existing unknown-chain
handling instead of falling back to rpc_url_for_chain(WalletChain::Evm). Add a
test covering NetworkId::chain(tinywallet::Chain::Evm) and assert that resolve
returns an error.

In `@vendor/tinywallet`:
- Line 1: Update the vendored tinywallet submodule reference to a
repository-reachable commit containing the tinywallet#1 merge target, or publish
the currently referenced commit to a configured remote before release; preserve
the existing Cargo.toml path dependency and web3 features.

---

Outside diff comments:
In `@src/openhuman/web3/wallet/chains/btc.rs`:
- Around line 452-457: Update the assertion in the wrong-network wallet test to
require only the specific “not on mainnet” wording, removing the generic
“invalid” alternative while preserving the existing error output in the failure
message.

---

Nitpick comments:
In `@src/openhuman/web3/wallet/transport.rs`:
- Around line 107-138: Update the Transport implementation methods json_rpc,
rest_get, and rest_post to add debug! logs around each external call, using
stable grep-friendly prefixes that include the resolved network, method or path,
and classification outcome. Log only redacted endpoint information, and include
the classify decision so retry/failover behavior is observable without exposing
sensitive data.
🪄 Autofix

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

Plan: Pro Plus

Run ID: bf38d14d-e2b6-425a-b828-0f621f91fc75

📥 Commits

Reviewing files that changed from the base of the PR and between beb3e0a and c0adae0.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (9)
  • Cargo.toml
  • src/openhuman/web3/wallet/chains/btc.rs
  • src/openhuman/web3/wallet/chains/evm.rs
  • src/openhuman/web3/wallet/chains/solana.rs
  • src/openhuman/web3/wallet/chains/tron.rs
  • src/openhuman/web3/wallet/mod.rs
  • src/openhuman/web3/wallet/transport.rs
  • vendor/tinydocs
  • vendor/tinywallet
🚧 Files skipped from review as they are similar to previous changes (2)
  • Cargo.toml
  • vendor/tinydocs

Comment thread src/openhuman/web3/wallet/mod.rs Outdated
Comment thread src/openhuman/web3/wallet/transport.rs Outdated
Comment thread vendor/tinywallet
@senamakel senamakel self-assigned this Aug 10, 2026
…ld code path

The documentation for tinywallet's EVM prefix handling now explicitly states that the old code path through `ethers_core` also rejected an uppercase `0X` prefix, citing the specific `fixed-hash` implementation that strips only a lowercase `0x`. This makes it clear the behaviour is unchanged from the previous implementation and should not be relaxed.

Auto-committed-on: dragonfly
Added debug logging across all chain-specific address validators, the dispatch function in execution.rs, and the transport layer's RPC calls. The logs capture the validation outcome and, for the transport, the endpoint URL (redacted) and whether an error is retryable. This makes it possible to trace address rejection and RPC failures in production without changing the public API. Also fixed a test assertion in btc.rs that was too broad, added a test for Tron address length rejection, and gated the transport module behind the `web3` feature flag.

Auto-committed-on: dragonfly
Reformatted multi-line debug macro invocations across the wallet transport layer and chain-specific address validation functions to use explicit line breaks and indentation, improving code readability without changing any runtime behavior. Also reordered a module declaration in `mod.rs` to keep the doc comment adjacent to its item.

Auto-committed-on: dragonfly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p2 Soon. Real but survivable — a rough edge, a gap, a thing that will bite later. rust-core Core Rust runtime in src/: CLI, core_server, shared infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant