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: add excess to changeless LowestFee score #11

Conversation

jp1ac4
Copy link
Contributor

@jp1ac4 jp1ac4 commented Dec 12, 2023

This is to fix the part of #6 relating to bitcoindevkit/bdk#1072 (comment).

For the LowestFee metric, it adds the excess to changeless solutions instead of those with change.

@LLFourn
Copy link
Collaborator

LLFourn commented Dec 13, 2023

I still think it's wrong after this. Why are we adding the lower bound thing to it. In the case of no drain the metric should just be: (cs.selected_value() - self.target.value) as f32 i.e. the fee. Then with drain it should be (input_weight + base_weight + drain_weight) * feerate.

cc @evanlinjin

@LLFourn
Copy link
Collaborator

LLFourn commented Dec 19, 2023

Just noting that I've talked with @evanlinjin and I'm now in charge of fixing it.

@jp1ac4
Copy link
Contributor Author

jp1ac4 commented Dec 19, 2023

Thanks for the update. Feel free to close this PR if you'll be opening a new one.

@LLFourn
Copy link
Collaborator

LLFourn commented Dec 19, 2023

@evanlinjin can you close this PR and give me permission to manage this repo.

@jp1ac4 jp1ac4 closed this Dec 20, 2023
evanlinjin added a commit that referenced this pull request Jan 15, 2024
6ae0fdf docs: fix typos and use better wording (志宇)
9e1cecd Use ChangePolicy::min_value in lowest fee tests (LLFourn)
7360052 Write lowest fee test that hits important branch (LLFourn)
17cc8f2 Score branches before adding children (LLFourn)
e30246d Fix lowest_fee metric (LLFourn)
0aef6ff Make lowest fee test fail by implementing score correctly (LLFourn)
0c66696 Rethink is_target_met (LLFourn)

Pull request description:

  This replaces #11. This first commit just fixes the metric to make the tests fail. Note the previous calculation was overthinking it. The fee metric is just `inputs - outputs +  long_term_feerate * change_weight`.

  Next steps:
  1. Make ci actually run the tests and get them to fail.
  2. Fix the metric lower bound

ACKs for top commit:
  evanlinjin:
    ACK 6ae0fdf

Tree-SHA512: c9c684ed95bc946e7e1ad8d65cd03f15180ba0bbc4e901d0e55145006629063fd110a3a08307f3e8c091ff875e41492bebc31895819455b58cc6a137b56103bc
@jp1ac4 jp1ac4 deleted the lowest-fee-score-add-excess-to-changeless branch April 4, 2024 10:41
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.

2 participants