diff --git a/action/protocol/context.go b/action/protocol/context.go index 413d3aae0a..26c1bb0eba 100644 --- a/action/protocol/context.go +++ b/action/protocol/context.go @@ -118,8 +118,8 @@ type ( SharedGasWithDapp bool CandidateRegisterMustWithStake bool DisableDelegateEndorsement bool - SuicideTxLogMismatchPanic bool RefactorFreshAccountConversion bool + SuicideTxLogMismatchPanic bool } // FeatureWithHeightCtx provides feature check functions. @@ -261,10 +261,10 @@ func WithFeatureCtx(ctx context.Context) context.Context { ExecutionSizeLimit32KB: !g.IsSumatra(height), UseZeroNonceForFreshAccount: g.IsSumatra(height), SharedGasWithDapp: g.IsToBeEnabled(height), - CandidateRegisterMustWithStake: !g.IsToBeEnabled(height), - DisableDelegateEndorsement: !g.IsToBeEnabled(height), + CandidateRegisterMustWithStake: !g.IsTsunami(height), + DisableDelegateEndorsement: !g.IsTsunami(height), + RefactorFreshAccountConversion: g.IsTsunami(height), SuicideTxLogMismatchPanic: g.IsToBeEnabled(height), - RefactorFreshAccountConversion: g.IsToBeEnabled(height), }, ) } diff --git a/action/protocol/staking/handler_candidate_endorsement_test.go b/action/protocol/staking/handler_candidate_endorsement_test.go index 191469851b..7320bfd5df 100644 --- a/action/protocol/staking/handler_candidate_endorsement_test.go +++ b/action/protocol/staking/handler_candidate_endorsement_test.go @@ -510,7 +510,7 @@ func TestProtocol_HandleCandidateEndorsement(t *testing.T) { GasLimit: test.blkGasLimit, }) cfg := deepcopy.Copy(genesis.Default).(genesis.Genesis) - cfg.ToBeEnabledBlockHeight = 1 + cfg.TsunamiBlockHeight = 1 ctx = genesis.WithGenesisContext(ctx, cfg) ctx = protocol.WithFeatureCtx(protocol.WithFeatureWithHeightCtx(ctx)) require.Equal(test.err, errors.Cause(p.Validate(ctx, act, sm))) diff --git a/action/protocol/staking/handler_candidate_selfstake_test.go b/action/protocol/staking/handler_candidate_selfstake_test.go index 66fdea7157..a9765bedb7 100644 --- a/action/protocol/staking/handler_candidate_selfstake_test.go +++ b/action/protocol/staking/handler_candidate_selfstake_test.go @@ -145,7 +145,7 @@ func initTestStateWithHeight(t *testing.T, ctrl *gomock.Controller, bucketCfgs [ candidates = append(candidates, cand) } cfg := deepcopy.Copy(genesis.Default).(genesis.Genesis) - cfg.ToBeEnabledBlockHeight = 1 + cfg.TsunamiBlockHeight = 1 ctx := genesis.WithGenesisContext(context.Background(), cfg) ctx = protocol.WithFeatureWithHeightCtx(ctx) v, err := p.Start(ctx, sm) @@ -432,7 +432,7 @@ func TestProtocol_HandleCandidateSelfStake(t *testing.T) { GasLimit: test.blkGasLimit, }) cfg := deepcopy.Copy(genesis.Default).(genesis.Genesis) - cfg.ToBeEnabledBlockHeight = 1 + cfg.TsunamiBlockHeight = 1 ctx = genesis.WithGenesisContext(ctx, cfg) ctx = protocol.WithFeatureCtx(protocol.WithFeatureWithHeightCtx(ctx)) require.Equal(test.err, errors.Cause(p.Validate(ctx, act, sm))) diff --git a/action/protocol/staking/handlers_test.go b/action/protocol/staking/handlers_test.go index 255226a5b9..d31efdc49b 100644 --- a/action/protocol/staking/handlers_test.go +++ b/action/protocol/staking/handlers_test.go @@ -577,7 +577,7 @@ func TestProtocol_HandleCandidateRegister(t *testing.T) { GasLimit: test.blkGasLimit, }) g := deepcopy.Copy(genesis.Default).(genesis.Genesis) - g.ToBeEnabledBlockHeight = 0 + g.TsunamiBlockHeight = 0 ctx = genesis.WithGenesisContext(ctx, g) ctx = protocol.WithFeatureCtx(protocol.WithFeatureWithHeightCtx(ctx)) require.Equal(test.err, errors.Cause(p.Validate(ctx, act, sm))) @@ -1752,7 +1752,7 @@ func TestProtocol_HandleChangeCandidate_ClearPrevCandidateSelfStake(t *testing.T r.NoError(err) ctx := context.Background() g := deepcopy.Copy(genesis.Default).(genesis.Genesis) - g.ToBeEnabledBlockHeight = 0 + g.TsunamiBlockHeight = 0 ctx = genesis.WithGenesisContext(ctx, g) ctx = protocol.WithActionCtx(ctx, protocol.ActionCtx{ Caller: identityset.Address(5), @@ -1796,7 +1796,7 @@ func TestProtocol_HandleChangeCandidate_ClearPrevCandidateSelfStake(t *testing.T r.NoError(err) ctx := context.Background() g := deepcopy.Copy(genesis.Default).(genesis.Genesis) - g.ToBeEnabledBlockHeight = 0 + g.TsunamiBlockHeight = 0 ctx = genesis.WithGenesisContext(ctx, g) ctx = protocol.WithActionCtx(ctx, protocol.ActionCtx{ Caller: identityset.Address(1), @@ -1840,7 +1840,7 @@ func TestProtocol_HandleChangeCandidate_ClearPrevCandidateSelfStake(t *testing.T r.NoError(err) ctx := context.Background() g := deepcopy.Copy(genesis.Default).(genesis.Genesis) - g.ToBeEnabledBlockHeight = 0 + g.TsunamiBlockHeight = 0 ctx = genesis.WithGenesisContext(ctx, g) ctx = protocol.WithActionCtx(ctx, protocol.ActionCtx{ Caller: identityset.Address(1), @@ -2892,7 +2892,7 @@ func TestChangeCandidate(t *testing.T) { r.NoError(err) ctx := context.Background() g := deepcopy.Copy(genesis.Default).(genesis.Genesis) - g.ToBeEnabledBlockHeight = 0 + g.TsunamiBlockHeight = 0 ctx = genesis.WithGenesisContext(ctx, g) ctx = protocol.WithActionCtx(ctx, protocol.ActionCtx{ Caller: identityset.Address(1), @@ -2929,7 +2929,7 @@ func TestChangeCandidate(t *testing.T) { r.NoError(err) ctx := context.Background() g := deepcopy.Copy(genesis.Default).(genesis.Genesis) - g.ToBeEnabledBlockHeight = 0 + g.TsunamiBlockHeight = 0 ctx = genesis.WithGenesisContext(ctx, g) ctx = protocol.WithActionCtx(ctx, protocol.ActionCtx{ Caller: identityset.Address(1), @@ -2966,7 +2966,7 @@ func TestChangeCandidate(t *testing.T) { r.NoError(err) ctx := context.Background() g := deepcopy.Copy(genesis.Default).(genesis.Genesis) - g.ToBeEnabledBlockHeight = 0 + g.TsunamiBlockHeight = 0 ctx = genesis.WithGenesisContext(ctx, g) ctx = protocol.WithActionCtx(ctx, protocol.ActionCtx{ Caller: identityset.Address(1), @@ -3000,7 +3000,7 @@ func TestChangeCandidate(t *testing.T) { r.NoError(err) ctx := context.Background() g := deepcopy.Copy(genesis.Default).(genesis.Genesis) - g.ToBeEnabledBlockHeight = 0 + g.TsunamiBlockHeight = 0 ctx = genesis.WithGenesisContext(ctx, g) ctx = protocol.WithActionCtx(ctx, protocol.ActionCtx{ Caller: identityset.Address(1), @@ -3039,7 +3039,7 @@ func TestUnstake(t *testing.T) { r.NoError(err) ctx := context.Background() g := deepcopy.Copy(genesis.Default).(genesis.Genesis) - g.ToBeEnabledBlockHeight = 0 + g.TsunamiBlockHeight = 0 ctx = genesis.WithGenesisContext(ctx, g) ctx = protocol.WithActionCtx(ctx, protocol.ActionCtx{ Caller: identityset.Address(1), @@ -3076,7 +3076,7 @@ func TestUnstake(t *testing.T) { r.NoError(err) ctx := context.Background() g := deepcopy.Copy(genesis.Default).(genesis.Genesis) - g.ToBeEnabledBlockHeight = 0 + g.TsunamiBlockHeight = 0 ctx = genesis.WithGenesisContext(ctx, g) ctx = protocol.WithActionCtx(ctx, protocol.ActionCtx{ Caller: identityset.Address(1), @@ -3113,7 +3113,7 @@ func TestUnstake(t *testing.T) { r.NoError(err) ctx := context.Background() g := deepcopy.Copy(genesis.Default).(genesis.Genesis) - g.ToBeEnabledBlockHeight = 0 + g.TsunamiBlockHeight = 0 ctx = genesis.WithGenesisContext(ctx, g) ctx = protocol.WithActionCtx(ctx, protocol.ActionCtx{ Caller: identityset.Address(1), @@ -3147,7 +3147,7 @@ func TestUnstake(t *testing.T) { r.NoError(err) ctx := context.Background() g := deepcopy.Copy(genesis.Default).(genesis.Genesis) - g.ToBeEnabledBlockHeight = 0 + g.TsunamiBlockHeight = 0 ctx = genesis.WithGenesisContext(ctx, g) ctx = protocol.WithActionCtx(ctx, protocol.ActionCtx{ Caller: identityset.Address(1), diff --git a/dispatcher/dispatcher.go b/dispatcher/dispatcher.go index 19215e16f4..7b0a999e20 100644 --- a/dispatcher/dispatcher.go +++ b/dispatcher/dispatcher.go @@ -220,7 +220,7 @@ func (d *IotxDispatcher) actionHandler() { case a := <-d.actionChan: d.handleActionMsg(a) case <-d.quit: - log.L().Info("action handler is terminated.") + log.L().Debug("action handler is terminated.") return } } diff --git a/e2etest/native_staking_test.go b/e2etest/native_staking_test.go index e47db46b4d..4dfdeca6b1 100644 --- a/e2etest/native_staking_test.go +++ b/e2etest/native_staking_test.go @@ -489,7 +489,7 @@ func TestNativeStaking(t *testing.T) { cfg.Chain.EnableAsyncIndexWrite = false cfg.Genesis.BootstrapCandidates = testInitCands cfg.Genesis.FbkMigrationBlockHeight = 1 - cfg.Genesis.ToBeEnabledBlockHeight = 0 + cfg.Genesis.TsunamiBlockHeight = 0 cfg.Genesis.EndorsementWithdrawWaitingBlocks = 10 t.Run("test native staking", func(t *testing.T) {