Skip to content

Commit

Permalink
EVM-519 Resolve slashing related TODOs in the code (#1581)
Browse files Browse the repository at this point in the history
  • Loading branch information
igorcrevar committed Jun 2, 2023
1 parent fb7a3f3 commit 994e190
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
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

0 comments on commit 994e190

Please sign in to comment.