From 30f2ee25463779aa4702acbbc7633da59d426d30 Mon Sep 17 00:00:00 2001 From: parketh Date: Mon, 12 Aug 2024 09:19:11 +0100 Subject: [PATCH 1/3] chore: test manager fixes --- itest/opstackl2/op_test_manager.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/itest/opstackl2/op_test_manager.go b/itest/opstackl2/op_test_manager.go index 44b565f9..25c81baf 100644 --- a/itest/opstackl2/op_test_manager.go +++ b/itest/opstackl2/op_test_manager.go @@ -10,7 +10,6 @@ import ( defaultlog "log" "os" "path/filepath" - "strings" "testing" "time" @@ -129,7 +128,7 @@ func StartOpL2ConsumerManager(t *testing.T, numOfConsumerFPs uint8) *OpL2Consume L2RPCHost: opL2ConsumerConfig.OPStackL2RPCAddress, BitcoinRPCHost: "rpc.ankr.com/btc", FGContractAddress: opL2ConsumerConfig.OPFinalityGadgetAddress, - BBNChainID: "chain-test", + BBNChainID: e2eutils.ChainID, BBNRPCAddress: opL2ConsumerConfig.RPCAddr, DBFilePath: "data.db", GRPCServerPort: babylonFinalityGadgetRpcPort, @@ -527,11 +526,6 @@ func mockOpL2ConsumerCtrlConfig(nodeDataDir string) *fpcfg.OPStackL2Config { } } -func trimLeadingHttp(s string) string { - t := strings.TrimPrefix(s, "http://") - return strings.TrimPrefix(t, "https://") -} - func (ctm *OpL2ConsumerTestManager) WaitForServicesStart(t *testing.T) { require.Eventually(t, func() bool { params, err := ctm.BBNClient.QueryStakingParams() @@ -841,7 +835,6 @@ func (ctm *OpL2ConsumerTestManager) WaitForBlockFinalized( t.Logf(log.Prefix("failed to query latest finalized block %s"), err.Error()) return false } - require.NoError(t, err) finalizedBlockHeight = latestFinalizedBlock.Height return finalizedBlockHeight >= checkedHeight }, e2eutils.EventuallyWaitTimeOut, 5*ctm.getL2BlockTime()) From 8bf7c18619a70ac694e33766aab4b70e8612e06e Mon Sep 17 00:00:00 2001 From: parketh Date: Mon, 12 Aug 2024 09:19:20 +0100 Subject: [PATCH 2/3] annotate test condition --- itest/opstackl2/op_e2e_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/itest/opstackl2/op_e2e_test.go b/itest/opstackl2/op_e2e_test.go index ec39acca..c15daa7f 100644 --- a/itest/opstackl2/op_e2e_test.go +++ b/itest/opstackl2/op_e2e_test.go @@ -234,7 +234,9 @@ func TestFinalityGadgetServer(t *testing.T) { return false } require.NoError(t, err) - return block.BlockHeight > targetBlockHeight+6 + // check N blocks are processed as finalized + // we pick a small N = 5 here to minimize the test time + return block.BlockHeight > targetBlockHeight+5 }, 40*time.Second, 5*time.Second, "Failed to process blocks") // stop the finality gadget From 94e32d5116bc860ed60372bbd0cd10e8562eb326 Mon Sep 17 00:00:00 2001 From: parketh Date: Mon, 12 Aug 2024 09:36:36 +0100 Subject: [PATCH 3/3] chore: remove unused --- itest/opstackl2/op_test_manager.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/itest/opstackl2/op_test_manager.go b/itest/opstackl2/op_test_manager.go index 25c81baf..e698b9ed 100644 --- a/itest/opstackl2/op_test_manager.go +++ b/itest/opstackl2/op_test_manager.go @@ -7,7 +7,6 @@ import ( "encoding/hex" "encoding/json" "fmt" - defaultlog "log" "os" "path/filepath" "testing" @@ -68,8 +67,6 @@ type OpL2ConsumerTestManager struct { } func StartOpL2ConsumerManager(t *testing.T, numOfConsumerFPs uint8) *OpL2ConsumerTestManager { - defaultlog.SetOutput(os.Stdout) - // Setup base dir and logger testDir, err := e2eutils.BaseDir("fpe2etest") require.NoError(t, err)