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

Change killTx validation #780

Merged
merged 2 commits into from
Aug 25, 2021
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions blockchain/validation/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,15 @@ func validateKillIdentityTx(appState *appstate.AppState, tx *types.Transaction,
if identityState == state.Candidate || identityState == state.Newbie || identityState == state.Killed {
return InvalidSender
}
if appCfg == nil || !appCfg.Consensus.ChangeKillTxValidation {
return nil
}
if sender == appState.State.GodAddress() {
return nil
}
if identityState == state.Undefined || identityState == state.Invite {
return InvalidSender
}
return nil
}

Expand Down
2 changes: 2 additions & 0 deletions config/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ type ConsensusConf struct {
BurnInviteeStake bool
ReductionOneDelay time.Duration
EnableValidationSharding bool
ChangeKillTxValidation bool
IncreaseGodInvitesLimit bool
}

Expand Down Expand Up @@ -163,6 +164,7 @@ func ApplyConsensusVersion(ver ConsensusVerson, cfg *ConsensusConf) {
cfg.EndActivationDate = time.Date(2021, 05, 18, 0, 0, 0, 0, time.UTC).Unix()
case ConsensusV6:
cfg.EnableValidationSharding = true
cfg.ChangeKillTxValidation = true
cfg.IncreaseGodInvitesLimit = true
cfg.Version = ConsensusV6
cfg.MigrationTimeout = 0
Expand Down