Skip to content

Commit

Permalink
go fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
antonydenyer committed Sep 21, 2022
1 parent b0ed92f commit c933547
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 19 deletions.
1 change: 0 additions & 1 deletion consensus/istanbul/ibft/engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ func (e *Engine) verifyCascadingFields(chain consensus.ChainHeaderReader, header
return consensus.ErrUnknownAncestor
}


// Ensure that the block's timestamp isn't too close to it's parent
if parent.Time+e.cfg.GetConfig(parent.Number).BlockPeriod > header.Time {
return istanbulcommon.ErrInvalidTimestamp
Expand Down
4 changes: 2 additions & 2 deletions consensus/istanbul/qbft/core/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
package core

import (
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
"time"

"github.com/ethereum/go-ethereum/consensus/istanbul"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
)

// handleRequest is called by proposer in reaction to `miner.Seal()`
Expand Down
14 changes: 7 additions & 7 deletions eth/ethconfig/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ func TestSetBFT(t *testing.T) {
assert.Equal(t, config.ProposerPolicy, istanbul.DefaultConfig.ProposerPolicy)

bftConfig = &params.BFTConfig{
EpochLength: 10000,
Ceil2Nby3Block: big.NewInt(10),
RequestTimeoutSeconds: 100,
BlockPeriodSeconds: 5,
EpochLength: 10000,
Ceil2Nby3Block: big.NewInt(10),
RequestTimeoutSeconds: 100,
BlockPeriodSeconds: 5,
}
setBFTConfig(config, bftConfig)
assert.Equal(t, config.Ceil2Nby3Block, bftConfig.Ceil2Nby3Block)
Expand All @@ -39,9 +39,9 @@ func TestSetBFT(t *testing.T) {
assert.Equal(t, config.ProposerPolicy, istanbul.DefaultConfig.ProposerPolicy)

bftConfig = &params.BFTConfig{
EpochLength: 10000,
Ceil2Nby3Block: big.NewInt(10),
RequestTimeoutSeconds: 100,
EpochLength: 10000,
Ceil2Nby3Block: big.NewInt(10),
RequestTimeoutSeconds: 100,
}
setBFTConfig(config, bftConfig)
assert.Equal(t, config.Ceil2Nby3Block, bftConfig.Ceil2Nby3Block)
Expand Down
16 changes: 8 additions & 8 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,13 +409,13 @@ func (c *IstanbulConfig) String() string {
}

type BFTConfig struct {
EpochLength uint64 `json:"epochlength"` // Number of blocks that should pass before pending validator votes are reset
BlockPeriodSeconds uint64 `json:"blockperiodseconds"` // Minimum time between two consecutive IBFT or QBFT blocks’ timestamps in seconds
EmptyBlockPeriodSeconds *uint64 `json:"emptyblockperiodseconds,omitempty"` // Minimum time between two consecutive IBFT or QBFT a block and empty block’ timestamps in seconds
RequestTimeoutSeconds uint64 `json:"requesttimeoutseconds"` // Minimum request timeout for each IBFT or QBFT round in milliseconds
ProposerPolicy uint64 `json:"policy"` // The policy for proposer selection
Ceil2Nby3Block *big.Int `json:"ceil2Nby3Block,omitempty"` // Number of confirmations required to move from one state to next [2F + 1 to Ceil(2N/3)]
ValidatorContractAddress common.Address `json:"validatorcontractaddress"` // Smart contract address for list of validators
EpochLength uint64 `json:"epochlength"` // Number of blocks that should pass before pending validator votes are reset
BlockPeriodSeconds uint64 `json:"blockperiodseconds"` // Minimum time between two consecutive IBFT or QBFT blocks’ timestamps in seconds
EmptyBlockPeriodSeconds *uint64 `json:"emptyblockperiodseconds,omitempty"` // Minimum time between two consecutive IBFT or QBFT a block and empty block’ timestamps in seconds
RequestTimeoutSeconds uint64 `json:"requesttimeoutseconds"` // Minimum request timeout for each IBFT or QBFT round in milliseconds
ProposerPolicy uint64 `json:"policy"` // The policy for proposer selection
Ceil2Nby3Block *big.Int `json:"ceil2Nby3Block,omitempty"` // Number of confirmations required to move from one state to next [2F + 1 to Ceil(2N/3)]
ValidatorContractAddress common.Address `json:"validatorcontractaddress"` // Smart contract address for list of validators
}

type IBFTConfig struct {
Expand Down Expand Up @@ -447,7 +447,7 @@ type Transition struct {
Algorithm string `json:"algorithm,omitempty"`
EpochLength uint64 `json:"epochlength,omitempty"` // Number of blocks that should pass before pending validator votes are reset
BlockPeriodSeconds uint64 `json:"blockperiodseconds,omitempty"` // Minimum time between two consecutive IBFT or QBFT blocks’ timestamps in seconds
EmptyBlockPeriodSeconds *uint64 `json:"emptyblockperiodseconds,omitempty"` // Minimum time between two consecutive IBFT or QBFT a block and empty block’ timestamps in seconds
EmptyBlockPeriodSeconds *uint64 `json:"emptyblockperiodseconds,omitempty"` // Minimum time between two consecutive IBFT or QBFT a block and empty block’ timestamps in seconds
RequestTimeoutSeconds uint64 `json:"requesttimeoutseconds,omitempty"` // Minimum request timeout for each IBFT or QBFT round in milliseconds
ContractSizeLimit uint64 `json:"contractsizelimit,omitempty"` // Maximum smart contract code size
ValidatorContractAddress common.Address `json:"validatorcontractaddress"` // Smart contract address for list of validators
Expand Down
1 change: 0 additions & 1 deletion params/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@ func TestCheckTransitionsData(t *testing.T) {
var ibftTransitionsConfig, qbftTransitionsConfig, invalidTransition, invalidBlockOrder []Transition
var emptyBlockPeriodSeconds uint64 = 10


tranI0 := Transition{big.NewInt(0), IBFT, 30000, 5, nil, 10, 50, common.Address{}, "", nil, nil, nil, nil, 0, nil, 0}
tranQ5 := Transition{big.NewInt(5), QBFT, 30000, 5, &emptyBlockPeriodSeconds, 10, 50, common.Address{}, "", nil, nil, nil, nil, 0, nil, 0}
tranI10 := Transition{big.NewInt(10), IBFT, 30000, 5, nil, 10, 50, common.Address{}, "", nil, nil, nil, nil, 0, nil, 0}
Expand Down

0 comments on commit c933547

Please sign in to comment.