mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-09 03:01:19 +00:00
7caedbaf27
* Various fixes to get code in line with demo * more fixes
39 lines
1.1 KiB
Go
39 lines
1.1 KiB
Go
// Package params defines important configuration options to be used when instantiating
|
|
// objects within the sharding package. For example, it defines objects such as a
|
|
// Config that will be useful when creating new shard instances.
|
|
package params
|
|
|
|
import (
|
|
"math"
|
|
)
|
|
|
|
// DefaultConfig returns pointer to a Config value with same defaults.
|
|
func DefaultConfig() *Config {
|
|
return &Config{
|
|
CollationSizeLimit: DefaultCollationSizeLimit(),
|
|
SlotDuration: 8.0,
|
|
CycleLength: 64,
|
|
}
|
|
}
|
|
|
|
// DemoConfig for running the system under shorter defaults.
|
|
func DemoConfig() *Config {
|
|
return &Config{
|
|
SlotDuration: 2.0,
|
|
CycleLength: 5,
|
|
}
|
|
}
|
|
|
|
// DefaultCollationSizeLimit is the integer value representing the maximum
|
|
// number of bytes allowed in a given collation.
|
|
func DefaultCollationSizeLimit() int64 {
|
|
return int64(math.Pow(float64(2), float64(20)))
|
|
}
|
|
|
|
// Config contains configs for node to participate in the sharded universe.
|
|
type Config struct {
|
|
CollationSizeLimit int64 // CollationSizeLimit is the maximum size the serialized blobs in a collation can take.
|
|
SlotDuration uint64 // SlotDuration in seconds.
|
|
CycleLength uint64
|
|
}
|