From c6c7a967eacb08bb7f760bc8338edb0cea8557e1 Mon Sep 17 00:00:00 2001 From: StefanIliev545 Date: Mon, 20 May 2024 09:45:30 +0300 Subject: [PATCH] Fixes for in mem. --- go/host/enclave/guardian.go | 8 +++++++- go/host/l1/publisher.go | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/go/host/enclave/guardian.go b/go/host/enclave/guardian.go index 23a072cb2d..e1f169af1c 100644 --- a/go/host/enclave/guardian.go +++ b/go/host/enclave/guardian.go @@ -628,7 +628,13 @@ func (g *Guardian) periodicBundleSubmission() { defer g.logger.Info("Stopping bundle submission") // check rollup every l1 block time - bundleSubmissionTicker := time.NewTicker(g.rollupInterval) + + interval := g.rollupInterval + if interval == 0 { + interval = g.blockTime + } + + bundleSubmissionTicker := time.NewTicker(interval) for { select { diff --git a/go/host/l1/publisher.go b/go/host/l1/publisher.go index 5ec7cd933c..9d94e833b9 100644 --- a/go/host/l1/publisher.go +++ b/go/host/l1/publisher.go @@ -100,6 +100,10 @@ func (p *Publisher) Start() error { } func (p *Publisher) GetBundleRangeFromManagementContract() (*big.Int, *big.Int, error) { + if p.mgmtContractLib.IsMock() { + return nil, nil, fmt.Errorf("bundle publishing unavailable for mocked environments") + } + managementCtr, err := ManagementContract.NewManagementContract(*p.mgmtContractLib.GetContractAddr(), p.ethClient.EthClient()) if err != nil { p.logger.Error("Unable to instantiate management contract client")