forked from cerc-io/laconicd-deprecated
build(deps): bump github.com/ethereum/go-ethereum from 1.10.9 to 1.10.11 (#676)
* build(deps): bump github.com/ethereum/go-ethereum from 1.10.9 to 1.10.10 Bumps [github.com/ethereum/go-ethereum](https://github.com/ethereum/go-ethereum) from 1.10.9 to 1.10.10. - [Release notes](https://github.com/ethereum/go-ethereum/releases) - [Commits](https://github.com/ethereum/go-ethereum/compare/v1.10.9...v1.10.10) --- updated-dependencies: - dependency-name: github.com/ethereum/go-ethereum dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump github.com/ethereum/go-ethereum from 1.10.9 to 1.10.10 Bumps [github.com/ethereum/go-ethereum](https://github.com/ethereum/go-ethereum) from 1.10.9 to 1.10.10. - [Release notes](https://github.com/ethereum/go-ethereum/releases) - [Commits](https://github.com/ethereum/go-ethereum/compare/v1.10.9...v1.10.10) --- updated-dependencies: - dependency-name: github.com/ethereum/go-ethereum dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump github.com/ethereum/go-ethereum from 1.10.9 to 1.10.10 Bumps [github.com/ethereum/go-ethereum](https://github.com/ethereum/go-ethereum) from 1.10.9 to 1.10.10. - [Release notes](https://github.com/ethereum/go-ethereum/releases) - [Commits](https://github.com/ethereum/go-ethereum/compare/v1.10.9...v1.10.10) --- updated-dependencies: - dependency-name: github.com/ethereum/go-ethereum dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * fix * rpc: RLP apis * tx fee cap fix * fix config * fix test Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com>
This commit is contained in:
co-authored by
Federico Kunze
parent
0cab27d529
commit
23a3362475
+28
-12
@@ -4,6 +4,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"path"
|
||||
"time"
|
||||
|
||||
"github.com/spf13/viper"
|
||||
|
||||
@@ -31,6 +32,7 @@ const (
|
||||
|
||||
DefaultFilterCap int32 = 200
|
||||
|
||||
DefaultEVMTimeout = 5 * time.Second
|
||||
// default 1.0 eth
|
||||
DefaultTxFeeCap float64 = 1.0
|
||||
)
|
||||
@@ -64,6 +66,8 @@ type JSONRPCConfig struct {
|
||||
WsAddress string `mapstructure:"ws-address"`
|
||||
// GasCap is the global gas cap for eth-call variants.
|
||||
GasCap uint64 `mapstructure:"gas-cap"`
|
||||
// EVMTimeout is the global timeout for eth-call.
|
||||
EVMTimeout time.Duration `mapstructure:"evm-timeout"`
|
||||
// TxFeeCap is the global tx-fee cap for send transaction
|
||||
TxFeeCap float64 `mapstructure:"txfee-cap"`
|
||||
// FilterCap is the global cap for total number of filters that can be created.
|
||||
@@ -149,12 +153,14 @@ func GetDefaultAPINamespaces() []string {
|
||||
// DefaultJSONRPCConfig returns an EVM config with the JSON-RPC API enabled by default
|
||||
func DefaultJSONRPCConfig() *JSONRPCConfig {
|
||||
return &JSONRPCConfig{
|
||||
Enable: true,
|
||||
API: GetDefaultAPINamespaces(),
|
||||
Address: DefaultJSONRPCAddress,
|
||||
WsAddress: DefaultJSONRPCWsAddress,
|
||||
GasCap: DefaultGasCap,
|
||||
FilterCap: DefaultFilterCap,
|
||||
Enable: true,
|
||||
API: GetDefaultAPINamespaces(),
|
||||
Address: DefaultJSONRPCAddress,
|
||||
WsAddress: DefaultJSONRPCWsAddress,
|
||||
GasCap: DefaultGasCap,
|
||||
EVMTimeout: DefaultEVMTimeout,
|
||||
TxFeeCap: DefaultTxFeeCap,
|
||||
FilterCap: DefaultFilterCap,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,6 +174,14 @@ func (c JSONRPCConfig) Validate() error {
|
||||
return errors.New("JSON-RPC filter-cap cannot be negative")
|
||||
}
|
||||
|
||||
if c.TxFeeCap < 0 {
|
||||
return errors.New("JSON-RPC tx fee cap cannot be negative")
|
||||
}
|
||||
|
||||
if c.EVMTimeout < 0 {
|
||||
return errors.New("JSON-RPC EVM timeout duration cannot be negative")
|
||||
}
|
||||
|
||||
// TODO: validate APIs
|
||||
seenAPIs := make(map[string]bool)
|
||||
for _, api := range c.API {
|
||||
@@ -216,12 +230,14 @@ func GetConfig(v *viper.Viper) Config {
|
||||
Tracer: v.GetString("evm.tracer"),
|
||||
},
|
||||
JSONRPC: JSONRPCConfig{
|
||||
Enable: v.GetBool("json-rpc.enable"),
|
||||
API: v.GetStringSlice("json-rpc.api"),
|
||||
Address: v.GetString("json-rpc.address"),
|
||||
WsAddress: v.GetString("json-rpc.ws-address"),
|
||||
GasCap: v.GetUint64("json-rpc.gas-cap"),
|
||||
FilterCap: v.GetInt32("json-rpc.filter-cap"),
|
||||
Enable: v.GetBool("json-rpc.enable"),
|
||||
API: v.GetStringSlice("json-rpc.api"),
|
||||
Address: v.GetString("json-rpc.address"),
|
||||
WsAddress: v.GetString("json-rpc.ws-address"),
|
||||
GasCap: v.GetUint64("json-rpc.gas-cap"),
|
||||
FilterCap: v.GetInt32("json-rpc.filter-cap"),
|
||||
TxFeeCap: v.GetFloat64("json-rpc.txfee-cap"),
|
||||
EVMTimeout: v.GetDuration("json-rpc.evm-timeout"),
|
||||
},
|
||||
TLS: TLSConfig{
|
||||
CertificatePath: v.GetString("tls.certificate-path"),
|
||||
|
||||
@@ -35,6 +35,12 @@ api = "{{range $index, $elmt := .JSONRPC.API}}{{if $index}},{{$elmt}}{{else}}{{$
|
||||
# GasCap sets a cap on gas that can be used in eth_call/estimateGas (0=infinite). Default: 25,000,000.
|
||||
gas-cap = {{ .JSONRPC.GasCap }}
|
||||
|
||||
# EVMTimeout is the global timeout for eth_call. Default: 5s.
|
||||
evm-timeout = "{{ .JSONRPC.EVMTimeout }}"
|
||||
|
||||
# TxFeeCap is the global tx-fee cap for send transaction. Default: 1eth.
|
||||
txfee-cap = {{ .JSONRPC.TxFeeCap }}
|
||||
|
||||
# FilterCap sets the global cap for total number of filters that can be created
|
||||
filter-cap = {{ .JSONRPC.FilterCap }}
|
||||
|
||||
|
||||
@@ -26,13 +26,14 @@ const (
|
||||
|
||||
// JSON-RPC flags
|
||||
const (
|
||||
JSONRPCEnable = "json-rpc.enable"
|
||||
JSONRPCAPI = "json-rpc.api"
|
||||
JSONRPCAddress = "json-rpc.address"
|
||||
JSONWsAddress = "json-rpc.ws-address"
|
||||
JSONRPCGasCap = "json-rpc.gas-cap"
|
||||
JSONRPCTxFeeCap = "json-rpc.txfee-cap"
|
||||
JSONRPCFilterCap = "json-rpc.filter-cap"
|
||||
JSONRPCEnable = "json-rpc.enable"
|
||||
JSONRPCAPI = "json-rpc.api"
|
||||
JSONRPCAddress = "json-rpc.address"
|
||||
JSONWsAddress = "json-rpc.ws-address"
|
||||
JSONRPCGasCap = "json-rpc.gas-cap"
|
||||
JSONRPCEVMTimeout = "json-rpc.evm-timeout"
|
||||
JSONRPCTxFeeCap = "json-rpc.txfee-cap"
|
||||
JSONRPCFilterCap = "json-rpc.filter-cap"
|
||||
)
|
||||
|
||||
// EVM flags
|
||||
|
||||
@@ -158,6 +158,7 @@ which accepts a path for the resulting pprof file.
|
||||
cmd.Flags().Uint64(srvflags.JSONRPCGasCap, config.DefaultGasCap, "Sets a cap on gas that can be used in eth_call/estimateGas unit is aphoton (0=infinite)")
|
||||
cmd.Flags().Float64(srvflags.JSONRPCTxFeeCap, config.DefaultTxFeeCap, "Sets a cap on transaction fee that can be sent via the RPC APIs (1 = default 1 photon)")
|
||||
cmd.Flags().Int32(srvflags.JSONRPCFilterCap, config.DefaultFilterCap, "Sets the global cap for total number of filters that can be created")
|
||||
cmd.Flags().Duration(srvflags.JSONRPCEVMTimeout, config.DefaultEVMTimeout, "Sets a timeout used for eth_call (0=infinite)")
|
||||
|
||||
cmd.Flags().String(srvflags.EVMTracer, config.DefaultEVMTracer, "the EVM tracer type to collect execution traces from the EVM transaction execution (json|struct|access_list|markdown)")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user