diff --git a/prover/prover.go b/prover/prover.go index cce641067..915adba0a 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -132,6 +132,10 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { } p.proverAddress = crypto.PubkeyToAddress(p.cfg.L1ProverPrivKey.PublicKey) + + chBufferSize := p.protocolConfigs.BlockMaxProposals + p.proofGenerationCh = make(chan *proofProducer.ProofWithHeader, chBufferSize) + p.proofWindowExpiredCh = make(chan *bindings.TaikoL1ClientBlockProposed, chBufferSize) p.proveNotify = make(chan struct{}, 1) if err := p.initL1Current(cfg.StartingBlockID); err != nil { @@ -439,7 +443,6 @@ func (p *Prover) eventLoop() { blockVerifiedSub := rpc.SubscribeBlockVerified(p.rpc.TaikoL1, blockVerifiedCh) transitionProvedSub := rpc.SubscribeTransitionProved(p.rpc.TaikoL1, transitionProvedCh) transitionContestedSub := rpc.SubscribeTransitionContested(p.rpc.TaikoL1, transitionContestedCh) - defer func() { blockProposedSub.Unsubscribe() blockVerifiedSub.Unsubscribe() diff --git a/prover/prover_test.go b/prover/prover_test.go index 9e5c8e419..7ddd89bd7 100644 --- a/prover/prover_test.go +++ b/prover/prover_test.go @@ -385,11 +385,6 @@ func (s *ProverTestSuite) TestProveOp() { s.Equal(header.ParentHash, common.BytesToHash(event.Tran.ParentHash[:])) } -func (s *ProverTestSuite) TestStartSubscription() { - s.NotPanics(s.p.initSubscription) - s.NotPanics(s.p.closeSubscription) -} - func (s *ProverTestSuite) TestSetApprovalAmount() { opts, err := bind.NewKeyedTransactorWithChainID(s.p.proverPrivateKey, s.p.rpc.L1ChainID) s.Nil(err)