Skip to content

Commit

Permalink
xdc-0.9.2d
Browse files Browse the repository at this point in the history
- minimum required signer difficulty drop speed up to 4196000
- modified min. pow formula to stabilize min pow between superblocks
  • Loading branch information
IxiAngel committed Jun 18, 2024
1 parent 20380da commit 7bf014b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions IxianDLT/Block/BlockChain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -677,8 +677,8 @@ public IxiNumber getRequiredSignerDifficulty(Block block, bool adjustToRatio)

private IxiNumber adjustSignerDifficultyToRatio(ulong blockNum, IxiNumber difficulty)
{
// TODO Remove whole if section after block 4200000
if (blockNum < 4200000)
// TODO Remove whole if section after block 4196000
if (blockNum < 4196000)
{
return (difficulty * 51) / 100;
}
Expand Down Expand Up @@ -1357,14 +1357,16 @@ public IxiNumber getMinSignerPowDifficulty(ulong blockNum)
{
return SignerPowSolution.bitsToDifficulty(0x00000000000000FF);
}
// TODO Default to 7 after block 4200000 and remove everything related to 15
// TODO Default to 7 after block 4196000 and remove everything related to 15
uint minDiffRatio = 7;
if (blockNum < 4200000)
ulong frozenSignatureCount = (ulong)ConsensusConfig.maximumBlockSigners;
if (blockNum < 4196000)
{
minDiffRatio = 15;
frozenSignatureCount = (ulong)tb.getFrozenSignatureCount();
}
//
var difficulty = getRequiredSignerDifficulty(blockNum, true) / ((ulong)tb.getFrozenSignatureCount() * minDiffRatio);
var difficulty = getRequiredSignerDifficulty(blockNum, true) / (frozenSignatureCount * minDiffRatio);
if (difficulty < ConsensusConfig.minBlockSignerPowDifficulty)
{
difficulty = ConsensusConfig.minBlockSignerPowDifficulty;
Expand Down
2 changes: 1 addition & 1 deletion IxianDLT/Meta/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public static string dataFolderBlocks
public static ulong forceSyncToBlock = 0;

// Read-only values
public static readonly string version = "xdc-0.9.2c"; // DLT Node version
public static readonly string version = "xdc-0.9.2d"; // DLT Node version

public static readonly string checkVersionUrl = "https://www.ixian.io/update.txt";
public static readonly int checkVersionSeconds = 6 * 60 * 60; // 6 hours
Expand Down

0 comments on commit 7bf014b

Please sign in to comment.