diff --git a/action/protocol/context.go b/action/protocol/context.go index 6b8d3cd350..adbe659314 100644 --- a/action/protocol/context.go +++ b/action/protocol/context.go @@ -146,7 +146,6 @@ type ( SufficentBalanceGuarantee bool EnableCancunEVM bool UnfoldContainerBeforeValidate bool - CorrectValidationOrder bool UnstakedButNotClearSelfStakeAmount bool EnableNewTxTypes bool VerifyNotContainerBeforeRun bool @@ -310,7 +309,6 @@ func WithFeatureCtx(ctx context.Context) context.Context { SufficentBalanceGuarantee: g.IsVanuatu(height), EnableCancunEVM: g.IsVanuatu(height), UnfoldContainerBeforeValidate: g.IsVanuatu(height), - CorrectValidationOrder: g.IsVanuatu(height), UnstakedButNotClearSelfStakeAmount: !g.IsVanuatu(height), EnableNewTxTypes: g.IsVanuatu(height), VerifyNotContainerBeforeRun: g.IsVanuatu(height), diff --git a/state/factory/workingset.go b/state/factory/workingset.go index 890ae6d0f4..3dbbbcc0ba 100644 --- a/state/factory/workingset.go +++ b/state/factory/workingset.go @@ -504,10 +504,7 @@ func (ws *workingSet) checkNonceContinuity(ctx context.Context, accountNonceMap } func (ws *workingSet) Process(ctx context.Context, actions []*action.SealedEnvelope) error { - if protocol.MustGetFeatureCtx(ctx).CorrectValidationOrder { - return ws.processWithCorrectOrder(ctx, actions) - } - return ws.process(ctx, actions) + return ws.processWithCorrectOrder(ctx, actions) } func (ws *workingSet) processWithCorrectOrder(ctx context.Context, actions []*action.SealedEnvelope) error { @@ -565,41 +562,6 @@ func (ws *workingSet) processWithCorrectOrder(ctx context.Context, actions []*ac return ws.finalize() } -func (ws *workingSet) process(ctx context.Context, actions []*action.SealedEnvelope) error { - if err := ws.validate(ctx); err != nil { - return err - } - - reg := protocol.MustGetRegistry(ctx) - for _, act := range actions { - ctxWithActionContext, err := withActionCtx(ctx, act) - if err != nil { - return err - } - for _, p := range reg.All() { - if validator, ok := p.(protocol.ActionValidator); ok { - if err := validator.Validate(ctxWithActionContext, act.Envelope, ws); err != nil { - return err - } - } - } - } - for _, p := range reg.All() { - if pp, ok := p.(protocol.PreStatesCreator); ok { - if err := pp.CreatePreStates(ctx, ws); err != nil { - return err - } - } - } - - receipts, err := ws.runActions(ctx, actions) - if err != nil { - return err - } - ws.receipts = receipts - return ws.finalize() -} - func (ws *workingSet) generateSystemActions(ctx context.Context) ([]action.Envelope, error) { reg := protocol.MustGetRegistry(ctx) postSystemActions := []action.Envelope{} @@ -841,13 +803,7 @@ func (ws *workingSet) ValidateBlock(ctx context.Context, blk *block.Block) error return err } } - var err error - if protocol.MustGetFeatureCtx(ctx).CorrectValidationOrder { - err = ws.processWithCorrectOrder(ctx, blk.RunnableActions().Actions()) - } else { - err = ws.process(ctx, blk.RunnableActions().Actions()) - } - if err != nil { + if err := ws.processWithCorrectOrder(ctx, blk.RunnableActions().Actions()); err != nil { log.L().Error("Failed to update state.", zap.Uint64("height", ws.height), zap.Error(err)) return err }