Skip to content

Commit

Permalink
cherry pick from #664
Browse files Browse the repository at this point in the history
  • Loading branch information
pro100skm authored and Liam Lai committed Oct 9, 2024
1 parent d355ad1 commit c08e72f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmd/XDC/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ var (

rpcFlags = []cli.Flag{
utils.RPCEnabledFlag,
utils.RPCGlobalGasCapFlag,
utils.RPCListenAddrFlag,
utils.RPCPortFlag,
utils.RPCHttpWriteTimeoutFlag,
Expand Down
1 change: 1 addition & 0 deletions cmd/XDC/usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ var AppHelpFlagGroups = []flagGroup{
Name: "API AND CONSOLE",
Flags: []cli.Flag{
utils.RPCEnabledFlag,
utils.RPCGlobalGasCapFlag,
utils.RPCListenAddrFlag,
utils.RPCPortFlag,
utils.RPCHttpWriteTimeoutFlag,
Expand Down
11 changes: 10 additions & 1 deletion cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ var (
Usage: "Record information useful for VM and contract debugging",
}
RPCGlobalGasCapFlag = cli.Uint64Flag{
Name: "rpc.gascap",
Name: "rpc-gascap",
Usage: "Sets a cap on gas that can be used in eth_call/estimateGas (0=infinite)",
Value: eth.DefaultConfig.RPCGasCap,
}
Expand Down Expand Up @@ -1171,6 +1171,15 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
if ctx.GlobalIsSet(DocRootFlag.Name) {
cfg.DocRoot = ctx.GlobalString(DocRootFlag.Name)
}
<<<<<<< HEAD
=======
if ctx.GlobalIsSet(RPCGlobalTxFeeCap.Name) {
cfg.RPCTxFeeCap = ctx.GlobalFloat64(RPCGlobalTxFeeCap.Name)
}
if ctx.GlobalIsSet(RPCGlobalGasCapFlag.Name) {
cfg.RPCGasCap = ctx.GlobalUint64(RPCGlobalGasCapFlag.Name)
}
>>>>>>> 22c54206b (add flag rpc-gascap and set RPCGasCap to 50M (#664))
if ctx.GlobalIsSet(ExtraDataFlag.Name) {
cfg.ExtraData = []byte(ctx.GlobalString(ExtraDataFlag.Name))
}
Expand Down
7 changes: 7 additions & 0 deletions eth/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,19 @@ var DefaultConfig = Config{
TrieTimeout: 5 * time.Minute,
GasPrice: big.NewInt(0.25 * params.Shannon),

<<<<<<< HEAD:eth/config.go
TxPool: core.DefaultTxPoolConfig,
RPCGasCap: 25000000,
GPO: gasprice.Config{
Blocks: 20,
Percentile: 60,
},
=======
TxPool: core.DefaultTxPoolConfig,
RPCGasCap: 50000000,
GPO: FullNodeGPO,
RPCTxFeeCap: 1, // 1 ether
>>>>>>> 22c54206b (add flag rpc-gascap and set RPCGasCap to 50M (#664)):eth/ethconfig/config.go
}

func init() {
Expand Down

0 comments on commit c08e72f

Please sign in to comment.