Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gracefully handle decoding more summaries than statically known eras #2818

Merged
merged 1 commit into from
Dec 15, 2020

Commits on Dec 15, 2020

  1. Gracefully handle decoding more summaries than statically known eras

    Old wallets (or other clients) that are only aware of Byron and Shelley should
    be able to communicate with nodes until the hard fork to Allegra actually takes
    place. At that moment, they will stop functioning as they don't know about
    Allegra. The `NodeToClient` versioning mechanism takes care of this.
    
    However, we have noticed that when the update proposal for Allegra becomes
    stable, the old clients' `Summary` decoder starts to fail with:
    
        Summary: expected between 1 and 2 eras but got 3
    
    This is because after the update proposal for Allegra has become stable, the
    node (which is compatible with Allegra) will extend its `Summary` with an
    `EraSummary` of the Allegra era. The `Summary` decoder of the old client does
    not support more `EraSummary`s (3) than eras it is aware of (2) and fails. This
    is /before/ the hard fork has actually happened. While the window between this
    and the actual hard fork, at which point the old client would stop functioning
    anyway, is small, it would still be nicer if this were handled gracefully.
    
    So instead of failing when we receive more `EraSummary`s than eras we statically
    are aware of, we ignore them. For example, a client that thinks Shelley is the
    final era will ignore the `EraSummary` of Allegra (and Mary) and will keep
    acting as if Shelley is the final era. Of course, when the hard fork to the next
    era actually happens, the client will stop functioning as before.
    
    Note that this fix is too late for the upcoming Allegra hard fork: only clients
    that haven't been upgraded to the last release will run into this problem.
    Upgrading them to the next release that includes this fix already makes the
    problem go away, as they will gain support for Allegra (and Mary).
    
    This fix will thus only help the next time, i.e., when clients are running a
    version that supports Allegra and Mary (and includes this fix) but not the era
    after that, i.e., Alonzo, and the update proposal to Alonzo has become stable.
    mrBliss committed Dec 15, 2020
    Configuration menu
    Copy the full SHA
    09f6f7f View commit details
    Browse the repository at this point in the history