-
Notifications
You must be signed in to change notification settings - Fork 3
[PIP-0002]: Migration from BTC-Style Difficulty Adjustment Algorithm to ASERT #5
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
Conversation
|
Proposed activation block height: 17610 |
Good job, keep going 👍 |
|
I think we should wait. There will be a reduction in difficulty soon and it will be seen there. |
I tend to agree with this view. But also need to take into account that we're loosing hashrate daily. With current hashrate the next DAA window will be reached in 2 to 3 months from now. My ideal scenario is to (hopefully) get past 18144 without these changes and postpone this migration to a later height. Not sure that's possible though. I wont push these changes for at least a few days and I want to gather feedback from the community about it as it's a controversial topic. Thanks for expressing your opinion here. Cheers! |
|
This idea is such a good thing! I took a really quick look of the code and found one moment. |
Yes, you are correct. I'm working on a "reorg aware" activation as we speak. Feel free to propose a solution too! The chance of a reorg deep enough to hit the activation block is very unlike though. This need to be fixed nonetheless. Thanks. |
|
Please activate |
Yes, solution is great. |
I don't think we need to worry about excessive DB lookups at the moment. At current state, it queries the DB up to three times at CalcDifficulty call and then caches the necessary attributes, and once per CalcDifficulty call to determine if a reorg happened. At some point in the future we can consider the anchor block immutable once the chain tip is further above the activation height, and then hard code the attributes required to calculate next target in ASERT (anchor difficulty and anchor parent time). |
I totally agree with you. Good job! |
|
We migrate to ASERT if network hashrate remains below 25GH/s until December 12th, with activation early next week. |
|
We lost half of the network hashrate in the last couple days and we're well bellow the 25GH/s threshold. I'm going to anticipate the merging of this PR as I won't be available during xmas holidays (23th - 30th) and would be good to have this activated when I'm still around just in case. Activation at block height 17560 which we should reach in a few days. I think there's plenty of time for mining pools and exchanges to upgrade. |
Summary
This PR implements the difficulty adjustment algorithm described in PIP-0002, migrating Parallax from the original Bitcoin-style 2016-block DAA to ASERT (Absolutely Scheduled Exponentially Rising Targets). The goal is to make block times more stable and predictable under volatile network hashrate, while reducing miner gaming opportunities and improving long-term network reliability.
Motivation
The current BTC-style DAA only adjusts every 2016 blocks and responds poorly to sudden hashrate swings. This has already caused long block intervals and unstable chain progression during periods of low mining participation. ASERT solves this by adjusting difficulty on every block. The algorithm reacts smoothly and immediately to changes in network hashrate, preventing multi-hour slowdowns and oscillations. This proposal was discussed with the community in GitHub Discussion #3.
Benefits
Philosophical Tradeoff
Migrating from the classic Bitcoin-style DAA to ASERT is not only a technical change but also a philosophical one. The Bitcoin DAA is intentionally conservative: it accepts long periods of slow or fast blocks as a natural consequence of decentralized mining dynamics. This design reflects a philosophy that the protocol should intervene as little as possible in short-term market behavior. Difficulty adjustments happen infrequently and only after long, deterministic windows. This conservatism creates stability in a historical sense, even if short-term block times become inconsistent.
ASERT takes a different approach. It prioritizes real-time responsiveness, smooth adjustment, and protection against miner-driven oscillations. It treats consistent block intervals as a core part of user and developer experience, and it smooths out volatility rather than allowing it to propagate for thousands of blocks. This aligns with a philosophy that a modern Proof-of-Work chain should not suffer multi-hour stalls simply because mining participation temporarily drops.
Adopting ASERT means embracing the view that predictable block timing, network usability, and security against timestamp manipulation are more important than preserving the exact mechanical behavior inherited from Bitcoin’s historical design. Some purists may view the BTC-style DAA’s inertia as a virtue, while others see ASERT's per-block feedback loop as a more evolved and resilient model for a contemporary PoW network.
Consensus Impact
This is a consensus-breaking change. All non-upgraded nodes will diverge from the canonical chain at the activation height. Therefore, the activation block height must be announced in advance, and all miners and node operators must upgrade before that point.
Implementation Details
heightDeltaandtimeDeltato derive the exponential deviation from ideal schedule using fixed-point math with a 2^16 radix.Testing
Rollout Plan
Conclusion
ASERT provides a stronger and more stable foundation for Parallax in its current stage of network growth. The change removes the fragility observed under BTC-style DAA and ensures predictable block intervals even with shifting miner participation. This PR is ready for review and community approval.