From 60dbd59aa0766b3e6b8de20cf7117123239530dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 19 Jan 2023 19:00:52 +0100 Subject: [PATCH] itests: Default enable Eth rpc --- itests/eth_deploy_test.go | 4 +--- itests/eth_filter_test.go | 2 +- itests/eth_hash_lookup_test.go | 7 ------- itests/eth_transactions_test.go | 6 +++--- itests/fevm_test.go | 7 +++++++ itests/kit/node_opts.go | 13 +++++++++++-- 6 files changed, 23 insertions(+), 16 deletions(-) diff --git a/itests/eth_deploy_test.go b/itests/eth_deploy_test.go index b5f0b647c..7a4860b06 100644 --- a/itests/eth_deploy_test.go +++ b/itests/eth_deploy_test.go @@ -40,9 +40,7 @@ func TestDeployment(t *testing.T) { kit.WithCfgOpt(func(cfg *config.FullNode) error { cfg.ActorEvent.EnableRealTimeFilterAPI = true return nil - }), - kit.EthRPC(), - ) + })) ens.InterconnectAll().BeginMining(blockTime) ctx, cancel := context.WithTimeout(context.Background(), time.Minute) diff --git a/itests/eth_filter_test.go b/itests/eth_filter_test.go index ad2034af6..39431e10f 100644 --- a/itests/eth_filter_test.go +++ b/itests/eth_filter_test.go @@ -204,7 +204,7 @@ func TestEthNewFilterCatchAll(t *testing.T) { kit.QuietMiningLogs() blockTime := 100 * time.Millisecond - client, _, ens := kit.EnsembleMinimal(t, kit.MockProofs(), kit.ThroughRPC(), kit.RealTimeFilterAPI(), kit.EthRPC()) + client, _, ens := kit.EnsembleMinimal(t, kit.MockProofs(), kit.ThroughRPC(), kit.RealTimeFilterAPI()) ens.InterconnectAll().BeginMining(blockTime) ctx, cancel := context.WithTimeout(context.Background(), time.Minute) diff --git a/itests/eth_hash_lookup_test.go b/itests/eth_hash_lookup_test.go index 4fe77b2bc..37d069796 100644 --- a/itests/eth_hash_lookup_test.go +++ b/itests/eth_hash_lookup_test.go @@ -28,7 +28,6 @@ func TestTransactionHashLookup(t *testing.T) { t, kit.MockProofs(), kit.ThroughRPC(), - kit.EthRPC(), ) ens.InterconnectAll().BeginMining(blocktime) @@ -120,7 +119,6 @@ func TestTransactionHashLookupBlsFilecoinMessage(t *testing.T) { t, kit.MockProofs(), kit.ThroughRPC(), - kit.EthRPC(), ) ens.InterconnectAll().BeginMining(blocktime) @@ -190,7 +188,6 @@ func TestTransactionHashLookupSecpFilecoinMessage(t *testing.T) { t, kit.MockProofs(), kit.ThroughRPC(), - kit.EthRPC(), ) ens.InterconnectAll().BeginMining(blocktime) @@ -267,7 +264,6 @@ func TestTransactionHashLookupNonexistentMessage(t *testing.T) { t, kit.MockProofs(), kit.ThroughRPC(), - kit.EthRPC(), ) ens.InterconnectAll().BeginMining(blocktime) @@ -298,7 +294,6 @@ func TestEthGetMessageCidByTransactionHashEthTx(t *testing.T) { t, kit.MockProofs(), kit.ThroughRPC(), - kit.EthRPC(), ) ens.InterconnectAll().BeginMining(blocktime) @@ -395,7 +390,6 @@ func TestEthGetMessageCidByTransactionHashSecp(t *testing.T) { t, kit.MockProofs(), kit.ThroughRPC(), - kit.EthRPC(), ) ens.InterconnectAll().BeginMining(blocktime) @@ -466,7 +460,6 @@ func TestEthGetMessageCidByTransactionHashBLS(t *testing.T) { t, kit.MockProofs(), kit.ThroughRPC(), - kit.EthRPC(), ) ens.InterconnectAll().BeginMining(blocktime) diff --git a/itests/eth_transactions_test.go b/itests/eth_transactions_test.go index 8a86a7c05..0c8f1baa5 100644 --- a/itests/eth_transactions_test.go +++ b/itests/eth_transactions_test.go @@ -21,7 +21,7 @@ import ( func TestValueTransferValidSignature(t *testing.T) { blockTime := 100 * time.Millisecond - client, _, ens := kit.EnsembleMinimal(t, kit.MockProofs(), kit.ThroughRPC(), kit.EthRPC()) + client, _, ens := kit.EnsembleMinimal(t, kit.MockProofs(), kit.ThroughRPC()) ens.InterconnectAll().BeginMining(blockTime) @@ -106,7 +106,7 @@ func TestLegacyTransaction(t *testing.T) { func TestContractDeploymentValidSignature(t *testing.T) { blockTime := 100 * time.Millisecond - client, _, ens := kit.EnsembleMinimal(t, kit.MockProofs(), kit.ThroughRPC(), kit.EthRPC()) + client, _, ens := kit.EnsembleMinimal(t, kit.MockProofs(), kit.ThroughRPC()) ens.InterconnectAll().BeginMining(blockTime) @@ -167,7 +167,7 @@ func TestContractDeploymentValidSignature(t *testing.T) { func TestContractInvocation(t *testing.T) { blockTime := 100 * time.Millisecond - client, _, ens := kit.EnsembleMinimal(t, kit.MockProofs(), kit.ThroughRPC(), kit.EthRPC()) + client, _, ens := kit.EnsembleMinimal(t, kit.MockProofs(), kit.ThroughRPC()) ens.InterconnectAll().BeginMining(blockTime) diff --git a/itests/fevm_test.go b/itests/fevm_test.go index 5872c62e8..9111d1d28 100644 --- a/itests/fevm_test.go +++ b/itests/fevm_test.go @@ -132,3 +132,10 @@ func TestFEVMDelegateCall(t *testing.T) { require.NoError(t, err) require.Equal(t, result, expectedResultActor) } + +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") +} diff --git a/itests/kit/node_opts.go b/itests/kit/node_opts.go index d093bb9c2..8f9b305dd 100644 --- a/itests/kit/node_opts.go +++ b/itests/kit/node_opts.go @@ -58,6 +58,15 @@ var DefaultNodeOpts = nodeOpts{ sectors: DefaultPresealsPerBootstrapMiner, sectorSize: abi.SectorSize(2 << 10), // 2KiB. + cfgOpts: []CfgOption{ + func(cfg *config.FullNode) error { + // test defaults + + cfg.Fevm.EnableEthPRC = true + return nil + }, + }, + workerTasks: []sealtasks.TaskType{sealtasks.TTFetch, sealtasks.TTCommit1, sealtasks.TTFinalize, sealtasks.TTFinalizeUnsealed}, workerStorageOpt: func(store paths.Store) paths.Store { return store }, } @@ -297,9 +306,9 @@ func HistoricFilterAPI(dbpath string) NodeOpt { }) } -func EthRPC() NodeOpt { +func DisableEthRPC() NodeOpt { return WithCfgOpt(func(cfg *config.FullNode) error { - cfg.Fevm.EnableEthPRC = true + cfg.Fevm.EnableEthPRC = false return nil }) }