Added components for difficulty adjustment#633
Conversation
1ce446b to
490dc07
Compare
490dc07 to
f4202e8
Compare
f4202e8 to
2c2c774
Compare
| const expectedAdjustment = (epochTiming) => | ||
| epochTiming | ||
| ? (TARGET_BLOCK_SECONDS / epochTiming.averageBlockSeconds - 1) * 100 | ||
| : null; |
There was a problem hiding this comment.
https://wiki.bitcoinsv.io/index.php/Difficulty
In the original implementation, still used by Bitcoin Core (BTC), the difficulty can rise by a maximum of 400% of the current difficulty in a single adjustment.
In the original implementation, still used by Bitcoin Core (BTC), the network's difficulty can adjust downwards by up to 75% of the current difficulty in a single adjustment.
I think we should set limits regarding the protocol, regardless of the numbers that might be included in the calculation.
There was a problem hiding this comment.
I'm not convinced this belongs in the visualization layer. As I see it, this view is intended to visualize the calculated values rather than validate them against consensus rules.
If the calculated adjustment were to exceed the protocol's ±400%/-75% limits, what would we do with that information? Would we display a warning that the calculated value is invalid according to consensus? If so, I'm not sure why we'd make this particular consensus rule special when we don't surface other consensus validity checks here.
2c2c774 to
f6f1301
Compare
To run locally, npm install and use the following snippets:
Bitcoin:

Liquid:
No change to Liquid views