rpc: configure gas cap (#457)

* rpc: configure gas cap

* c++

* rm old const

* docs
This commit is contained in:
Federico Kunze Küllmer
2021-08-18 14:11:51 +00:00
committed by GitHub
parent 1b95d06c92
commit 83c838330f
14 changed files with 7104 additions and 7086 deletions
+13 -1
View File
@@ -22,7 +22,19 @@ ethermintd start --json-rpc.enable
ethermintd start --json-rpc.api eth,txpool,personal,net,debug,web3,miner
```
### CORS
## Set a Gas Cap
`eth_call` and `eth_estimateGas` define a global gas cap over rpc for DoS protection. You can override the default gas cap value of 25,000,000 by passing a custom value when starting the node:
```bash
# set gas cap to 85M
ethermintd start --json-rpc.gas-cap 85000000000
# set gas cap to infinite (=0)
ethermintd start --json-rpc.gas-cap 0
```
## CORS
If accessing the RPC from a browser, CORS will need to be enabled with the appropriate domain set. Otherwise, JavaScript calls are limit by the same-origin policy and requests will fail: