|
Ran
|
Jobs
1
|
Files
92
|
Run time
1min
|
Badge
README BADGES
|
push
github
Merge rust-bitcoin/rust-bitcoin#2740: Add difficulty adjustment calculation <a class=hub.com/rust-bitcoin/rust-bitcoin/commit/<a class="double-link" href="https://git"><a class=hub.com/rust-bitcoin/rust-bitcoin/commit/47dc4a318070b73158aa1e9b0f05e0146f46faff">47dc4a318<a href="https://github.com/rust-bitcoin/rust-bitcoin/commit/44a64028757a064de1f97a218fe85b301e95aa8d"> feat(pow): add difficulty adjustment calculation (Rob N) Pull request description: Hi, I hit a roadblock with the current `pow` API. As far as I can tell, the only workaround to calculate the next work required similar to `bitcoin/src/pow.cpp` is to use a general big integer library, convert the `Target` to bytes, do the math, and convert back to `Target` from bytes. I have also been working with [Floresta](https://github.com/Davidson-Souza/Floresta/tree/<a class="double-link" href="https://github.com/rust-bitcoin/rust-bitcoin/commit/<a class="double-link" href="https://git"><a class=</a>hub.com/rust-bitcoin/rust-bitcoin/commit/780ea8d0b024eb69ccb723ccce9b4e703b143bfd">780ea8d0b</a>) and their [solution](https://github.com/Davidson-Souza/Floresta/blob/780ea8d0b024eb69ccb723ccce9b4e703b143bfd/crates/floresta-chain/src/pruned_utreexo/consensus.rs#L187) was to fork off and exposed the `U256` struct publicly on their branch. I think these home brewed difficulty adjustment solutions will continually pop up, so I created a `from_next_work_required` method to return a `Target`. My work veers significantly from #2180, as I only provided a single method to do so, without further guidance on when exactly this retarget occurs. I am happy to add tests once I get further direction from maintainers if this as a likelihood of being accepted or not. Thanks. ACKs for top commit: tcharding: ACK 47dc4a318070b73158aa1e9b0f05e0146f46faff apoelstra: ACK 47dc4a318070b73158aa1e9b0f05e0146f46faff used range-diff Tree-SHA512: 6d627ce6918e08a91dc88b7c22f8f02dc41
126 of 127 new or added lines in 1 file covered. (99.21%)
19303 of 23168 relevant lines covered (83.32%)
16691.44 hits per line
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | 9096791071.1 | 0 |
83.32 |
GitHub Action Run |