Merge branch 'master' into max-code-size

This commit is contained in:
Samer Falah 2020-04-30 11:08:32 -04:00 committed by GitHub
commit ed98041bdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 3 additions and 12 deletions

View File

@ -1640,9 +1640,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
}
// set immutability threshold in config
if ctx.GlobalIsSet(QuorumImmutabilityThreshold.Name) {
cfg.QuorumImmutabilityThreshold = ctx.GlobalInt(QuorumImmutabilityThreshold.Name)
}
params.SetQuorumImmutabilityThreshold(ctx.GlobalInt(QuorumImmutabilityThreshold.Name))
// Override any default configs for hard coded networks.
switch {

View File

@ -150,9 +150,6 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
if (chainConfig.ChainID != nil && chainConfig.ChainID.Int64() == 1) || config.NetworkId == 1 {
return nil, errors.New("Cannot have chain id or network id as 1.")
}
// set the immutability threshold value in line with value passed
params.SetQuorumImmutabilityThreshold(config.QuorumImmutabilityThreshold)
}
if !rawdb.GetIsQuorumEIP155Activated(chainDb) && chainConfig.ChainID != nil {

View File

@ -166,7 +166,4 @@ type Config struct {
// Istanbul block override (TODO: remove after the fork)
OverrideIstanbul *big.Int
// Freezer db immutability threshold
QuorumImmutabilityThreshold int
}

View File

@ -62,21 +62,20 @@ const (
// //Quorum
var quorumImmutabilityThreshold int
var isQuorum = false
// returns the immutability threshold set for the network
func GetImmutabilityThreshold() int {
if isQuorum {
if quorumImmutabilityThreshold > 0 {
return quorumImmutabilityThreshold
}
return ImmutabilityThreshold
}
// sets the immutability threshold and isQuorum to passed values
func SetQuorumImmutabilityThreshold(immutabilityThreshold int) {
quorumImmutabilityThreshold = immutabilityThreshold
isQuorum = true
}
// /Quorum