From a2d3310c421822763eeabce1223c10dae326123c Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Tue, 3 Feb 2026 16:37:13 +0300 Subject: [PATCH] morph: make client retry if fallback transaction was accepted If complex notary invocation flow failed, retry transaction sending the same way it is done for `ErrMempoolCapReached` problems. Contract storages (and, therefore, GAS payments) may change b/w SN's test invocations and real transaction acceptance tries, and it is normal. In particular, it fixes #3739. Signed-off-by: Pavel Karpy --- CHANGELOG.md | 1 + pkg/morph/client/static.go | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 767226b7ba..4c353151f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,7 @@ Changelog for NeoFS Node - SN sorts shards identically when writing and reading EC parts (#3773) - SN puts EC parts concurrently now (#3777) - Optimized object-to-shard placement (#3794) +- SN retries notary requests if `insufficient amount of gas` error appears (#3739) ### Removed - Deprecated `fschain_autodeploy`, `without_mainnet`, `governance.disable`, `fee.main_chain` and `contracts` IR config options (#3716) diff --git a/pkg/morph/client/static.go b/pkg/morph/client/static.go index 04bc6bcf0f..d4806186ab 100644 --- a/pkg/morph/client/static.go +++ b/pkg/morph/client/static.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "strings" "time" "github.com/cenkalti/backoff/v4" @@ -202,7 +203,8 @@ func (s StaticClient) execWithBackoff(invokeFunc func() error) error { return backoff.RetryNotify(func() error { err := invokeFunc() if err != nil { - if errors.Is(err, neorpc.ErrMempoolCapReached) { + if errors.Is(err, neorpc.ErrMempoolCapReached) || + strings.Contains(err.Error(), "insufficient amount of gas") { return err } return backoff.Permanent(err)