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 fc3ba4b
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 20 deletions.
2 changes: 1 addition & 1 deletion cmd/utils/flags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,6 @@ func TestQuorumConfigFlags(t *testing.T) {
config := arbitraryEthConfig.Istanbul.GetConfig(nil)
assert.Equal(t, uint64(23), config.RequestTimeout, "IstanbulRequestTimeoutFlag value is incorrect")
assert.Equal(t, uint64(34), config.BlockPeriod, "IstanbulBlockPeriodFlag value is incorrect")
assert.Equal(t, uint64(34), config.EmptyBlockPeriod, "IstanbulEmptyBlockPeriodFlag value is incorrect")
assert.Equal(t, uint64(0), config.EmptyBlockPeriod, "IstanbulEmptyBlockPeriodFlag value is incorrect")
assert.Equal(t, true, arbitraryEthConfig.RaftMode, "RaftModeFlag value is incorrect")
}
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 fc3ba4b

Please sign in to comment.