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

FAB-17911 Ch.Part.API: join system channel #1884

Merged
merged 1 commit into from
Sep 17, 2020
Merged

FAB-17911 Ch.Part.API: join system channel #1884

merged 1 commit into from
Sep 17, 2020

Conversation

tock-ibm
Copy link
Contributor

An orderer without channels joins the system channel.
It must be a member of the system channel cluster as well.

  1. The join-block is saved to the join-block filerepo.
  2. If the join-block.number=0, it is appended to the ledger.
  3. A degenerate ChainSupport is created, holding an inactive.Chain
    within, and set into the chains map and the "systemChannel" field.
    This is done to prevent further invocations to the API from issuing
    conflicting commands, as they will find a system channel there.
  4. Only "List" and "Remove" will be accepted. Transactions sent to the
    system channel will be rejected.
  5. As soon as the Join REST call returns successfully the orderer should
    be restarted.
  6. Upon restart, (boostrapMethod="none") 'Main' will look for a system
    channel join block, and if it finds one, will treat it as a bootstrap block.
  7. Normal boot then resumes, and the orderer will on-board (replicate) the
    system channel and any channel referred by it, just as if we had 
    boostrapMethod="file" with the same block as bootstrap block.
  8. After replication ends, the system channel join block is removed.
  9. The orderer now operates in the "legacy" system channel mode.

Signed-off-by: Yoav Tock tock@il.ibm.com
Change-Id: Ief7511de61eccc876f83157315bca98f9e30397c

Type of change

  • New feature

Related issues

Task: FAB-17911
Epic: FAB-17712

An orderer without channels joins the system channel.
It must be a member of the system channel cluster as well.

1. The join-block is saved to the join-block filerepo.
2. If the join-block.number=0, it is appended to the ledger.
3. A degenerate ChainSupport is created, holding an inactive.Chain
   within, and set into the chains map and the "systemChannel" field.
   This is done to prevent further invocations to the API from issuing
   conflicting commands, as they will find a system channel there.
4. Only "List" and "Remove" will be accepted. Transactions sent to the
   system channel will be rejected.
5. As soon as the Join REST call returns successfully the orderer should
   be restarted.
6. Upon restart, (boostrapMethod="none") 'Main' will look for a system
   channel join block, and if it finds one, will treat it as a bootstrap block.
7. Normal boot then resumes, and the orderer will on-board (replicate) the
   system channel and any channel referred by it, just as if we had 
   boostrapMethod="file" with the same block as bootstrap block.
8. After replication ends, the system channel join block is removed.
9. The orderer now operates in the "legacy" system channel mode.

Signed-off-by: Yoav Tock <tock@il.ibm.com>
Change-Id: Ief7511de61eccc876f83157315bca98f9e30397c
@tock-ibm tock-ibm requested a review from a team as a code owner September 16, 2020 08:42
Copy link
Contributor

@jyellick jyellick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little unsure why we're actually populating the processor on the inactive chain, see comment below, but otherwise looks good to me.

bccsp bccsp.BCCSP,
) (*ChainSupport, error) {
cs := &ChainSupport{ledgerResources: ledgerResources}
cs.Processor = msgprocessor.NewStandardChannel(cs, msgprocessor.CreateStandardChannelFilters(cs, config), bccsp)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have thought this field would be safe to leave uninitialized? What path is the processor for this channel called? If it's in the broadcast/deliver path, perhaps we'd be better off explicitly returning an error of some sort?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is in the broadcast path. The first is "ClasifyHeader" and then "Process*" which will ultimately get to the inactive.Chain which is primed with an informative error message. We'll test that in IT.

@jyellick jyellick merged commit ebfd084 into hyperledger:master Sep 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants