fix: config: Fix eth rpc typo (#10076)

This commit is contained in:
Łukasz Magiera 2023-01-19 21:35:19 +01:00 committed by GitHub
parent 196b41d5f6
commit eaccb571a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 14 additions and 14 deletions

View File

@ -344,11 +344,11 @@
[Fevm] [Fevm]
# EnableEthPRC enables eth_ rpc, and enables storing a mapping of eth transaction hashes to filecoin message Cids. # EnableEthRPC enables eth_ rpc, and enables storing a mapping of eth transaction hashes to filecoin message Cids.
# #
# type: bool # type: bool
# env var: LOTUS_FEVM_ENABLEETHPRC # env var: LOTUS_FEVM_ENABLEETHRPC
#EnableEthPRC = false #EnableEthRPC = false
# EthTxHashMappingLifetimeDays the transaction hash lookup database will delete mappings that have been stored for more than x days # EthTxHashMappingLifetimeDays the transaction hash lookup database will delete mappings that have been stored for more than x days
# Set to 0 to keep all mappings # Set to 0 to keep all mappings

View File

@ -137,5 +137,5 @@ func TestEVMRpcDisable(t *testing.T) {
client, _, _ := kit.EnsembleMinimal(t, kit.MockProofs(), kit.ThroughRPC(), kit.DisableEthRPC()) client, _, _ := kit.EnsembleMinimal(t, kit.MockProofs(), kit.ThroughRPC(), kit.DisableEthRPC())
_, err := client.EthBlockNumber(context.Background()) _, err := client.EthBlockNumber(context.Background())
require.ErrorContains(t, err, "module disabled, enable with Fevm.EnableEthPRC") require.ErrorContains(t, err, "module disabled, enable with Fevm.EnableEthRPC")
} }

View File

@ -62,7 +62,7 @@ var DefaultNodeOpts = nodeOpts{
func(cfg *config.FullNode) error { func(cfg *config.FullNode) error {
// test defaults // test defaults
cfg.Fevm.EnableEthPRC = true cfg.Fevm.EnableEthRPC = true
return nil return nil
}, },
}, },
@ -308,7 +308,7 @@ func HistoricFilterAPI(dbpath string) NodeOpt {
func DisableEthRPC() NodeOpt { func DisableEthRPC() NodeOpt {
return WithCfgOpt(func(cfg *config.FullNode) error { return WithCfgOpt(func(cfg *config.FullNode) error {
cfg.Fevm.EnableEthPRC = false cfg.Fevm.EnableEthRPC = false
return nil return nil
}) })
} }

View File

@ -261,8 +261,8 @@ func ConfigFullNode(c interface{}) Option {
// in lite-mode Eth event api is provided by gateway // in lite-mode Eth event api is provided by gateway
ApplyIf(isFullNode, Override(new(full.EthEventAPI), modules.EthEventAPI(cfg.ActorEvent))), ApplyIf(isFullNode, Override(new(full.EthEventAPI), modules.EthEventAPI(cfg.ActorEvent))),
If(cfg.Fevm.EnableEthPRC, Override(new(full.EthModuleAPI), modules.EthModuleAPI(cfg.Fevm))), If(cfg.Fevm.EnableEthRPC, Override(new(full.EthModuleAPI), modules.EthModuleAPI(cfg.Fevm))),
If(!cfg.Fevm.EnableEthPRC, Override(new(full.EthModuleAPI), &full.EthModuleDummy{})), If(!cfg.Fevm.EnableEthRPC, Override(new(full.EthModuleAPI), &full.EthModuleDummy{})),
) )
} }

View File

@ -108,7 +108,7 @@ func DefaultFullNode() *FullNode {
MaxFilterHeightRange: 2880, // conservative limit of one day MaxFilterHeightRange: 2880, // conservative limit of one day
}, },
Fevm: FevmConfig{ Fevm: FevmConfig{
EnableEthPRC: false, EnableEthRPC: false,
EthTxHashMappingLifetimeDays: 0, EthTxHashMappingLifetimeDays: 0,
}, },
} }

View File

@ -401,10 +401,10 @@ see https://lotus.filecoin.io/storage-providers/advanced-configurations/market/#
}, },
"FevmConfig": []DocField{ "FevmConfig": []DocField{
{ {
Name: "EnableEthPRC", Name: "EnableEthRPC",
Type: "bool", Type: "bool",
Comment: `EnableEthPRC enables eth_ rpc, and enables storing a mapping of eth transaction hashes to filecoin message Cids.`, Comment: `EnableEthRPC enables eth_ rpc, and enables storing a mapping of eth transaction hashes to filecoin message Cids.`,
}, },
{ {
Name: "EthTxHashMappingLifetimeDays", Name: "EthTxHashMappingLifetimeDays",

View File

@ -695,8 +695,8 @@ type ActorEventConfig struct {
} }
type FevmConfig struct { type FevmConfig struct {
// EnableEthPRC enables eth_ rpc, and enables storing a mapping of eth transaction hashes to filecoin message Cids. // EnableEthRPC enables eth_ rpc, and enables storing a mapping of eth transaction hashes to filecoin message Cids.
EnableEthPRC bool EnableEthRPC bool
// EthTxHashMappingLifetimeDays the transaction hash lookup database will delete mappings that have been stored for more than x days // EthTxHashMappingLifetimeDays the transaction hash lookup database will delete mappings that have been stored for more than x days
// Set to 0 to keep all mappings // Set to 0 to keep all mappings

View File

@ -10,7 +10,7 @@ import (
"github.com/filecoin-project/lotus/chain/types/ethtypes" "github.com/filecoin-project/lotus/chain/types/ethtypes"
) )
var ErrModuleDisabled = errors.New("module disabled, enable with Fevm.EnableEthPRC / LOTUS_FEVM_ENABLEETHPRC") var ErrModuleDisabled = errors.New("module disabled, enable with Fevm.EnableEthRPC / LOTUS_FEVM_ENABLEETHPRC")
type EthModuleDummy struct{} type EthModuleDummy struct{}