diff options
author | Péter Szilágyi <peterke@gmail.com> | 2019-07-10 01:30:24 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2019-07-10 01:34:42 +0800 |
commit | 213690cdfd8e49940b68210da05e3836005b96b8 (patch) | |
tree | 08225fc3870740c2b12a1802d9d6f55df10fee68 /eth | |
parent | 8c249cb82f713c5c5b5a8160c92da7fe145e799d (diff) | |
download | go-tangerine-213690cdfd8e49940b68210da05e3836005b96b8.tar go-tangerine-213690cdfd8e49940b68210da05e3836005b96b8.tar.gz go-tangerine-213690cdfd8e49940b68210da05e3836005b96b8.tar.bz2 go-tangerine-213690cdfd8e49940b68210da05e3836005b96b8.tar.lz go-tangerine-213690cdfd8e49940b68210da05e3836005b96b8.tar.xz go-tangerine-213690cdfd8e49940b68210da05e3836005b96b8.tar.zst go-tangerine-213690cdfd8e49940b68210da05e3836005b96b8.zip |
cmd, eth, les: fix up ultra light config integration
Diffstat (limited to 'eth')
-rw-r--r-- | eth/config.go | 26 | ||||
-rw-r--r-- | eth/gen_config.go | 35 | ||||
-rw-r--r-- | eth/ulc_config.go | 9 |
3 files changed, 34 insertions, 36 deletions
diff --git a/eth/config.go b/eth/config.go index a5913442d..8568f289a 100644 --- a/eth/config.go +++ b/eth/config.go @@ -43,12 +43,13 @@ var DefaultConfig = Config{ DatasetsInMem: 1, DatasetsOnDisk: 2, }, - NetworkId: 1, - LightPeers: 100, - DatabaseCache: 512, - TrieCleanCache: 256, - TrieDirtyCache: 256, - TrieTimeout: 60 * time.Minute, + NetworkId: 1, + LightPeers: 100, + UltraLightFraction: 75, + DatabaseCache: 512, + TrieCleanCache: 256, + TrieDirtyCache: 256, + TrieTimeout: 60 * time.Minute, Miner: miner.Config{ GasFloor: 8000000, GasCeil: 8000000, @@ -101,14 +102,15 @@ type Config struct { Whitelist map[uint64]common.Hash `toml:"-"` // Light client options - LightServ int `toml:",omitempty"` // Maximum percentage of time allowed for serving LES requests - LightBandwidthIn int `toml:",omitempty"` // Incoming bandwidth limit for light servers - LightBandwidthOut int `toml:",omitempty"` // Outgoing bandwidth limit for light servers - LightPeers int `toml:",omitempty"` // Maximum number of LES client peers - OnlyAnnounce bool // Maximum number of LES client peers + LightServ int `toml:",omitempty"` // Maximum percentage of time allowed for serving LES requests + LightBandwidthIn int `toml:",omitempty"` // Incoming bandwidth limit for light servers + LightBandwidthOut int `toml:",omitempty"` // Outgoing bandwidth limit for light servers + LightPeers int `toml:",omitempty"` // Maximum number of LES client peers // Ultra Light client options - ULC *ULCConfig `toml:",omitempty"` + UltraLightServers []string `toml:",omitempty"` // List of trusted ultra light servers + UltraLightFraction int `toml:",omitempty"` // Percentage of trusted servers to accept an announcement + UltraLightOnlyAnnounce bool `toml:",omitempty"` // Whether to only announce headers, or also serve them // Database options SkipBcVersionCheck bool `toml:"-"` diff --git a/eth/gen_config.go b/eth/gen_config.go index d76499943..f0ffb5a81 100644 --- a/eth/gen_config.go +++ b/eth/gen_config.go @@ -28,10 +28,11 @@ func (c Config) MarshalTOML() (interface{}, error) { LightBandwidthIn int `toml:",omitempty"` LightBandwidthOut int `toml:",omitempty"` LightPeers int `toml:",omitempty"` - OnlyAnnounce bool - ULC *ULCConfig `toml:",omitempty"` - SkipBcVersionCheck bool `toml:"-"` - DatabaseHandles int `toml:"-"` + UltraLightServers []string `toml:",omitempty"` + UltraLightFraction int `toml:",omitempty"` + UltraLightOnlyAnnounce bool `toml:",omitempty"` + SkipBcVersionCheck bool `toml:"-"` + DatabaseHandles int `toml:"-"` DatabaseCache int DatabaseFreezer string TrieCleanCache int @@ -45,7 +46,6 @@ func (c Config) MarshalTOML() (interface{}, error) { DocRoot string `toml:"-"` EWASMInterpreter string EVMInterpreter string - ConstantinopleOverride *big.Int RPCGasCap *big.Int `toml:",omitempty"` Checkpoint *params.TrustedCheckpoint CheckpointOracle *params.CheckpointOracleConfig @@ -61,8 +61,9 @@ func (c Config) MarshalTOML() (interface{}, error) { enc.LightBandwidthIn = c.LightBandwidthIn enc.LightBandwidthOut = c.LightBandwidthOut enc.LightPeers = c.LightPeers - enc.OnlyAnnounce = c.OnlyAnnounce - enc.ULC = c.ULC + enc.UltraLightServers = c.UltraLightServers + enc.UltraLightFraction = c.UltraLightFraction + enc.UltraLightOnlyAnnounce = c.UltraLightOnlyAnnounce enc.SkipBcVersionCheck = c.SkipBcVersionCheck enc.DatabaseHandles = c.DatabaseHandles enc.DatabaseCache = c.DatabaseCache @@ -97,10 +98,11 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { LightBandwidthIn *int `toml:",omitempty"` LightBandwidthOut *int `toml:",omitempty"` LightPeers *int `toml:",omitempty"` - OnlyAnnounce *bool - ULC *ULCConfig `toml:",omitempty"` - SkipBcVersionCheck *bool `toml:"-"` - DatabaseHandles *int `toml:"-"` + UltraLightServers []string `toml:",omitempty"` + UltraLightFraction *int `toml:",omitempty"` + UltraLightOnlyAnnounce *bool `toml:",omitempty"` + SkipBcVersionCheck *bool `toml:"-"` + DatabaseHandles *int `toml:"-"` DatabaseCache *int DatabaseFreezer *string TrieCleanCache *int @@ -152,11 +154,14 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { if dec.LightPeers != nil { c.LightPeers = *dec.LightPeers } - if dec.OnlyAnnounce != nil { - c.OnlyAnnounce = *dec.OnlyAnnounce + if dec.UltraLightServers != nil { + c.UltraLightServers = dec.UltraLightServers } - if dec.ULC != nil { - c.ULC = dec.ULC + if dec.UltraLightFraction != nil { + c.UltraLightFraction = *dec.UltraLightFraction + } + if dec.UltraLightOnlyAnnounce != nil { + c.UltraLightOnlyAnnounce = *dec.UltraLightOnlyAnnounce } if dec.SkipBcVersionCheck != nil { c.SkipBcVersionCheck = *dec.SkipBcVersionCheck diff --git a/eth/ulc_config.go b/eth/ulc_config.go deleted file mode 100644 index effa6da21..000000000 --- a/eth/ulc_config.go +++ /dev/null @@ -1,9 +0,0 @@ -package eth - -const DefaultULCMinTrustedFraction = 75 - -// ULCConfig is a Ultra Light client options. -type ULCConfig struct { - TrustedServers []string `toml:",omitempty"` // A list of trusted servers - MinTrustedFraction int `toml:",omitempty"` // Minimum percentage of connected trusted servers to validate trusted (1-100) -} |