mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
node: hard-code limits for engine API
Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
parent
017ae32fb7
commit
957f1a8ebb
2 changed files with 10 additions and 2 deletions
|
|
@ -36,6 +36,13 @@ const (
|
||||||
DefaultAuthPort = 8551 // Default port for the authenticated apis
|
DefaultAuthPort = 8551 // Default port for the authenticated apis
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
// Engine API batch limits: these are not configurable by users, and should cover the
|
||||||
|
// needs of all CLs.
|
||||||
|
engineAPIBatchItemLimit = 2000
|
||||||
|
engineAPIBatchResponseSizeLimit = 100 * 1000 * 1000
|
||||||
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
DefaultAuthCors = []string{"localhost"} // Default cors domain for the authenticated apis
|
DefaultAuthCors = []string{"localhost"} // Default cors domain for the authenticated apis
|
||||||
DefaultAuthVhosts = []string{"localhost"} // Default virtual hosts for the authenticated apis
|
DefaultAuthVhosts = []string{"localhost"} // Default virtual hosts for the authenticated apis
|
||||||
|
|
|
||||||
|
|
@ -449,9 +449,10 @@ func (n *Node) startRPC() error {
|
||||||
if err := server.setListenAddr(n.config.AuthAddr, port); err != nil {
|
if err := server.setListenAddr(n.config.AuthAddr, port); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// Don't limit the requests to the auth endpoint
|
|
||||||
sharedConfig := rpcEndpointConfig{
|
sharedConfig := rpcEndpointConfig{
|
||||||
jwtSecret: secret,
|
jwtSecret: secret,
|
||||||
|
batchItemLimit: engineAPIBatchItemLimit,
|
||||||
|
batchResponseSizeLimit: engineAPIBatchResponseSizeLimit,
|
||||||
}
|
}
|
||||||
if err := server.enableRPC(allAPIs, httpConfig{
|
if err := server.enableRPC(allAPIs, httpConfig{
|
||||||
CorsAllowedOrigins: DefaultAuthCors,
|
CorsAllowedOrigins: DefaultAuthCors,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue