Skip to content
  • Yoav Tock's avatar
    FAB-13705 refine Bundle.validateNew · 2979b8cc
    Yoav Tock authored
    
    
    This task addresses two issues:
    
    1) In common/multichannel/Bundle.ValidateNew() it is possible
       to identify the system channel using:
           _, isSys := b.ConsortiumsConfig()
       this can be used to refine validateMigrationStep() such that
       it deals more accurately with the migration-state transitions
       on the system vs. standard channels.
    
    2) In addition, prevent user from adding ConsortiumsConfig() to
       standard channels. This will protect multichannel.Registrar
       from blowing up on next initialization. Explanation:
    
       - Looking at the code in multichannel.Registrar, we see that
           _, ok := ledgerResources.ConsortiumsConfig()
       is used to identify the system channel. If two system channels
       are identified, the code panics.
    
       - Now, in Bundle.ValidateNew(), currently there is no mechanism
       to prevent a user (orderer admin) from adding a ConsortiumsConfig()
       to a standard channel. If a user does that,  multichannel.Registrar
       will blow up in the next initialization.
    
    Change-Id: Ia7551cbd27389a9988757af0224abdc0d1bfef5b
    Signed-off-by: default avatarYoav Tock <tock@il.ibm.com>
    2979b8cc