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: improve error handling in updater command #59

Merged
merged 2 commits into from
Feb 20, 2025

Conversation

adriantpaez
Copy link
Contributor

We're running the rewards updater as a Kubernetes CronJob. We had the following issue in the last run:

{"level":"info","time":"2025-02-19T17:00:20Z","message":"EstimateGasPriceAndLimitAndSendTx: sending txn (submitRoot) with gasTipCap=1000000 gasFeeCap=1030088 gasLimit=108042"}
{"level":"error","ts":1739984432.8322456,"caller":"updater/updater.go:83","msg":"Failed to submit root","error":"Failed to estimate gas: EstimateGasPriceAndLimitAndSendTx: failed to send txn (submitRoot): 504 Gateway Timeout"}
{"level":"info","ts":1739984432.832575,"caller":"cmd/updater.go:60","msg":"Failed to update","error":"Failed to estimate gas: EstimateGasPriceAndLimitAndSendTx: failed to send txn (submitRoot): 504 Gateway Timeout"}

This is an RPC error, but the CronJob's exit code was 0. Our monitoring system, which is configured to notify if the process does not exist successfully, doesn't receive an alert because of this.

I propose to exit with code 1 in this scenario where the TX wasn’t sent instead of 0.

@seanmcgary
Copy link
Member

LGTM

@seanmcgary seanmcgary merged commit e3ea0b1 into Layr-Labs:master Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants