Skip to content

Commit

Permalink
Fix for linter.
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanIliev545 committed Jun 26, 2024
1 parent e0f0cf8 commit 8ffaa7d
Showing 1 changed file with 0 additions and 50 deletions.
50 changes: 0 additions & 50 deletions go/host/enclave/guardian.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ func (g *Guardian) Start() error {
// Note: after HA work this will need additional check that we are the **active** sequencer enclave
go g.periodicBatchProduction()
go g.periodicRollupProduction()
//go g.periodicBundleSubmission()
}

// subscribe for L1 and P2P data
Expand Down Expand Up @@ -626,55 +625,6 @@ func (g *Guardian) periodicRollupProduction() {
}
}

func (g *Guardian) periodicBundleSubmission() {
defer g.logger.Info("Stopping bundle submission")

interval := g.crossChainInterval
g.logger.Info("Starting cross chain bundle submission", "interval", interval)

bundleSubmissionTicker := time.NewTicker(interval)

fromSequenceNumber := uint64(0)

for {
select {
case <-bundleSubmissionTicker.C:
from, to, err := g.sl.L1Publisher().GetBundleRangeFromManagementContract()
if err != nil {
g.logger.Error("Unable to get bundle range from management contract", log.ErrKey, err)
continue
}

if from.Uint64() > fromSequenceNumber {
fromSequenceNumber = from.Uint64()
}

bundle, err := g.enclaveClient.ExportCrossChainData(context.Background(), fromSequenceNumber, to.Uint64())
if err != nil {
if !errors.Is(err, errutil.ErrCrossChainBundleNoBatches) {
g.logger.Error("Unable to export cross chain bundle from enclave", log.ErrKey, err)
}
continue
}

if len(bundle.CrossChainRootHashes) == 0 {
g.logger.Debug("No cross chain data to submit")
fromSequenceNumber = to.Uint64() + 1
continue
}

err = g.sl.L1Publisher().PublishCrossChainBundle(bundle)
if err != nil {
g.logger.Error("Unable to publish cross chain bundle", log.ErrKey, err)
continue
}
case <-g.hostInterrupter.Done():
bundleSubmissionTicker.Stop()
return
}
}
}

func (g *Guardian) streamEnclaveData() {
defer g.logger.Info("Stopping enclave data stream")
g.logger.Info("Starting L2 update stream from enclave")
Expand Down

0 comments on commit 8ffaa7d

Please sign in to comment.