Given the new limits and the current encoding, the actual rate increase limit for durations < 32 blocks is less than 1, so 0. That means we can't have any rate for durations < 32 blocks. I guess it's not a problem, so I'll just update the test to use a larger duration.
No, it's not a problem of having a minimum parking duration.
The code looks good, all tests pass except the following:
Scenario: Park rates are decreased in protocol 2.0 # features/park_rate_change_limits.feature:76
Given a network with nodes "Alice" and "Bob" able to mint # features/step_definitions/common.rb:31
And the network is at protocol 2.0 # features/step_definitions/common.rb:705
And node "Alice" votes for these NuBit park rates: # features/step_definitions/park_rate_change_limits.rb:40
| Duration | Annual percentage rate |
| 6 months | 0.012 % |
| 1 year | 0.012 % |
And node "Alice" finds enough blocks for a park rate vote to become the median # features/step_definitions/park_rate_change_limits.rb:58
When node "Alice" finds 6 blocks received by all other nodes # features/step_definitions/common.rb:233
Then the NuBit park rates should be # features/step_definitions/park_rate_change_limits.rb:111
| Duration | Annual percentage rate |
| 6 months | 0.012 % |
| 1 year | 0.012 % |
expected: "0.012 % on 6 months"
got: "0.0 % on 6 months"
and this
Scenario: Park rates are increased in protocol 2.0 # features/park_rate_change_limits.feature:23
Given a network with nodes "Alice" and "Bob" able to mint # features/step_definitions/common.rb:31
And the network is at protocol 2.0 # features/step_definitions/common.rb:705
And node "Alice" votes for these NuBit park rates: # features/step_definitions/park_rate_change_limits.rb:40
| Duration | Annual percentage rate |
| 6 months | 10 % |
| 1 year | 0.005 % |
And node "Alice" finds enough blocks for a park rate vote to become the median # features/step_definitions/park_rate_change_limits.rb:58
And node "Alice" finds a block received by all other nodes # features/step_definitions/common.rb:233
Then the NuBit park rates should be # features/step_definitions/park_rate_change_limits.rb:111
| Duration | Annual percentage rate |
| 6 months | 0.002 % |
| 1 year | 0.002 % |
expected: "0.002 % on 6 months"
got: "0.0 % on 6 months"
I rebased this PR on top of the current 2.0
The cucumber test "NuBits are parked and unparked in 2.0" is failing. I'll check that.
Given the new limits and the current encoding, the actual rate increase limit for durations < 32 blocks is less than 1, so 0. That means we can't have any rate for durations < 32 blocks. I guess it's not a problem, so I'll just update the test to use a larger duration.
Done.
No, it's not a problem of having a minimum parking duration.
The code looks good, all tests pass except the following:
Scenario: Park rates are decreased in protocol 2.0 # features/park_rate_change_limits.feature:76 Given a network with nodes "Alice" and "Bob" able to mint # features/step_definitions/common.rb:31 And the network is at protocol 2.0 # features/step_definitions/common.rb:705 And node "Alice" votes for these NuBit park rates: # features/step_definitions/park_rate_change_limits.rb:40 | Duration | Annual percentage rate | | 6 months | 0.012 % | | 1 year | 0.012 % | And node "Alice" finds enough blocks for a park rate vote to become the median # features/step_definitions/park_rate_change_limits.rb:58 When node "Alice" finds 6 blocks received by all other nodes # features/step_definitions/common.rb:233 Then the NuBit park rates should be # features/step_definitions/park_rate_change_limits.rb:111 | Duration | Annual percentage rate | | 6 months | 0.012 % | | 1 year | 0.012 % | expected: "0.012 % on 6 months" got: "0.0 % on 6 months"and this
Scenario: Park rates are increased in protocol 2.0 # features/park_rate_change_limits.feature:23 Given a network with nodes "Alice" and "Bob" able to mint # features/step_definitions/common.rb:31 And the network is at protocol 2.0 # features/step_definitions/common.rb:705 And node "Alice" votes for these NuBit park rates: # features/step_definitions/park_rate_change_limits.rb:40 | Duration | Annual percentage rate | | 6 months | 10 % | | 1 year | 0.005 % | And node "Alice" finds enough blocks for a park rate vote to become the median # features/step_definitions/park_rate_change_limits.rb:58 And node "Alice" finds a block received by all other nodes # features/step_definitions/common.rb:233 Then the NuBit park rates should be # features/step_definitions/park_rate_change_limits.rb:111 | Duration | Annual percentage rate | | 6 months | 0.002 % | | 1 year | 0.002 % | expected: "0.002 % on 6 months" got: "0.0 % on 6 months"Tried to rerun those tests with the same results.
Yes it was.
I pushed a new commit to fix them.
Everything looks good, can merge.