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

BFT Block Puller: Allow the orderer to supply a stream of header + signatures (attestations) #4241

Closed
Tracked by #4240
tock-ibm opened this issue May 29, 2023 · 0 comments

Comments

@tock-ibm
Copy link
Contributor

tock-ibm commented May 29, 2023

The SeekInfo message is augmented with type enum SeekContentType and field SeekContentType content_type = 5;, as shown below:

message SeekInfo {
    enum SeekBehavior {
        BLOCK_UNTIL_READY = 0;
        FAIL_IF_NOT_READY = 1;
    }

    enum SeekErrorResponse {
        STRICT = 0;
        BEST_EFFORT = 1;
    }

    // <NEW> SeekContentType indicates what type of content to deliver in response to a request. If BLOCK is specified,
    // the orderer will stream blocks back to the peer. This is the default behavior. If HEADER_WITH_SIG is  specified, the
    // orderer will stream only a the header and the signature(s), and the payload field will be set to nil. This allows
    // the requester to ascertain that the respective signed block exists in the orderer (or cluster of orderers).
    enum SeekContentType {
        BLOCK = 0;
        HEADER_WITH_SIG =1;
    }
    
    SeekPosition start = 1;               // The position to start the deliver from
    SeekPosition stop = 2;                // The position to stop the deliver
    SeekBehavior behavior = 3;            // The behavior when a missing block is encountered
    SeekErrorResponse error_response = 4; // How to respond to errors reported to the deliver service
    SeekContentType content_type = 5;     // <NEW> Defines what type of content to deliver in response to a request
}

Note: the change the protobuf messages is already on the main branch.

When a stream of Header+Signatures is needed from the orderer, the peer (or any other client) will simply set the ContentType in the SeekInfo message to HEADER_WITH_SIG.
In this case, the orderer will simply set the block data to nil.

if seekInfo.ContentType == ab.SeekInfo_HEADER_WITH_SIG {
    block.Data = nil
}

Since a content type of BLOCK is the default value, no modification is needed to clients that currently request a stream of blocks.

@tock-ibm tock-ibm changed the title Allow the orderer to supply a stream of header + signatures (attestations) BFT Block Puller: Allow the orderer to supply a stream of header + signatures (attestations) May 29, 2023
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

No branches or pull requests

1 participant