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

integration: optimize harness for better itest control, restore bitcoind compatibility #1659

Merged
merged 4 commits into from
Nov 14, 2020

Conversation

guggero
Copy link
Collaborator

@guggero guggero commented Nov 11, 2020

Some improvements to the integration harness:

  • allow btcd binary to be specified instead of always building it from source
  • allow listener addresses to be overwritten to avoid port collisions
  • allow overwriting RPC connection retry parameters

Everything falls back to the previous behavior if not otherwise specified. Existing users will just need to specify one more parameter.

EDIT: The PR now also contains a commit that restores compatibility with bitcoind > 0.19! There was a side effect of #1594 that caused the sendrawtransaction command not to work anymore.

@Roasbeef @wpaulino

To allow using a custom btcd executable, we allow specifying a path to a
file. If the path is empty, the harness will fall back to compiling one
from scratch.
@guggero
Copy link
Collaborator Author

guggero commented Nov 11, 2020

I just tested this with our lnd itests and it seems because it's built against btcd master, we might also need to fix this issue before we can use it in lnd: lightningnetwork/lnd#4589 (comment)

Copy link
Collaborator

@jakesylvestre jakesylvestre left a comment

Choose a reason for hiding this comment

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

This looks good to me. Function overwrites looks a little odd, but I don't think there's a better way to do it.

Would love to get someone else to look at it before merging

@guggero guggero changed the title integration: optimize harness for better itest control integration: optimize harness for better itest control, restore bitcoind compatibility Nov 12, 2020
@guggero
Copy link
Collaborator Author

guggero commented Nov 12, 2020

I just tested this with our lnd itests and it seems because it's built against btcd master, we might also need to fix this issue before we can use it in lnd: lightningnetwork/lnd#4589 (comment)

Added a commit to fix this.

The PR btcsuite#1594 introduced a change that made the order of parameters
relevant, if one of them is nil. This makes it harder to be backward
compatible with the same JSON message if an existing parameter in
bitcoind was re-purposed to have a different meaning.
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 🐲

// AllowHighFeesOrMaxFeeRate defines a type that can either be the legacy
// allowhighfees boolean field or the new maxfeerate int field.
type AllowHighFeesOrMaxFeeRate struct {
Value interface{}
Copy link
Member

Choose a reason for hiding this comment

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

Ahh, clever way to handle this!

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