Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for interval. #1926

Merged
merged 6 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions go/host/enclave/guardian.go
Original file line number Diff line number Diff line change
Expand Up @@ -629,11 +629,12 @@ func (g *Guardian) periodicRollupProduction() {
func (g *Guardian) periodicBundleSubmission() {
defer g.logger.Info("Stopping bundle submission")

// check rollup every l1 block time
interval := g.crossChainInterval
g.logger.Info("Starting cross chain bundle submission", "interval", interval)

interval := g.rollupInterval
if interval == 0 {
interval = g.blockTime
interval = 20 * time.Second
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be a default somewhere?
And the log does not match the value

g.logger.Warn("Cross chain interval not set. Defaulting to 10 seconds")
}

bundleSubmissionTicker := time.NewTicker(interval)
Expand All @@ -652,11 +653,6 @@ func (g *Guardian) periodicBundleSubmission() {
continue
}

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

err = g.sl.L1Publisher().PublishCrossChainBundle(bundle)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this mean you're publishing even if there is nothing to publish?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, it's less than ideal

if err != nil {
g.logger.Error("Unable to publish cross chain bundle", log.ErrKey, err)
Expand Down
4 changes: 0 additions & 4 deletions go/host/l1/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,6 @@ func (p *Publisher) PublishCrossChainBundle(bundle *common.ExtCrossChainBundle)
return nil
}

if len(bundle.CrossChainRootHashes) == 0 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

am I missing something, or will this keep publishing every time?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the guardian loop continues before calling this when empty

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

658
image

return fmt.Errorf("nothing to publish in cross chain bundle")
}

managementCtr, err := ManagementContract.NewManagementContract(*p.mgmtContractLib.GetContractAddr(), p.ethClient.EthClient())
if err != nil {
p.logger.Error("Unable to instantiate management contract client")
Expand Down
Loading