Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 4 additions & 1 deletion bold/assertions/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,10 @@ func (m *Manager) findCanonicalAssertionBranch(
return false, err
}
return expectedState.Equals(protocol.GoExecutionStateFromSolidity(assertion.AfterState)), nil
}, func(rc *retry.RetryConfig) { rc.LevelWarningError = "could not check if we have result at count" })
}, func(rc *retry.RetryConfig) {
rc.LevelWarningError = "could not check if we have result at count"
rc.LevelInfoError = l2stateprovider.ErrChainCatchingUp.Error()
})
if err != nil {
return errors.New("could not check for assertion agreements")
}
Expand Down
4 changes: 4 additions & 0 deletions bold/runtime/retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ var (
type RetryConfig struct {
sleepTime time.Duration
LevelWarningError string // can be extended to a list or regex if demanded in future, currently supporting for one error
LevelInfoError string // can be extended to a list or regex if demanded in future, currently supporting for one error
}

type Opt func(*RetryConfig)
Expand Down Expand Up @@ -63,6 +64,9 @@ func UntilSucceedsMultipleReturnValue[T, U any](ctx context.Context, fn func() (
if cfg.LevelWarningError != "" && strings.Contains(err.Error(), cfg.LevelWarningError) {
logLevel = log.Warn
}
if cfg.LevelInfoError != "" && strings.Contains(err.Error(), cfg.LevelInfoError) {
logLevel = log.Info
}
logLevel("Could not succeed function after retries",
"retryCount", count,
"err", err,
Expand Down
Loading