@@ -13,7 +13,9 @@ import (
13
13
"github.com/ethereum/go-ethereum/core/vm"
14
14
"github.com/iotexproject/go-pkgs/hash"
15
15
"github.com/iotexproject/iotex-address/address"
16
+ "github.com/pkg/errors"
16
17
18
+ "github.com/iotexproject/iotex-core/v2/action"
17
19
"github.com/iotexproject/iotex-core/v2/blockchain/genesis"
18
20
"github.com/iotexproject/iotex-core/v2/pkg/log"
19
21
)
@@ -123,6 +125,7 @@ type (
123
125
FixUnproductiveDelegates bool
124
126
CorrectGasRefund bool
125
127
SufficentBalanceGuarantee bool
128
+ TolerateEmptyCandidateName bool
126
129
SkipSystemActionNonce bool
127
130
ValidateSystemAction bool
128
131
AllowCorrectChainIDOnly bool
@@ -280,6 +283,7 @@ func WithFeatureCtx(ctx context.Context) context.Context {
280
283
FixUnproductiveDelegates : g .IsOkhotsk (height ),
281
284
CorrectGasRefund : g .IsOkhotsk (height ),
282
285
SufficentBalanceGuarantee : g .IsOkhotsk (height ),
286
+ TolerateEmptyCandidateName : g .IsOkhotsk (height ) && ! g .IsPalau (height ),
283
287
SkipSystemActionNonce : g .IsPalau (height ),
284
288
ValidateSystemAction : g .IsQuebec (height ),
285
289
AllowCorrectChainIDOnly : g .IsQuebec (height ),
@@ -307,6 +311,13 @@ func WithFeatureCtx(ctx context.Context) context.Context {
307
311
)
308
312
}
309
313
314
+ func (fCtx * FeatureCtx ) Tolerate (err error ) bool {
315
+ if fCtx .TolerateEmptyCandidateName && errors .Cause (err ) == action .ErrInvalidCanName {
316
+ return true
317
+ }
318
+ return false
319
+ }
320
+
310
321
// GetFeatureCtx gets FeatureCtx.
311
322
func GetFeatureCtx (ctx context.Context ) (FeatureCtx , bool ) {
312
323
fc , ok := ctx .Value (featureContextKey {}).(FeatureCtx )
0 commit comments