• Joshy Orndorff's avatar
    Rename `ExportGenesisStateCommand` to `ExportGenesisHeadCommand` and make it... · 8683bbee
    Joshy Orndorff authored
    Rename `ExportGenesisStateCommand` to `ExportGenesisHeadCommand` and make it respect custom genesis block builders (#2331)
    
    Closes #2326.
    
    This PR both fixes a logic bug and replaces an incorrect name.
    
    ## Bug Fix: Respecting custom genesis builder
    
    Prior to this PR the standard logic for creating a genesis block was
    repeated inside of cumulus. This PR removes that duplicated logic, and
    calls into the proper `BuildGenesisBlock` implementation.
    
    One consequence is that if the genesis block has already been
    initialized, it will not be re-created, but rather read from the
    database like it is for other node invocations. So you need to watch out
    for old unpurged data during the development process. Offchain tools may
    need to be updated accordingly. I've already filed
    https://github.com/paritytech/zombienet/issues/1519
    
    
    
    ## Rename: It doesn't export state. It exports head data.
    
    The name export-genesis-state was always wrong, nad it's never too late
    to right a wrong. I've changed the name of the struct to
    `ExportGenesisHeadCommand`.
    
    There is still the question of what to do with individual nodes' public
    CLIs. I have updated the parachain template to a reasonable default that
    preserves compatibility with tools that will expect
    `export-genesis-state` to still work. And I've chosen not to modify the
    public CLIs of any other nodes in the repo. I'll leave it up to their
    individual owners/maintains to decide whether that is appropriate.
    
    ---------
    
    Co-authored-by: default avatarJoshy Orndorff <[email protected]>
    Co-authored-by: default avatarBastian Köcher <[email protected]>
    Co-authored-by: default avatarBastian Köcher <[email protected]>
    8683bbee