ethereum / casper

Casper contract, and related software and tests
The Unlicense
687 stars 175 forks source link

deposit_scale_factor might be zero #8

Open pirapira opened 7 years ago

pirapira commented 7 years ago

In initialize_epoch, new deposit_scale_factor is computed as:

    self.consensus_messages[epoch].deposit_scale_factor = something * (1 - 2 * base_coeff)

This can be zero because base_coeff can be 0.5:

    base_coeff = 1.0 / sqrt * (self.reward_at_1m_eth / 1000)

when sqrt happens to be 160.

This seems like a problem because sometimes deposit_scale_factor divides some other scaling factors.

krtschmr commented 7 years ago

nice catch

vbuterin commented 7 years ago

Perhaps to solve this cleanly, we just do something like resize_factor = min(resize_factor, 0.9)?

pirapira commented 7 years ago

I need to draw graphs to figure out what's going on.