Skip to content

Commit

Permalink
added new option --use-in-memory-discovery-table (#479)
Browse files Browse the repository at this point in the history
* added new option --use-in-memory-discovery-table

* merge master (#489)

* Adds Prepared Certificates to ensure Istanbul liveness (#366)

* Check message address against signature (#477)

* Check signing validator's address matches msg address

* Add comments about use of sig data in tests

* Try fix Circle build test failures

* Try fix Circle build test failures, take 2
  • Loading branch information
kevjue authored Sep 25, 2019
1 parent aebe778 commit aa1842b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ var (
utils.IstanbulRequestTimeoutFlag,
utils.IstanbulBlockPeriodFlag,
utils.PingIPFromPacketFlag,
utils.UseInMemoryDiscoverTable,
}

rpcFlags = []cli.Flag{
Expand Down
2 changes: 2 additions & 0 deletions cmd/geth/usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ var AppHelpFlagGroups = []flagGroup{
utils.NetrestrictFlag,
utils.NodeKeyFileFlag,
utils.NodeKeyHexFlag,
utils.PingIPFromPacketFlag,
utils.UseInMemoryDiscoverTable,
},
},
{
Expand Down
7 changes: 7 additions & 0 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,10 @@ var (
Name: "ping-ip-from-packet",
Usage: "Has the discovery protocol use the IP address given by a ping packet",
}
UseInMemoryDiscoverTable = cli.BoolFlag{
Name: "use-in-memory-discovery-table",
Usage: "Specifies whether to use an in memory discovery table",
}

// ATM the url is left to the user and deployment to
JSpathFlag = cli.StringFlag{
Expand Down Expand Up @@ -995,6 +999,9 @@ func SetP2PConfig(ctx *cli.Context, cfg *p2p.Config) {
if ctx.GlobalIsSet(PingIPFromPacketFlag.Name) {
cfg.PingIPFromPacket = true
}
if ctx.GlobalIsSet(UseInMemoryDiscoverTable.Name) {
cfg.UseInMemoryNodeDatabase = true
}

// if we're running a light client or server, force enable the v5 peer discovery
// unless it is explicitly disabled with --nodiscover note that explicitly specifying
Expand Down
2 changes: 1 addition & 1 deletion node/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func (c *Config) IPCEndpoint() string {

// NodeDB returns the path to the discovery node database.
func (c *Config) NodeDB() string {
if c.DataDir == "" {
if c.DataDir == "" || c.P2P.UseInMemoryNodeDatabase {
return "" // ephemeral
}
return c.ResolvePath(datadirNodeDatabase)
Expand Down
3 changes: 3 additions & 0 deletions p2p/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ type Config struct {
// live nodes in the network.
NodeDatabase string `toml:",omitempty"`

// UseInMemoryNodeDatabase specifies whether the node database should be in-memory or on-disk
UseInMemoryNodeDatabase bool

// Protocols should contain the protocols supported
// by the server. Matching protocols are launched for
// each peer.
Expand Down

0 comments on commit aa1842b

Please sign in to comment.