Skip to content
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

Fix:Stop the rotation of validatorSet at any update in it. #983

Merged
merged 4 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -597,8 +597,11 @@
return abci.ResponseEndBlock{}
}

// increment proposer priority
currentValidatorSet.IncrementProposerPriority(1)
//Hardfork to remove the rotation of validator list on stake update
if ctx.BlockHeight() < helper.GetValidatorSetRotationStopHeight() {
// increment proposer priority
currentValidatorSet.IncrementProposerPriority(1)
}

Check warning on line 604 in app/app.go

View check run for this annotation

Codecov / codecov/patch

app/app.go#L601-L604

Added lines #L601 - L604 were not covered by tests

// validator set change
logger.Debug("[ENDBLOCK] Updated current validator set", "proposer", currentValidatorSet.GetProposer())
Expand Down
11 changes: 10 additions & 1 deletion helper/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ var newSelectionAlgoHeight int64 = 0

var spanOverrideHeight int64 = 0

var validatorSetRotationStopHeight int64 = 0

var newHexToStringAlgoHeight int64 = 0

type ChainManagerAddressMigration struct {
Expand Down Expand Up @@ -374,15 +376,17 @@ func InitHeimdallConfigWith(homeDir string, heimdallConfigFileFromFLag string) {
newSelectionAlgoHeight = 375300
spanOverrideHeight = 8664000
newHexToStringAlgoHeight = 9266260

validatorSetRotationStopHeight = 50000000 //Change this value
case MumbaiChain:
newSelectionAlgoHeight = 282500
spanOverrideHeight = 10205000
newHexToStringAlgoHeight = 12048023
validatorSetRotationStopHeight = 50000000 //Change this value
default:
newSelectionAlgoHeight = 0
spanOverrideHeight = 0
newHexToStringAlgoHeight = 0
validatorSetRotationStopHeight = 50000000 //Change this value
}
}

Expand Down Expand Up @@ -501,6 +505,11 @@ func GetSpanOverrideHeight() int64 {
return spanOverrideHeight
}

// GetValidatorSetRotationStopHeight returns validatorSetRotationStopHeight
func GetValidatorSetRotationStopHeight() int64 {
return validatorSetRotationStopHeight
}

// GetNewHexToStringAlgoHeight returns newHexToStringAlgoHeight
func GetNewHexToStringAlgoHeight() int64 {
return newHexToStringAlgoHeight
Expand Down