Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for spark names RPC #1528

Closed
wants to merge 33 commits into from
Closed

Fix for spark names RPC #1528

wants to merge 33 commits into from

Conversation

levoncrypto
Copy link
Contributor

No description provided.

psolstice and others added 30 commits September 29, 2024 13:12
Copy link

coderabbitai bot commented Feb 15, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The changes integrate comprehensive support for Spark Names across the codebase. Updates include new UI forms for entering Spark Names, backend modifications in the wallet, chain, and consensus parameters, as well as additions to libspark for ownership proofs and signing. Several RPC endpoints and test cases have been added. Build configurations and mempool/validation logic are updated accordingly, and error handling improvements have been implemented. These modifications collectively enable Spark Name registration and management within the system.

Changes

File(s) Change Summary
contrib/bitcoin-qt.pro, src/Makefile.am, src/Makefile.qt.include, src/Makefile.test.include Updated build/configuration files to add new UI form (createsparkname.ui), new header/source files for Spark names, and a new test (ownership_test.cpp).
src/chain.h, src/chainparams.cpp, src/consensus/params.h Added new member variables (e.g., addedSparkNames, removedSparkNames), consensus parameters (nSparkNamesStartBlock, nSparkNamesFee), and fee arrays for Spark names.
src/libspark/keys.cpp, src/libspark/keys.h, src/libspark/ownership_proof.h, src/libspark/util.h, src/libspark/test/ownership_test.cpp Introduced ownership proof methods (challenge, prove_own, verify_own), new OwnershipProof class, transcript constant (LABEL_TRANSCRIPT_OWNERSHIP), and accompanying test suite.
src/primitives/transaction.h, src/rpc/blockchain.cpp, src/rpc/client.cpp Added a new transaction type (TRANSACTION_ALIAS), new RPC methods (getsparknames, getsparknamedata), and updated RPC parameter conversion for registersparkname.
src/qt/addressbookpage.h, src/qt/createsparknamepage.cpp, src/qt/createsparknamepage.h, src/qt/forms/createsparkname.ui, src/qt/walletmodel.cpp, src/qt/walletmodel.h Added a new dialog interface (CreateSparkNamePage) for Spark Name creation, including UI layout and associated MOC/header files, plus a prepareSparkNameTransaction method in WalletModel, and a new style pointer in AddressBookPage.
src/spark/sparkwallet.cpp, src/spark/sparkwallet.h, src/spark/state.cpp, src/spark/state.h, src/sparkname.cpp, src/sparkname.h Introduced Spark Wallet methods for creating Spark Name transactions and address ownership checks, and added a CSparkNameManager with functions for parsing, validating, adding, and removing Spark names.
src/wallet/rpcwallet.cpp, src/wallet/wallet.cpp, src/wallet/wallet.h Added a registersparkname RPC command and wallet methods (CreateSparkNameTransaction) to process Spark Name transactions.
src/txmempool.cpp, src/txmempool.h, src/validation.cpp Updated mempool removal and transaction validation logic to handle Spark Name transactions and check for duplicate/conflicting name entries.
src/secp256k1/src/cpp/Scalar.cpp Replaced string literal exceptions with std::runtime_error for improved error handling.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant UI as CreateSparkNamePage
    participant WM as WalletModel
    participant W as Wallet
    participant SNM as CSparkNameManager
    participant BC as Blockchain

    U ->> UI: Enter Spark Name details
    UI ->> WM: Call prepareSparkNameTransaction()
    WM ->> W: Invoke CreateSparkNameTransaction(...)
    W ->> SNM: Validate & process spark name data
    SNM ->> BC: Update blockchain state with Spark Name
    BC -->> SNM: Confirm state update
    SNM -->> W: Return transaction data
    W -->> WM: Transaction created
    WM -->> UI: Send transaction result
    UI -->> U: Display confirmation
Loading

Poem

I hopped into the code one day,
Spark names leaped into the fray.
New dialogs and proofs now shine,
With careful keys and checks in line.
In every line, a bright new spark—
A bunny’s joy in bytes so stark!
(_/), (•ㅅ•), and carrot :)!


📜 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 a32ec20 and d4ccf02.

📒 Files selected for processing (35)
  • contrib/bitcoin-qt.pro (1 hunks)
  • src/Makefile.am (3 hunks)
  • src/Makefile.qt.include (4 hunks)
  • src/Makefile.test.include (1 hunks)
  • src/chain.h (4 hunks)
  • src/chainparams.cpp (5 hunks)
  • src/consensus/params.h (1 hunks)
  • src/libspark/keys.cpp (2 hunks)
  • src/libspark/keys.h (2 hunks)
  • src/libspark/ownership_proof.h (1 hunks)
  • src/libspark/test/ownership_test.cpp (1 hunks)
  • src/libspark/util.h (1 hunks)
  • src/primitives/transaction.h (1 hunks)
  • src/qt/addressbookpage.h (1 hunks)
  • src/qt/createsparknamepage.cpp (1 hunks)
  • src/qt/createsparknamepage.h (1 hunks)
  • src/qt/forms/createsparkname.ui (1 hunks)
  • src/qt/walletmodel.cpp (1 hunks)
  • src/qt/walletmodel.h (1 hunks)
  • src/rpc/blockchain.cpp (3 hunks)
  • src/rpc/client.cpp (1 hunks)
  • src/secp256k1/src/cpp/Scalar.cpp (6 hunks)
  • src/spark/sparkwallet.cpp (3 hunks)
  • src/spark/sparkwallet.h (3 hunks)
  • src/spark/state.cpp (7 hunks)
  • src/spark/state.h (2 hunks)
  • src/sparkname.cpp (1 hunks)
  • src/sparkname.h (1 hunks)
  • src/txdb.cpp (1 hunks)
  • src/txmempool.cpp (1 hunks)
  • src/txmempool.h (1 hunks)
  • src/validation.cpp (4 hunks)
  • src/wallet/rpcwallet.cpp (2 hunks)
  • src/wallet/wallet.cpp (1 hunks)
  • src/wallet/wallet.h (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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.

3 participants