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

Add testing on Compact Block filters in CI #668

Conversation

vladimirfomene
Copy link
Contributor

Setup testing on Compact block filters blockchain
backend.

Description

While working on #634, I realized we don't have a setup for carrying out test on Compact Block Filters blockchain in CI. This PR is a work in progress solution to get that setup.

Notes to the reviewers

For some reason the tests are taking too long to run.

compact-block-filter-ci

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature
  • I've updated CHANGELOG.md

Bugfixes:

  • This pull request breaks the existing API
  • I've added tests to reproduce the issue which are now passing
  • I'm linking the issue being fixed by this PR

Setup testing on Compact block filters blockchain
backend.
Copy link
Contributor

@rajarshimaitra rajarshimaitra left a comment

Choose a reason for hiding this comment

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

Overall concept ACK on the idea of testing compact filter syncing in regtest.. Thanks for opening this up.. We might need this after integrating nakamoto too.. See here #680 (comment)

But it needs the following additions to work properly..

Comment on lines +592 to +598
let bitcoind_port = test_client.bitcoind.params.rpc_socket.port();
let num_threads = 2;
let mempool = Arc::new(Mempool::default());
let peers = (0..num_threads)
.map(|_| Peer::connect(format!("localhost:{}", bitcoind_port), Arc::clone(&mempool), Network::Regtest))
.collect::<Result<_, _>>().unwrap();
CompactFiltersBlockchain::new(peers, "./wallet-filters", Some(0)).unwrap()
Copy link
Contributor

Choose a reason for hiding this comment

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

I haven't tested yet, but I don't think this logic will work..

  • You can't get compact filters from rpc port. You have to connect to the p2p port.
  • The test client doesn't serve compact filters by default. You need to set a extra bitcoind args parameter accordingly to turn that on the test client.. Which can be done under a feature gate..

@vladimirfomene
Copy link
Contributor Author

@rajarshimaitra , I will definitely get back to this once we integrate with Nakamoto.

@rajarshimaitra
Copy link
Contributor

rajarshimaitra commented Aug 25, 2022

Upon further thinking.. I think this can go into bdk even without nakamoto.. From the PoV of a testing framework we will always have only one single backend.. And CBF operation with single peer will be same between current bdk's cbf module and nakamoto..

So it might make sense to get this done even before we get nakamoto and bring the bdk's cbf impl into testing.. In that case, was when we shift to nakamoto we will already have a something to test it against, at least single peer scenario..

On high level what needs to be done to get compact_filters to testing is

  • Configure bitcoind in TestClient as compact blockfilter serving.. This should happen under a feature flag..
  • Get the p2p port of the bitcoind as pass that into compact filter blockchain..

@vladimirfomene if you are open to work on this I would suggest to carry on, as you are already quite close to the final thing..

@danielabrozzoni
Copy link
Member

Hey, we are in the process of releasing BDK 1.0, which will under the hood work quite differently from the current BDK. For this reason, I'm closing all the PRs that don't really apply anymore. If you think this is a mistake, feel free to rebase on master and re-open!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants