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: clean up spam error logs #23

Merged
merged 9 commits into from
Nov 8, 2024
Merged

fix: clean up spam error logs #23

merged 9 commits into from
Nov 8, 2024

Conversation

nadim-az
Copy link
Contributor

@nadim-az nadim-az commented Nov 8, 2024

No description provided.

@nadim-az nadim-az requested a review from a team as a code owner November 8, 2024 16:59
@nadim-az nadim-az changed the title fix: validate hpl transfer before attempting relay fix: clean up spam error logs Nov 8, 2024
hyperlane/relayer_runner.go Outdated Show resolved Hide resolved
@@ -395,6 +396,11 @@ func (r *OrderSettler) verifyOrderSettlement(ctx context.Context, settlement db.
if settlement.SettlementStatus == dbtypes.SettlementStatusPending {
gasCost, failure, err := destinationBridgeClient.GetTxResult(ctx, settlement.InitiateSettlementTx.String)
if err != nil {
// Check if the error is due to tx not found
if strings.Contains(err.Error(), "tx") && strings.Contains(err.Error(), "not found") && strings.Contains(err.Error(), settlement.InitiateSettlementTx.String) {
// Transaction not yet indexed, we'll check again later
Copy link
Contributor Author

Choose a reason for hiding this comment

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

{"level":"warn","ts":1730925413.9067168,"caller":"ordersettler/ordersettler.go:218","msg":"error verifying order settlement","error":"failed to fetch message received event: error in json rpc client, with http response metadata: (Status: 200 OK, Protocol HTTP/2.0). RPC error -32603 - Internal error: tx (47F32765BE617BAC646C14556D639EB23785FEA6F7A9E2F25C0ADA41C92263F9) not found","orderID":"e39a4116fb7dddae48bcd40b69edaddc190b2ad098a72260db23f96805486c6b","sourceChainID":"42161"}

Copy link
Contributor

Choose a reason for hiding this comment

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

damn so the node is returning a 200 but its actually an error. error string checking is never great but seems like this is probably the easiest solution for now so im good with it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah i couldnt think of a cleaner way to do this

destinationTxHash, destinationChainID, err := r.relayHandler.Relay(ctx, transfer.SourceChainID, transfer.MessageSentTx)
if err != nil {
if errors.Is(err, ErrNotEnoughSignaturesFound) {
// warning already logged in relayer
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is to prevent spam of

{"level":"error","ts":1731035285.0626438,"caller":"hyperlane/relayer_runner.go:88","msg":"error relaying pending hyperlane transfer","error":"getting checkpoint at index 328: expected atleast 3 signatures in multisig signed checkpoint, but got 0","sourceChainID":"osmosis-1","txHash":"9C4EDA7213A3909E7F852B4047BFE74F76CD2477C8C92CA1975DD70B74547F73","stacktrace":"[github.com/skip-mev/go-fast-solver/hyperlane.(*RelayerRunner).Run](http://github.com/skip-mev/go-fast-solver/hyperlane.(*RelayerRunner).Run)\n\t/solver/hyperlane/relayer_runner.go:88\nmain.main.func6\n\t/solver/cmd/solver/main.go:153\[ngolang.org/x/sync/errgroup.(*Group).Go.func1](http://ngolang.org/x/sync/errgroup.(*Group).Go.func1)\n\t/root/.cache/go-build/golang.org/x/[email protected]/errgroup/errgroup.go:78"}

mattac21
mattac21 previously approved these changes Nov 8, 2024
Copy link
Contributor

@mattac21 mattac21 left a comment

Choose a reason for hiding this comment

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

ty for this sir, LGTM

@@ -85,6 +86,36 @@ func (r *RelayerRunner) Run(ctx context.Context) error {

destinationTxHash, destinationChainID, err := r.relayHandler.Relay(ctx, transfer.SourceChainID, transfer.MessageSentTx)
if err != nil {
// Unrecoverable error
Copy link
Contributor Author

Choose a reason for hiding this comment

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

{"level":"error","ts":1731035755.109063,"caller":"hyperlane/relayer_runner.go:88","msg":"error relaying pending hyperlane transfer","error":"processing message on domain 42161: processing message on destination mailbox: execution reverted: !threshold","sourceChainID":"osmosis-1","txHash":"9C4EDA7213A3909E7F852B4047BFE74F76CD2477C8C92CA1975DD70B74547F73","stacktrace":"[github.com/skip-mev/go-fast-solver/hyperlane.(*RelayerRunner).Run](http://github.com/skip-mev/go-fast-solver/hyperlane.(*RelayerRunner).Run)\n\t/solver/hyperlane/relayer_runner.go:88\nmain.main.func6\n\t/solver/cmd/solver/main.go:153\[ngolang.org/x/sync/errgroup.(*Group).Go.func1](http://ngolang.org/x/sync/errgroup.(*Group).Go.func1)\n\t/root/.cache/go-build/golang.org/x/[email protected]/errgroup/errgroup.go:78"}

@nadim-az nadim-az enabled auto-merge (squash) November 8, 2024 20:20
Copy link
Contributor

@dhfang dhfang left a comment

Choose a reason for hiding this comment

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

Thanks Nadim!

zap.Int64("transferId", transfer.ID),
zap.String("txHash", transfer.MessageSentTx),
zap.Error(err),
)

if _, err := r.db.SetMessageStatus(ctx, db.SetMessageStatusParams{
TransferStatus: dbtypes.TransferStatusAbandoned,
Copy link
Contributor

Choose a reason for hiding this comment

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

can you also fill the TransferStatusMessage field here with the revert message? bonus if you also rename this query method to SetTransferStatus

@nadim-az nadim-az merged commit bd1d9d8 into main Nov 8, 2024
3 checks passed
@nadim-az nadim-az deleted the na/cleanup-logs branch November 8, 2024 22:21
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.

3 participants