Skip to content

refactor(rfq): share bounded Elements Core client - #46

Open
tvolk131 wants to merge 1 commit into
codex/rfq-taker-async-sourcefrom
codex/rfq-elements-core-client
Open

refactor(rfq): share bounded Elements Core client#46
tvolk131 wants to merge 1 commit into
codex/rfq-taker-async-sourcefrom
codex/rfq-elements-core-client

Conversation

@tvolk131

@tvolk131 tvolk131 commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • extract the provider's Elements Core RPC implementation into a wallet-neutral deadcat-elements-core crate for reuse by provider and taker runtimes
  • bind every client to an exact ChainIdentity, with operation-wide deadlines, bounded RPC/materialization limits, serialized UTXO scans, stable-tip anchors, and full confidential TxOut witnesses
  • retain exact relay/reconciliation behavior while reducing deadcat-rfq::elements to provider wallet catalog, recovery, and domain-mapping responsibilities
  • update daemon preflight/source construction and live regtest coverage for the exact chain binding

Correctness hardening

  • reject a tip advance after scan result materialization
  • block stale-branch same-txid witness substitution by qualifying confirmed transaction lookups with the canonical creation block
  • bind unconfirmed prevouts to the mempool wtxid
  • materialize one creating transaction at a time and enforce a 64 MiB aggregate retained-output bound
  • preserve policy rejection classification and redact exact transaction bytes and credentials

Validation

  • cargo test --workspace
  • cargo test -p deadcat-elements-core (30 tests)
  • cargo test -p deadcat-rfq --lib elements::tests (9 tests)
  • cargo check -p deadcat-rfq --all-targets
  • cargo clippy -p deadcat-elements-core --all-targets -- -D warnings
  • cargo fmt --all -- --check
  • git diff --check

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-29T16:14:41.034031Z 2905de3 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2905de3823

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +2430 to +2433
std::collections::btree_map::Entry::Occupied(entry) => {
if entry.get().0 != observed.confirmations {
return Err(ElementsCoreError::InvalidPrevoutConfirmations {
outpoint: *outpoint,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Revalidate cached unconfirmed transaction witnesses

When outpoints contains multiple outputs from the same unconfirmed transaction and the mempool swaps that transaction for same-txid/different-wtxid bytes between lookups, this occupied branch checks only that confirmations remain zero and then reuses the first transaction. Because Elements output proofs are witness data excluded from the txid, the later prevout can therefore be returned with a stale TxOut witness despite gettxout observing the replacement; recheck the mempool wtxid before reusing a cached unconfirmed transaction.

Useful? React with 👍 / 👎.

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.

1 participant