Skip to content
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Changelog for NeoFS Node
- Resending the header after chunks have already been sent in object service `Get` handler (#3833)
- GC deadlock on local object storage shutdown (#3837)
- `owner mismatches signature` for stored objects (#3836)
- SN does not retry resending failed transaction because of insufficient GAS in some cases (#3839)

### Changed
- SN returns unsigned responses to requests with API >= `v2.22` (#3785)
Expand Down
15 changes: 15 additions & 0 deletions pkg/morph/client/notary.go
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,21 @@ func alreadyOnChainError(err error) bool {
return strings.Contains(err.Error(), alreadyOnChainErrorMessage)
}

// Neo-Go VM (as of v0.117.0) can return different variations of GAS problem
// depending on instruction throwing expeception.
// See https://github.com/nspcc-dev/neo-go/issues/4170.
func insufficientAmountOfGasErr(err error) bool {
if err == nil {
return false
}
msg := err.Error()
return strings.Contains(msg, "insufficient amount of gas") ||
strings.Contains(msg, "gas limit exceeded") ||
strings.Contains(msg, "GAS limit exceeded") ||
strings.Contains(msg, "insufficient gas") ||
strings.Contains(msg, "gas limit is exceeded")
}

// CalculateNotaryDepositAmount calculates notary deposit amount
// using the rule:
//
Expand Down
4 changes: 1 addition & 3 deletions pkg/morph/client/static.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"errors"
"fmt"
"strings"
"time"

"github.com/cenkalti/backoff/v4"
Expand Down Expand Up @@ -203,8 +202,7 @@ func (s StaticClient) execWithBackoff(invokeFunc func() error) error {
return backoff.RetryNotify(func() error {
err := invokeFunc()
if err != nil {
if errors.Is(err, neorpc.ErrMempoolCapReached) ||
strings.Contains(err.Error(), "insufficient amount of gas") {
if errors.Is(err, neorpc.ErrMempoolCapReached) || insufficientAmountOfGasErr(err) {
return err
}
return backoff.Permanent(err)
Expand Down
Loading