Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

[stable] Missing AuRa backports #7499

Merged
merged 5 commits into from
Jan 8, 2018
Merged

[stable] Missing AuRa backports #7499

merged 5 commits into from
Jan 8, 2018

Commits on Jan 8, 2018

  1. Merge pull request #7368 from paritytech/td-future-blocks

    Wait for future blocks in AuRa
    debris authored and tomusdrw committed Jan 8, 2018
    Configuration menu
    Copy the full SHA
    1350462 View commit details
    Browse the repository at this point in the history
  2. Advance AuRa step as far as we can and prevent invalid blocks. (#7451)

    * Advance AuRa step as far as we can.
    
    * Wait for future blocks.
    tomusdrw committed Jan 8, 2018
    Configuration menu
    Copy the full SHA
    51c9a59 View commit details
    Browse the repository at this point in the history
  3. Problem: AuRa's unsafeties around step duration (#7282)

    Firstly, `Step.duration_remaining` casts it to u32, unnecesarily
    limiting it to 2^32. While theoretically this is "good enough" (at 3
    seconds steps it provides room for a little over 400 years), it is
    still a lossy way to calculate the remaining time until the next step.
    
    Secondly, step duration might be zero, triggering division by zero
    in `Step.calibrate`
    
    Solution: rework the code around the fact that duration is
    typically in single digits and never grows, hence, it can be represented
    by a much narrower range (u16) and this highlights the fact that
    multiplying u64 by u16 will only result in an overflow in even further
    future, at which point we should panic informatively (if anybody's
    still around)
    
    Similarly, panic when it is detected that incrementing the step
    counter wrapped around on the overflow of usize.
    
    As for the division by zero, prevent it by making zero an invalid
    value for step duration. This will make AuRa log the constraint
    mismatch and panic (after all, what purpose would zero step duration
    serve? it makes no sense within the definition of the protocol,
    as finality can only be achieved as per the specification
    if messages are received within the step duration, which would violate
    the speed of light and other physical laws in this case).
    yrashk authored and tomusdrw committed Jan 8, 2018
    Configuration menu
    Copy the full SHA
    028a4f3 View commit details
    Browse the repository at this point in the history
  4. Fix tests.

    tomusdrw committed Jan 8, 2018
    Configuration menu
    Copy the full SHA
    c6ccd98 View commit details
    Browse the repository at this point in the history
  5. detect different node, same-key signing in aura (#7245)

    * detect different node, same-key signing in aura
    
    * reduce scope of warning
    rphmeier authored and tomusdrw committed Jan 8, 2018
    Configuration menu
    Copy the full SHA
    5752912 View commit details
    Browse the repository at this point in the history