Conversation
…up raw mempool error handling
…port; refactor transaction fetching logic
priyashuu
requested review from
Sansh2356,
mcelrath and
zaidmstrr
as code owners
August 20, 2026 23:09
There was a problem hiding this comment.
Pull request overview
This PR expands the node’s JSON-RPC surface to support transaction/mempool status queries (consumed by the dashboard), introduces a reverse index for committed txids in the braid, and wires in tower/tower-http to add HTTP middleware (CORS) support.
Changes:
- Add new JSON-RPC methods for transaction status, mempool entries, and paginated committed txids; update the CLI and dashboard to consume them.
- Add
txid_to_beadreverse index toBraidand thread it through constructors/tests. - Add tower + tower-http and enable permissive CORS middleware for the RPC server.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| node/src/utils/test_utils.rs | Update test braid construction for new txid_to_bead field. |
| node/src/rpc_server.rs | Add new RPC methods, whitelist bitcoinproxy methods, and add tower-http CORS middleware. |
| node/src/db/schema.sql | Add an index on Transactions(txid) for faster lookups. |
| node/src/braid/tests.rs | Update braid struct literals for new txid_to_bead field. |
| node/src/braid/mod.rs | Add/maintain txid_to_bead reverse index during braid creation/extension/reset. |
| node/Cargo.toml | Add tower + tower-http to the node crate dependencies. |
| dashboard/src/URLs.ts | Replace old mempool URL helpers with node JSON-RPC endpoint helper. |
| dashboard/src/components/BitcoinStats/Utils.ts | Refactor tx fetching/status logic to call node JSON-RPC instead of external mempool APIs. |
| dashboard/src/components/BitcoinStats/Types.ts | Make replaces optional for RBF transaction rows. |
| dashboard/src/components/BitcoinStats/TransactionTable.tsx | Add stage badge, filter, and manual txid lookup UI. |
| dashboard/src/components/BitcoinStats/TransactionDialog.tsx | Improve “not found”/N/A states and display stage + bead hash. |
| dashboard/src/components/BitcoinStats/RBFTransactionTable.tsx | Minor UI text spacing adjustment. |
| dashboard/src/components/BitcoinStats/RBFTransactionRow.tsx | Make replacements rendering null-safe with optional chaining. |
| dashboard/src/components/BitcoinStats/Prices.tsx | Handle RPC failures without crashing the UI loop. |
| Cargo.toml | Add workspace deps for tower + tower-http (cors feature). |
| braidpool-cli/src/main.rs | Add CLI commands for new JSON-RPC endpoints. |
Suppressed comments (3)
node/src/rpc_server.rs:1131
- Same use-after-move issue as above:
serde_json::json!([txid, true])movestxid, buttxidis used afterwards. Usetxid.clone()(or a separatetxid_str) for the JSON-RPC params.
match call_bitcoin_rpc_direct(
rpc_config,
"gettransaction",
&serde_json::json!([txid, true]),
)
node/src/rpc_server.rs:1193
limitis currently unbounded. Even though the mempool fetch is always full-size, returning an unbounded number of entries can create very large responses and increased CPU/memory pressure (easy DoS vector on an unauthenticated RPC). Consider clampinglimitto a reasonable maximum.
async fn get_mempool_entries(&self, limit: u32) -> Result<Value, ErrorObjectOwned> {
info!(limit = %limit, "get_mempool_entries request received");
node/src/rpc_server.rs:1266
page_sizeis currently unbounded. A very largepage_sizecan force the server to allocate and serialize an extremely large response (unauthenticated DoS risk). Consider clampingpage_sizeto a reasonable maximum.
info!(page = %page, page_size = %page_size, "get_committed_transactions request received");
let page_size_usize = page_size as usize;
let start = (page as usize).saturating_mul(page_size_usize);
let end = start.saturating_add(page_size_usize);
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
… POST requests and improve error handling
priyashuu
force-pushed
the
rpcs
branch
2 times, most recently
from
September 7, 2026 17:14
42e961e to
e2369b4
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Overview
This PR extends the Braidpool node's JSON-RPC interface to expose transaction and mempool information needed by the dashboard. It also partially removes the dashboard's dependency on external mempool APIs by connecting it to the node's RPC endpoints.
Changes
towerandtower-httpwith CORS support to the RPC server.Overall, this connects the dashboard more closely with the Braidpool node and reduces its reliance on external mempool APIs for transaction monitoring.
This PR is dependent on PR #515.