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

blockchain: Remove compression version param. #2547

Merged

Commits on Jan 15, 2021

  1. blockchain: Remove compression version param.

    Over the years it has become increasingly obvious that storing multiple
    versioned formats in the database in an attempt to avoid migrations
    leads to code that is super hard to reason about and for which it is
    also difficult to assert correctness.
    
    This is the case because it results in a combinatorial explosion of
    cases that must be handled.  For example, as soon as you have 3
    versions, you're already up to 8 variants you have to handle properly
    and test, and it only gets exponentially worse with each new version.
    
    Due to this, it is greatly preferred to perform a single migration that
    handles the conversion logic once.  This allows the rest of the code,
    especially in the critical paths, to work solely with the latest version
    and therefore it stays much cleaner, easier to validate for correctness,
    and is generally easier to reason about.
    
    With that in mind, this removes the compression version parameter from
    the functions that deal with serializing and deserializing compressed
    scripts.  Since there is only currently a single version it does not
    require any migrations.
    
    However, since the existing migration code for older versions was
    passing in the old version parameter, new v1 functions have been added
    to the upgrade code to ensure stability there.
    davecgh committed Jan 15, 2021
    Configuration menu
    Copy the full SHA
    fdb4b97 View commit details
    Browse the repository at this point in the history