aboutsummaryrefslogtreecommitdiff
path: root/eth/config.go
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2020-09-16 18:22:08 -0400
committerDeterminant <[email protected]>2020-09-16 18:22:08 -0400
commit3410d2bf702bb3308d7bca611780141dd1311efa (patch)
tree5957ab21463a1a1caa8146c5f36c213a390483e2 /eth/config.go
parentdba1cbd83254b0c8e4e99139f1f9748c38bf1537 (diff)
finish chaning the files
Diffstat (limited to 'eth/config.go')
-rw-r--r--eth/config.go94
1 files changed, 62 insertions, 32 deletions
diff --git a/eth/config.go b/eth/config.go
index 18dbd8e..5354ca1 100644
--- a/eth/config.go
+++ b/eth/config.go
@@ -30,39 +30,58 @@ import (
"github.com/ava-labs/coreth/eth/gasprice"
"github.com/ava-labs/coreth/miner"
"github.com/ava-labs/coreth/params"
- "github.com/ava-labs/go-ethereum/common"
- "github.com/ava-labs/go-ethereum/common/hexutil"
- "github.com/ava-labs/go-ethereum/eth/downloader"
+ "github.com/ethereum/go-ethereum/common"
+ "github.com/ethereum/go-ethereum/common/hexutil"
+ "github.com/ethereum/go-ethereum/eth/downloader"
)
+// DefaultFullGPOConfig contains default gasprice oracle settings for full node.
+var DefaultFullGPOConfig = gasprice.Config{
+ Blocks: 20,
+ Percentile: 60,
+ MaxPrice: gasprice.DefaultMaxPrice,
+}
+
+// DefaultLightGPOConfig contains default gasprice oracle settings for light client.
+var DefaultLightGPOConfig = gasprice.Config{
+ Blocks: 2,
+ Percentile: 60,
+ MaxPrice: gasprice.DefaultMaxPrice,
+}
+
// DefaultConfig contains default settings for use on the Ethereum main net.
var DefaultConfig = Config{
SyncMode: downloader.FastSync,
Ethash: ethash.Config{
- CacheDir: "ethash",
- CachesInMem: 2,
- CachesOnDisk: 3,
- DatasetsInMem: 1,
- DatasetsOnDisk: 2,
+ CacheDir: "ethash",
+ CachesInMem: 2,
+ CachesOnDisk: 3,
+ CachesLockMmap: false,
+ DatasetsInMem: 1,
+ DatasetsOnDisk: 2,
+ DatasetsLockMmap: false,
},
- NetworkId: 1,
- LightPeers: 100,
- UltraLightFraction: 75,
- DatabaseCache: 512,
- TrieCleanCache: 256,
- TrieDirtyCache: 256,
- TrieTimeout: 60 * time.Minute,
+ NetworkId: 1,
+ LightPeers: 100,
+ UltraLightFraction: 75,
+ DatabaseCache: 512,
+ TrieCleanCache: 154,
+ TrieCleanCacheJournal: "triecache",
+ TrieCleanCacheRejournal: 60 * time.Minute,
+ TrieDirtyCache: 256,
+ TrieTimeout: 60 * time.Minute,
+ SnapshotCache: 102,
Miner: miner.Config{
GasFloor: 8000000,
GasCeil: 8000000,
GasPrice: big.NewInt(params.GWei),
Recommit: 3 * time.Second,
},
- TxPool: core.DefaultTxPoolConfig,
- GPO: gasprice.Config{
- Blocks: 20,
- Percentile: 60,
- },
+ TxPool: core.DefaultTxPoolConfig,
+ RPCGasCap: 25000000,
+ GPO: DefaultFullGPOConfig,
+ RPCTxFeeCap: 1, // 1 ether
+
ManualCanonical: false,
}
@@ -98,17 +117,24 @@ type Config struct {
NetworkId uint64 // Network ID to use for selecting peers to connect to
SyncMode downloader.SyncMode
+ // This can be set to list of enrtree:// URLs which will be queried for
+ // for nodes to connect to.
+ DiscoveryURLs []string
+
NoPruning bool // Whether to disable pruning and flush everything to disk
NoPrefetch bool // Whether to disable prefetching and only load state on demand
+ TxLookupLimit uint64 `toml:",omitempty"` // The maximum number of blocks from head whose tx indices are reserved.
+
// Whitelist of required block number -> hash values to accept
Whitelist map[uint64]common.Hash `toml:"-"`
// Light client options
- LightServ int `toml:",omitempty"` // Maximum percentage of time allowed for serving LES requests
- LightIngress int `toml:",omitempty"` // Incoming bandwidth limit for light servers
- LightEgress int `toml:",omitempty"` // Outgoing bandwidth limit for light servers
- LightPeers int `toml:",omitempty"` // Maximum number of LES client peers
+ LightServ int `toml:",omitempty"` // Maximum percentage of time allowed for serving LES requests
+ LightIngress int `toml:",omitempty"` // Incoming bandwidth limit for light servers
+ LightEgress int `toml:",omitempty"` // Outgoing bandwidth limit for light servers
+ LightPeers int `toml:",omitempty"` // Maximum number of LES client peers
+ LightNoPrune bool `toml:",omitempty"` // Whether to disable light chain pruning
// Ultra Light client options
UltraLightServers []string `toml:",omitempty"` // List of trusted ultra light servers
@@ -121,9 +147,12 @@ type Config struct {
DatabaseCache int
DatabaseFreezer string
- TrieCleanCache int
- TrieDirtyCache int
- TrieTimeout time.Duration
+ TrieCleanCache int
+ TrieCleanCacheJournal string `toml:",omitempty"` // Disk journal directory for trie cache to survive node restarts
+ TrieCleanCacheRejournal time.Duration `toml:",omitempty"` // Time interval to regenerate the journal for clean cache
+ TrieDirtyCache int
+ TrieTimeout time.Duration
+ SnapshotCache int
// Mining options
Miner miner.Config
@@ -150,7 +179,11 @@ type Config struct {
EVMInterpreter string
// RPCGasCap is the global gas cap for eth-call variants.
- RPCGasCap *big.Int `toml:",omitempty"`
+ RPCGasCap uint64 `toml:",omitempty"`
+
+ // RPCTxFeeCap is the global transaction fee(price * gaslimit) cap for
+ // send-transction variants. The unit is ether.
+ RPCTxFeeCap float64 `toml:",omitempty"`
// Checkpoint is a hardcoded checkpoint which can be nil.
Checkpoint *params.TrustedCheckpoint `toml:",omitempty"`
@@ -158,9 +191,6 @@ type Config struct {
// CheckpointOracle is the configuration for checkpoint oracle.
CheckpointOracle *params.CheckpointOracleConfig `toml:",omitempty"`
- // Istanbul block override (TODO: remove after the fork)
- OverrideIstanbul *big.Int
-
// Manually select and grow the canonical chain
ManualCanonical bool
}
@@ -191,7 +221,7 @@ func MyDefaultConfig() Config {
ByzantiumBlock: big.NewInt(0),
ConstantinopleBlock: big.NewInt(0),
PetersburgBlock: big.NewInt(0),
- IstanbulBlock: nil,
+ IstanbulBlock: big.NewInt(0),
Ethash: nil,
}
genBalance := big.NewInt(1000000000000000000)