Skip to content

Commit

Permalink
remove isWeb3RewardingAction() check
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinxie committed Apr 10, 2023
1 parent 239a9a3 commit dfd708b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
2 changes: 0 additions & 2 deletions action/protocol/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ type (
FixGasAndNonceUpdate bool
FixUnproductiveDelegates bool
CorrectGasRefund bool
EnableWeb3Rewarding bool
SkipSystemActionNonce bool
}

Expand Down Expand Up @@ -244,7 +243,6 @@ func WithFeatureCtx(ctx context.Context) context.Context {
FixGasAndNonceUpdate: g.IsOkhotsk(height),
FixUnproductiveDelegates: g.IsOkhotsk(height),
CorrectGasRefund: g.IsOkhotsk(height),
EnableWeb3Rewarding: g.IsPalau(height),
SkipSystemActionNonce: g.IsPalau(height),
},
)
Expand Down
21 changes: 1 addition & 20 deletions state/factory/workingset.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"sort"

"github.com/iotexproject/go-pkgs/hash"
"github.com/iotexproject/iotex-proto/golang/iotextypes"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
"go.uber.org/zap"
Expand All @@ -35,8 +34,6 @@ var (
},
[]string{"type"},
)

errUnsupportWeb3Rewarding = errors.New("unsupported web3 rewarding")
)

func init() {
Expand Down Expand Up @@ -148,9 +145,6 @@ func (ws *workingSet) runAction(
if protocol.MustGetBlockCtx(ctx).GasLimit < protocol.MustGetActionCtx(ctx).IntrinsicGas {
return nil, action.ErrGasLimit
}
if !protocol.MustGetFeatureCtx(ctx).EnableWeb3Rewarding && isWeb3RewardingAction(elp) {
return nil, errUnsupportWeb3Rewarding
}
// Reject execution of chainID not equal the node's chainID
if err := validateChainID(ctx, elp.ChainID()); err != nil {
return nil, err
Expand Down Expand Up @@ -481,7 +475,7 @@ func (ws *workingSet) pickAndRunActions(
switch errors.Cause(err) {
case nil:
// do nothing
case action.ErrChainID, errUnsupportWeb3Rewarding:
case action.ErrChainID:
continue
case action.ErrGasLimit:
actionIterator.PopAccount()
Expand Down Expand Up @@ -597,16 +591,3 @@ func (ws *workingSet) CreateBuilder(
SetLogsBloom(calculateLogsBloom(ctx, ws.receipts))
return blkBuilder, nil
}

func isWeb3RewardingAction(selp action.SealedEnvelope) bool {
if selp.Encoding() != uint32(iotextypes.Encoding_ETHEREUM_RLP) {
return false
}
switch selp.Action().(type) {
case *action.ClaimFromRewardingFund,
*action.DepositToRewardingFund:
return true
default:
return false
}
}

0 comments on commit dfd708b

Please sign in to comment.