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

Only log gas estimation error for assertion creation/confirmation if persistent #733

Merged
merged 1 commit into from
Feb 26, 2025
Merged
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
2 changes: 2 additions & 0 deletions assertions/confirmation.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func (m *Manager) keepTryingAssertionConfirmation(ctx context.Context, assertion
return
}
exceedsMaxMempoolSizeEphemeralErrorHandler := ephemeral.NewEphemeralErrorHandler(10*time.Minute, "posting this transaction will exceed max mempool size", 0)
gasEstimationEphemeralErrorHandler := ephemeral.NewEphemeralErrorHandler(10*time.Minute, "gas estimation errored for tx with hash", 0)
ticker := time.NewTicker(m.times.confInterval)
defer ticker.Stop()
for {
Expand Down Expand Up @@ -98,6 +99,7 @@ func (m *Manager) keepTryingAssertionConfirmation(ctx context.Context, assertion
if !strings.Contains(err.Error(), "PREV_NOT_LATEST_CONFIRMED") {
logLevel := log.Error
logLevel = exceedsMaxMempoolSizeEphemeralErrorHandler.LogLevel(err, logLevel)
logLevel = gasEstimationEphemeralErrorHandler.LogLevel(err, logLevel)

logLevel("Could not confirm assertion", "err", err, "assertionHash", assertionHash.Hash)
errorConfirmingAssertionByTimeCounter.Inc(1)
Expand Down
2 changes: 2 additions & 0 deletions assertions/poster.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func (m *Manager) postAssertionRoutine(ctx context.Context) {
}

exceedsMaxMempoolSizeEphemeralErrorHandler := ephemeral.NewEphemeralErrorHandler(10*time.Minute, "posting this transaction will exceed max mempool size", 0)
gasEstimationEphemeralErrorHandler := ephemeral.NewEphemeralErrorHandler(10*time.Minute, "gas estimation errored for tx with hash", 0)

log.Info("Ready to post")
ticker := time.NewTicker(m.times.postInterval)
Expand All @@ -51,6 +52,7 @@ func (m *Manager) postAssertionRoutine(ctx context.Context) {
default:
logLevel := log.Error
logLevel = exceedsMaxMempoolSizeEphemeralErrorHandler.LogLevel(err, logLevel)
logLevel = gasEstimationEphemeralErrorHandler.LogLevel(err, logLevel)

logLevel("Could not submit latest assertion", "err", err, "validatorName", m.validatorName)
errorPostingAssertionCounter.Inc(1)
Expand Down
2 changes: 2 additions & 0 deletions challenge-manager/chain-watcher/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,7 @@ func (w *Watcher) confirmAssertionByChallengeWinner(ctx context.Context, edge pr
)

exceedsMaxMempoolSizeEphemeralErrorHandler := ephemeral.NewEphemeralErrorHandler(10*time.Minute, "posting this transaction will exceed max mempool size", 0)
gasEstimationEphemeralErrorHandler := ephemeral.NewEphemeralErrorHandler(10*time.Minute, "gas estimation errored for tx with hash", 0)

// Compute the number of blocks until we reach the assertion's
// deadline for confirmation.
Expand All @@ -903,6 +904,7 @@ func (w *Watcher) confirmAssertionByChallengeWinner(ctx context.Context, edge pr
if err != nil {
logLevel := log.Error
logLevel = exceedsMaxMempoolSizeEphemeralErrorHandler.LogLevel(err, logLevel)
logLevel = gasEstimationEphemeralErrorHandler.LogLevel(err, logLevel)

logLevel("Could not confirm assertion", "err", err, "assertionHash", claimedAssertion)
errorConfirmingAssertionByWinnerCounter.Inc(1)
Expand Down
Loading