Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: config: Fix eth rpc typo #10076

Merged
merged 1 commit into from
Jan 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions documentation/en/default-lotus-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -344,11 +344,11 @@


[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
# env var: LOTUS_FEVM_ENABLEETHPRC
#EnableEthPRC = false
# env var: LOTUS_FEVM_ENABLEETHRPC
#EnableEthRPC = false

# 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
Expand Down
2 changes: 1 addition & 1 deletion itests/fevm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,5 @@ func TestEVMRpcDisable(t *testing.T) {
client, _, _ := kit.EnsembleMinimal(t, kit.MockProofs(), kit.ThroughRPC(), kit.DisableEthRPC())

_, 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")
}
4 changes: 2 additions & 2 deletions itests/kit/node_opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ var DefaultNodeOpts = nodeOpts{
func(cfg *config.FullNode) error {
// test defaults

cfg.Fevm.EnableEthPRC = true
cfg.Fevm.EnableEthRPC = true
return nil
},
},
Expand Down Expand Up @@ -308,7 +308,7 @@ func HistoricFilterAPI(dbpath string) NodeOpt {

func DisableEthRPC() NodeOpt {
return WithCfgOpt(func(cfg *config.FullNode) error {
cfg.Fevm.EnableEthPRC = false
cfg.Fevm.EnableEthRPC = false
return nil
})
}
4 changes: 2 additions & 2 deletions node/builder_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ func ConfigFullNode(c interface{}) Option {
// in lite-mode Eth event api is provided by gateway
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.EnableEthPRC, Override(new(full.EthModuleAPI), &full.EthModuleDummy{})),
If(cfg.Fevm.EnableEthRPC, Override(new(full.EthModuleAPI), modules.EthModuleAPI(cfg.Fevm))),
If(!cfg.Fevm.EnableEthRPC, Override(new(full.EthModuleAPI), &full.EthModuleDummy{})),
)
}

Expand Down
2 changes: 1 addition & 1 deletion node/config/def.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func DefaultFullNode() *FullNode {
MaxFilterHeightRange: 2880, // conservative limit of one day
},
Fevm: FevmConfig{
EnableEthPRC: false,
EnableEthRPC: false,
EthTxHashMappingLifetimeDays: 0,
},
}
Expand Down
4 changes: 2 additions & 2 deletions node/config/doc_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions node/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -695,8 +695,8 @@ type ActorEventConfig struct {
}

type FevmConfig struct {
// EnableEthPRC enables eth_ rpc, and enables storing a mapping of eth transaction hashes to filecoin message Cids.
EnableEthPRC bool
// EnableEthRPC enables eth_ rpc, and enables storing a mapping of eth transaction hashes to filecoin message Cids.
EnableEthRPC bool

// 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
Expand Down
2 changes: 1 addition & 1 deletion node/impl/full/dummy.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"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{}

Expand Down