github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/state/protocol/defaults.go (about)

     1  package protocol
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/onflow/flow-go/model/flow"
     7  )
     8  
     9  // DefaultEpochCommitSafetyThreshold returns the default epoch commit safety
    10  // threshold for each chain ID. Greater threshold values are generally safer,
    11  // but require longer epochs and longer EpochCommit phases. See Params for
    12  // more details on this value.
    13  func DefaultEpochCommitSafetyThreshold(chain flow.ChainID) (uint64, error) {
    14  	switch chain {
    15  	case flow.Mainnet, flow.Testnet, flow.Sandboxnet, flow.Previewnet:
    16  		return 1_000, nil
    17  	case flow.Localnet, flow.Benchnet, flow.BftTestnet, flow.Emulator:
    18  		return 100, nil
    19  	}
    20  	return 0, fmt.Errorf("unkown chain id %s", chain.String())
    21  }