Skip to content

Commit 62bb978

Browse files
authored
revert iip49 (#4638)
1 parent 559575e commit 62bb978

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

action/protocol/context.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ type (
156156
FixRevertSnapshot bool
157157
TimestampedStakingContract bool
158158
PreStateSystemAction bool
159-
MakeUpBlockReward bool
160159
CreatePostActionStates bool
161160
}
162161

@@ -319,7 +318,6 @@ func WithFeatureCtx(ctx context.Context) context.Context {
319318
FixRevertSnapshot: g.IsVanuatu(height),
320319
TimestampedStakingContract: g.IsWake(height),
321320
PreStateSystemAction: !g.IsWake(height),
322-
MakeUpBlockReward: g.IsWake(height),
323321
CreatePostActionStates: g.IsWake(height),
324322
},
325323
)

action/protocol/rewarding/reward.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -429,14 +429,7 @@ func (p *Protocol) calculateTotalRewardAndTip(ctx context.Context, sm protocol.S
429429
blockReward = (&big.Int{}).Set(a.blockReward)
430430
effectiveTip = &big.Int{}
431431
)
432-
if featureCtx.MakeUpBlockReward {
433-
effectiveTip.Set(&blkCtx.AccumulatedTips)
434-
if blkCtx.AccumulatedTips.Cmp(blockReward) >= 0 {
435-
blockReward.SetUint64(0)
436-
} else {
437-
blockReward.Sub(blockReward, &blkCtx.AccumulatedTips)
438-
}
439-
} else if featureCtx.EnableDynamicFeeTx {
432+
if featureCtx.EnableDynamicFeeTx {
440433
if blkCtx.AccumulatedTips.Sign() > 0 {
441434
effectiveTip.Set(&blkCtx.AccumulatedTips)
442435
}

action/protocol/rewarding/reward_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ func TestProtocol_CalculateReward(t *testing.T) {
563563
req := require.New(t)
564564
var (
565565
dardanellesBlockReward = unit.ConvertIotxToRau(8)
566-
wakeBlockReward, _ = big.NewInt(0).SetString("4800000000000000000", 10)
566+
wakeBlockReward, _ = big.NewInt(0).SetString("4000000000000000000", 10)
567567
)
568568
for _, tv := range []struct {
569569
accumuTips *big.Int
@@ -572,8 +572,8 @@ func TestProtocol_CalculateReward(t *testing.T) {
572572
}{
573573
{unit.ConvertIotxToRau(3), false, dardanellesBlockReward, unit.ConvertIotxToRau(11), unit.ConvertIotxToRau(3)},
574574
{unit.ConvertIotxToRau(12), false, dardanellesBlockReward, unit.ConvertIotxToRau(20), unit.ConvertIotxToRau(12)},
575-
{unit.ConvertIotxToRau(3), true, (&big.Int{}).Sub(wakeBlockReward, unit.ConvertIotxToRau(3)), wakeBlockReward, unit.ConvertIotxToRau(3)},
576-
{unit.ConvertIotxToRau(6), true, (&big.Int{}).SetInt64(0), unit.ConvertIotxToRau(6), unit.ConvertIotxToRau(6)},
575+
{unit.ConvertIotxToRau(3), true, wakeBlockReward, big.NewInt(0).Add(unit.ConvertIotxToRau(3), wakeBlockReward), unit.ConvertIotxToRau(3)},
576+
{unit.ConvertIotxToRau(6), true, wakeBlockReward, big.NewInt(0).Add(unit.ConvertIotxToRau(6), wakeBlockReward), unit.ConvertIotxToRau(6)},
577577
} {
578578
testProtocol(t, func(t *testing.T, ctx context.Context, sm protocol.StateManager, p *Protocol) {
579579
// update block reward

0 commit comments

Comments
 (0)