Page MenuHomePhabricator

Compute the real-time hash target for the next block
ClosedPublic

Authored by Fabien on Sep 6 2024, 13:21.

Details

Reviewers
PiRK
roqqit
Group Reviewers
Restricted Project
Commits
rABCccfbdd5df5fe: Compute the real-time hash target for the next block
Summary

Given some input parameters, compute the next minimum hash for a block to be avalanche accepted.
Only the computation is part of this diff.

Inspired by the research from https://ledger.pitt.edu/ojs/ledger/article/download/195/187/1008.

Test Plan
ninja check

Diff Detail

Event Timeline

Fabien requested review of this revision.Sep 6 2024, 13:21
This revision is now accepted and ready to land.Sep 6 2024, 15:13
Fabien planned changes to this revision.Sep 9 2024, 07:19

Got offline feedback that deserves looking at a design update

This revision is now accepted and ready to land.Sep 11 2024, 14:21

Improve comment on the windows selection

roqqit requested changes to this revision.Sep 11 2024, 21:03
roqqit added inline comments.
src/policy/block/rtt.cpp
36

nit: this can be explicitly static also

src/test/rtt_tests.cpp
35–37

Make this check more comprehensive

This revision now requires changes to proceed.Sep 11 2024, 21:03
bytesofman added inline comments.
src/policy/block/rtt.cpp
23

i think either these formulae or this formula

33

Feedback + remove the 18th block in the test, this is confusing for no reason as block[0] is the previous block as per the GetNextRTTWorkRequired call.

PiRK added inline comments.
src/test/rtt_tests.cpp
35 ↗(On Diff #49606)
This revision is now accepted and ready to land.Sep 12 2024, 15:38