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

GitHub: use bitcoind v26.0 for CI #8273

Merged
merged 13 commits into from
Mar 20, 2024
Merged

Conversation

guggero
Copy link
Collaborator

@guggero guggero commented Dec 12, 2023

Depends on #8555.

Change Description

See if things break in the CI if we update to bitcoind v26.0.

@guggero guggero force-pushed the bitcoind-26 branch 3 times, most recently from 586e50c to 1c70744 Compare December 18, 2023 17:20
@guggero
Copy link
Collaborator Author

guggero commented Dec 18, 2023

Okay, so the failed unit tests were due to a number of reasons:

I added a couple of commits to address these issues.

@guggero guggero marked this pull request as ready for review December 18, 2023 17:42
Copy link
Collaborator

@yyforyongyu yyforyongyu left a comment

Choose a reason for hiding this comment

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

Thanks for the cleanup! No major comments, just need to merge the dependent PR first. And the unit tests need to be fixed.

scripts/install_bitcoind.sh Show resolved Hide resolved
chainntnfs/test_utils.go Outdated Show resolved Hide resolved
lnwallet/test/test_interface.go Outdated Show resolved Hide resolved
Copy link
Member

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

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

LGTM 🎨

go.mod Outdated Show resolved Hide resolved
chainntnfs/test_utils.go Show resolved Hide resolved
lnwallet/test/test_interface.go Outdated Show resolved Hide resolved
@guggero guggero force-pushed the bitcoind-26 branch 3 times, most recently from 488202b to 57aca62 Compare December 21, 2023 08:48
@yyforyongyu
Copy link
Collaborator

Unit tests still failing. One of the itest failures has uncleaned shutdown that still occupying a port, werid

 unable to create server: listen tcp 127.0.0.1:6563: bind: address already in use 

@guggero
Copy link
Collaborator Author

guggero commented Dec 22, 2023

Yeah, it seems like I have to do some more digging into failures.

@@ -2,9 +2,9 @@

set -ev

BITCOIND_VERSION=${BITCOIN_VERSION:-25.0}
BITCOIND_VERSION=${BITCOIN_VERSION:-25}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should use one place to manage the version, to avoid mistakes such as 994a142

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe this is a dumb question but why isn't this number 26?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is just the fallback version in case no environment variable is set. We set the version we actually want here:

BITCOIN_VERSION: "26"

But I guess we shouldn't do that to avoid confusion...

Copy link

coderabbitai bot commented Feb 1, 2024

Important

Auto Review Skipped

Auto reviews are limited to the following labels: llm-review. Please add one of these labels to enable auto reviews.

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.

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>.
    • Generate unit-tests 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 tests 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link
Collaborator

@ProofOfKeags ProofOfKeags left a comment

Choose a reason for hiding this comment

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

I pulled this down and tested it and it looks like everything passes except a wtclient test (possibly a flake?). It doesn't seem related to this as best I can tell. I think that test will pass if you rebase this.

@@ -2,9 +2,9 @@

set -ev

BITCOIND_VERSION=${BITCOIN_VERSION:-25.0}
BITCOIND_VERSION=${BITCOIN_VERSION:-25}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe this is a dumb question but why isn't this number 26?

@guggero
Copy link
Collaborator Author

guggero commented Feb 2, 2024

@Roasbeef can you see the logs of the failed Travis build?
I only get this error message (not sure if we need to re-auth the app somehow?):

Screenshot from 2024-02-02 18-37-28

To make it less confusing what version of bitcoind is actually
installed, we now require the version to be specified as a command line
argument.

Because we tag the version in the docker image tag as bitcoin-core:XX
but the binary internally is located under /opt/bitcoin-XX.Y/, we
manually set Y to 0.
With this commit we create a new function that returns system wide
unique ports by using a single file to keep track of previously used
ports. We'll want to use this everywhere whenever we need to listen on a
new, random port during unit or integration tests.
Because we now have a unique source, we don't need to apply the port
offset that was used for the different tranches of parallel running
integration tests before.
Make sure we wait for the initial connection long enough.
This commit fixes a number of issues with our temporary bitcoind nodes
that we spin up for unit tests:
 - We didn't remove the node's temporary data dir after tests finished.
 - We used random ports which lead to unwanted port collisions.
 - We used ipc:// unix sockets for ZMQ which currently isn't supported
   in bitcoind v26.0 due to a regression. Since we can reliably create
   new non-colliding ports now, we should use TCP for ZMQ anyway.
With the chainntnfs.NewMiner now being optimized for not creating
nodes with colliding ports, we use it in all unit tests that spin up
temporary miners.
To avoid circular dependency issues between packages, we move the unit
test backend creation function to a new package in the lntest parent
package.
Since we fixed a number of issues in chainntnfs.NewBitcoindBackend that
makes it compatible with bitcoind v26.0, we now want to use that
function in all our unit tests.
To make it easy to add "-test.v" and "-test.count=1" to the unit tests,
we add two new make flags.
This is a commit to attempt to fix Travis which runs on ARM64.
Because we pass in the same config into multiple notifiers, we sometimes
get a data race in the unit tests. By creating a copy of the config we
avoid that.
@guggero
Copy link
Collaborator Author

guggero commented Mar 18, 2024

Okay, this is as green as it will probably ever get. There are still a couple of (pre-existing!) flakes in there. But I vote to get this merged since they very likely don't have anything to do with bitcoind.

@guggero guggero requested review from ProofOfKeags, Roasbeef and yyforyongyu and removed request for Roasbeef March 18, 2024 20:32
@yyforyongyu yyforyongyu added this to the v0.18.0 milestone Mar 19, 2024
Copy link
Collaborator

@yyforyongyu yyforyongyu left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the fix🙏

.github/workflows/main.yml Show resolved Hide resolved
@yyforyongyu
Copy link
Collaborator

btw can we update our merge rules to exclude the build from macOS?

Copy link
Collaborator

@ProofOfKeags ProofOfKeags left a comment

Choose a reason for hiding this comment

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

🤝

@guggero
Copy link
Collaborator Author

guggero commented Mar 20, 2024

btw can we update our merge rules to exclude the build from macOS?

It's currently not included in the list of required tests. So merges shouldn't be blocked on it (same for Windows).

@guggero guggero merged commit ad9144f into lightningnetwork:master Mar 20, 2024
25 of 27 checks passed
@guggero guggero deleted the bitcoind-26 branch March 20, 2024 07:50
@pinheadmz
Copy link

pinheadmz commented Apr 18, 2024

FWIW bitcoin/bitcoin#27679 is updated, has two ACKs already, and a review from an LND dev would be helpful to get a merge ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bitcoind Bitcoin Core backend CI continuous integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants