Skip to content

feat: multi-signer mempool, block packaging and RPC for generalized transactions - #165

Open
SIDDHANTCOOKIE wants to merge 1 commit into
feature/generalized-tx-statefrom
feature/generalized-tx-mempool-rpc
Open

SIDDHANTCOOKIE wants to merge 1 commit into
feature/generalized-tx-statefrom
feature/generalized-tx-mempool-rpc

Conversation

@SIDDHANTCOOKIE

Copy link
Copy Markdown
Member

Summary

PR 3 of the generalized transaction roadmap (stacked on #164). Makes the mempool, block builder and RPC work with multi-party transactions.

Changes

  1. Mempool (minichain/mempool.py)
    • Each transaction occupies every (signer, nonce) slot in tx.nonces.
    • Nonce ordering is enforced across all signers. If the constraints contradict each other, the transaction is rejected and the pool is left unchanged.
    • Replace-by-fee works across all conflicting transactions: the replacement needs a newer timestamp and a fee more than 10% above every transaction it displaces.
    • remove_transactions() purges every pending transaction that shares a spent (signer, nonce) slot with a mined one.
  2. Block builder (main.py)
    • Drops the single-sender nonce pre-check. validate_and_apply already rejects stale nonces for every signer.
  3. RPC (minichain/rpc.py)
    • mc_sendTransaction returns clear errors for malformed payloads and for transactions missing a required signature.
    • New mc_getNonce(address) returns the account nonce without creating the account.

Not in this PR

CLI co-signing, passing partially signed transactions between co-signers, and README/example docs. These come in the next PR.

Test Plan

  • Added tests/test_generalized_mempool.py (10 tests): partial signatures, conflicts on any signer, outbidding every conflict, cross-signer ordering, contradictory ordering, purge after mining, mining a two-party swap into a block, and the RPC cases.
  • Full test suite: 412 passed.

…alized txs

Mempool tracks every (signer, nonce) slot for ordering, replace-by-fee and
purging after a block. The block builder no longer assumes a single sender,
mc_sendTransaction reports malformed or partially signed payloads, and
mc_getNonce is added.
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review: 2
  • main
  • develop

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: StabilityNexus/MiniChain/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 84927df1-12fe-4f7a-a6a2-035ad5fab0b2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

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