-
Notifications
You must be signed in to change notification settings - Fork 2.2k
lntest: add bitcoind miner backend #10481
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
base: master
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @bhandras, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a bitcoind-backed miner implementation for lntest, which is a significant and well-executed enhancement. It allows for more realistic integration testing of Bitcoin Core-specific behaviors. The new miner abstraction is clean, and the refactoring of existing code to use it is thorough. My review includes one suggestion to improve maintainability by reducing code duplication in one of the modified files.
524274d to
0872272
Compare
2a17ef9 to
a8a24ed
Compare
Introduce a miner backend interface and implement both btcd and bitcoind-backed miners for lntest. This lets the harness drive mining and mempool assertions using bitcoind in addition to btcd. Also update harness helpers to avoid btcd-only assumptions (network params, raw tx submission, funding shim output index lookup) and make bitcoind miner disconnects more reliable.
Add an itest flag to choose the miner backend (btcd vs bitcoind) and provide a build-tag default so that `-tags=bitcoind` naturally uses a bitcoind miner. Wire the flag through `make testing_flags.mk` so callers can set `minerbackend=bitcoind` independently of the chain backend.
Add a basic itest matrix entry that sets minerbackend=bitcoind alongside backend=bitcoind, ensuring CI covers the bitcoind miner path.
a8a24ed to
d2b5d3c
Compare
Summary
This PR extends
lntestwith abitcoind-backed miner implementation. Until now,lntestassumed abtcdminer (rpctest harness) even when the chain backend wasbitcoind, which made it hard to exercise Bitcoin Core-specificmining and mempool behavior.
A key motivation for this work is enabling
lntestto support mining and validating v3 packages (and other Core policy/package-relay behaviors) in integration tests. Those workflows are most realistically exercised with Bitcoin Core as the miner.What’s included
lntest/minerwith two concrete backends:btcdbackend (wrapping existingrpctest.Harnessusage)bitcoindbackend (spawns a localbitcoindon regtest and implements the miner APIs needed bylntest)-minerbackenditest flag so the miner backend can be selected independently from the chain backend.backend=bitcoindandminerbackend=bitcoindto ensure we exercise the new path.Why this matters for v3 packages
Package relay / v3 transaction workflows are fundamentally Bitcoin Core policy and mining driven. Having
lntestable to:is a prerequisite for writing reliable integration coverage around v3 package construction, acceptance, and mining behavior.
How to run
Locally:
make itest backend=bitcoind minerbackend=bitcoindCI will run an additional job (matrix entry) with the same arguments.
Notes
make lintpasses.