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

EVM-519 Resolve slashing related TODOs in the code #1581

Merged
merged 1 commit into from
Jun 2, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions consensus/polybft/consensus_runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ func (c *consensusRuntime) OnBlockInserted(fullBlock *types.FullBlock) {
var (
epoch = c.epoch
err error
//nolint:godox
// TODO - this will need to take inconsideration if slashing occurred (to be fixed in EVM-519)
// calculation of epoch and sprint end does not consider slashing currently

isEndOfEpoch = c.isFixedSizeOfEpochMet(fullBlock.Block.Header.Number, epoch)
)

Expand Down Expand Up @@ -352,13 +352,10 @@ func (c *consensusRuntime) FSM() error {
return fmt.Errorf("cannot create block builder for fsm: %w", err)
}

//nolint:godox
// TODO - recognize slashing occurred (to be fixed in EVM-519)
slash := false

pendingBlockNumber := parent.Number + 1
isEndOfSprint := slash || c.isFixedSizeOfSprintMet(pendingBlockNumber, epoch)
isEndOfEpoch := slash || c.isFixedSizeOfEpochMet(pendingBlockNumber, epoch)
// calculation of epoch and sprint end does not consider slashing currently
isEndOfSprint := c.isFixedSizeOfSprintMet(pendingBlockNumber, epoch)
isEndOfEpoch := c.isFixedSizeOfEpochMet(pendingBlockNumber, epoch)

valSet := validator.NewValidatorSet(epoch.Validators, c.logger)

Expand Down
2 changes: 0 additions & 2 deletions consensus/polybft/fsm.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ func (f *fsm) BuildProposal(currentRound uint64) ([]byte, error) {
return nil, err
}

//nolint:godox
// TODO: we will need to revisit once slashing is implemented (to be fixed in EVM-519)
extra := &Extra{Parent: extraParent.Committed}
// for non-epoch ending blocks, currentValidatorsHash is the same as the nextValidatorsHash
nextValidators := f.validators.Accounts()
Expand Down