Page MenuHomePhabricator

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

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

Details

Reviewers
PiRK
roqqit
Group Reviewers
Restricted Project
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.Fri, Sep 6, 13:21
This revision is now accepted and ready to land.Fri, Sep 6, 15:13
Fabien planned changes to this revision.Mon, Sep 9, 07:19

Got offline feedback that deserves looking at a design update

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

Improve comment on the windows selection

roqqit requested changes to this revision.Wed, Sep 11, 21:03
roqqit added inline comments.
src/policy/block/rtt.cpp
36 ↗(On Diff #49598)

nit: this can be explicitly static also

src/test/rtt_tests.cpp
35–37 ↗(On Diff #49598)

Make this check more comprehensive

This revision now requires changes to proceed.Wed, Sep 11, 21:03
bytesofman added inline comments.
src/policy/block/rtt.cpp
23 ↗(On Diff #49598)

i think either these formulae or this formula

33 ↗(On Diff #49598)

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.Thu, Sep 12, 15:38