Skip to content

Commit

Permalink
Read block period from genesis file (#1071)
Browse files Browse the repository at this point in the history
* read block period from genesis file

* lint

* CI changes
  • Loading branch information
mrsmkl authored Jun 12, 2020
1 parent 779fcb0 commit bf2ba25
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ jobs:
cd celo-monorepo
yarn install || yarn install
PACKAGES=$(cat dependency-graph.json | python -c 'import json,sys;obj=json.load(sys.stdin);print "\n".join(str(obj[x]["location"]) for x in obj["@celo/celotool"]["dependencies"][::-1])')
for i in `echo $PACKAGES`; do yarn --cwd packages/$i build; done
for i in $PACKAGES; do yarn --cwd $i build; done
yarn --cwd packages/celotool build
- run:
name: Setup Go language
Expand Down
1 change: 0 additions & 1 deletion cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,6 @@ func SetP2PConfig(ctx *cli.Context, cfg *p2p.Config) {
setBootstrapNodes(ctx, cfg)
setBootstrapNodesV5(ctx, cfg)

log.Info("Setting it here")
cfg.NetworkId = getNetworkId(ctx)

lightClient := ctx.GlobalString(SyncModeFlag.Name) == "light"
Expand Down
6 changes: 6 additions & 0 deletions eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,12 @@ func CreateConsensusEngine(ctx *node.ServiceContext, chainConfig *params.ChainCo
if chainConfig.Istanbul.Epoch != 0 {
config.Istanbul.Epoch = chainConfig.Istanbul.Epoch
}
if chainConfig.Istanbul.RequestTimeout != 0 {
config.Istanbul.RequestTimeout = chainConfig.Istanbul.RequestTimeout
}
if chainConfig.Istanbul.BlockPeriod != 0 {
config.Istanbul.BlockPeriod = chainConfig.Istanbul.BlockPeriod
}
if chainConfig.Istanbul.LookbackWindow != 0 {
config.Istanbul.LookbackWindow = chainConfig.Istanbul.LookbackWindow
}
Expand Down
8 changes: 5 additions & 3 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,11 @@ type ChainConfig struct {

// IstanbulConfig is the consensus engine configs for Istanbul based sealing.
type IstanbulConfig struct {
Epoch uint64 `json:"epoch"` // Epoch length to reset votes and checkpoint
ProposerPolicy uint64 `json:"policy"` // The policy for proposer selection
LookbackWindow uint64 `json:"lookbackwindow"` // The number of blocks to look back when calculating uptime
Epoch uint64 `json:"epoch"` // Epoch length to reset votes and checkpoint
ProposerPolicy uint64 `json:"policy"` // The policy for proposer selection
LookbackWindow uint64 `json:"lookbackwindow"` // The number of blocks to look back when calculating uptime
BlockPeriod uint64 `json:"blockperiod,omitempty"` // Default minimum difference between two consecutive block's timestamps in second
RequestTimeout uint64 `json:"requesttimeout,omitempty"` // The timeout for each Istanbul round in milliseconds.
}

// String implements the stringer interface, returning the consensus engine details.
Expand Down

0 comments on commit bf2ba25

Please sign in to comment.