tendermint / spec

131 stars 56 forks source link

ABCI++ spec. First complete version #366

Closed sergio-mena closed 2 years ago

sergio-mena commented 3 years ago

This PR is addressing (some of) the comments in tendermint/spec#351 The first steps are:

sergio-mena commented 3 years ago

Sketch of items discussed in yesterday's meeting (Attendees: Sergio, Josef; Date: 2021-11-22):

sergio-mena commented 3 years ago

Sketch of items discussed in today's meeting (Attendees: Sergio, Josef; Date: 2021-11-29):

sergio-mena commented 3 years ago

These are my notes from today's meeting with Callum (goal: record decisions made):

sergio-mena commented 2 years ago

Notes from meeting with Callum yesterday (2021-12-01):

sergio-mena commented 2 years ago

Notes from ABCI++ meeting yesterday (2021-12-01, attendees Michael, William, Marko, Josef, Callum, Sergio, John, [anyone I'm forgetting?]):

cmwaters commented 2 years ago

I think another thing worth considering in this document is how blocksync might use the new ABCI calls. So far we've just considered the conditions within the consensus state machine in which the ABCI call needs to happen but I assume we will use these calls also in blocksync (but perhaps just ProcessPropsoal and FinalizeBlock).

cmwaters commented 2 years ago

I also talked to William and Daniel today about how they were handling proto changes in the spec and they said they were doing it in a long-lived branch. I think ABCI++ should follow the same pattern.

sergio-mena commented 2 years ago

@cmwaters , regarding blocksync. I'm adding an AI in my notes to extend the document regarding this aspect.

sergio-mena commented 2 years ago

@cmwaters , as for the branch. I agree with the proposed approach. Moreover, as I mentioned yesterday, I'd propose to go even further: the spec should have the same release branch structure as the Tendermint Go repo (and probably, as you said, the spec versions should match the code's versions for simplicity). E.g., the spec for existing ABCI should still live unmodified in the release (or throttle) branches corresponding to versions that still contain it (and which people may still use), and the new spec for ABCI++ should live in all release branches where ABCI++ is present; and ABCI++ branches should not contain ABCI spec. For the moment, I'll work on the protobufs in the ABCI++ branch in the Go repo (so won't touch those on the spec). Then, when rebasing or merging the ABCI++ branch, I'll "export" any protobuf changes back to the spec repo. Let me know if you have any thoughts on this.

cmwaters commented 2 years ago

For the moment, I'll work on the protobufs in the ABCI++ branch in the Go repo (so won't touch those on the spec). Then, when rebasing or merging the ABCI++ branch, I'll "export" any protobuf changes back to the spec repo.

This makes sense to me considering the ABCI++ branch already contains a set of proto changes

sergio-mena commented 2 years ago

My notes on Monday's meeting with Josef & Dev (2021-12-06) and follow-up conversations with Josef and Callum:

williambanfield commented 2 years ago

Thanks for responding! I left a few comments, but a lot of my previous queries were addressed.

sergio-mena commented 2 years ago

Thanks William. Pushing a small commit to address your latest comments

sergio-mena commented 2 years ago

My notes on the Tendermint Core meeting on 2021-12-09, where core points of ABCI++ design were discussed:

williambanfield commented 2 years ago

My current question on this spec: Are there additional specification questions that need to be answered before implementation can begin? I think that the design for most of this is reasonably clear, with a few minor exceptions like how/if verifyVoteExtension will initially be implemented if the data is not signed over by Tendermint. Given that many of the major technical decisions seem settled, I'm wondering if anything stops us from starting to implement?

sergio-mena commented 2 years ago

My current question on this spec: Are there additional specification questions that need to be answered before implementation can begin? I think that the design for most of this is reasonably clear, with a few minor exceptions like how/if verifyVoteExtension will initially be implemented if the data is not signed over by Tendermint. Given that many of the major technical decisions seem settled, I'm wondering if anything stops us from starting to implement?

There is already an implementation in a long-lived branch. It consists of 5 PRs (4 merged, 1 outstanding) AFAICT. I wanted to dive into those to identify the differences between that implementation and the current spec. But I haven't had the time so far :-( ... maybe this week

williambanfield commented 2 years ago

There is already an implementation in a long-lived branch. It consists of 5 PRs (4 merged, 1 outstanding) AFAICT. I wanted to dive into those to identify the differences between that implementation and the current spec. But I haven't had the time so far :-( ... maybe this week

That definitely makes sense, you've been making a lot of great progress on the spec so it makes sense that you have not dug into all parts of the code. I was more wondering if there were additional pieces of this spec that you felt were blocking us from beginning an implementation? I.e. major unanswered questions or risks that would require us to completely shift after we'd begun? As far as I can tell, we have a few clearly-defined new method calls that we are planning to add to tendermint. These will interact directly with the consensus engine in well specified places. Because of the specificity of the changes, I think we can begin implementing a lot of this without answers to each and every question.

sergio-mena commented 2 years ago

There is already an implementation in a long-lived branch. It consists of 5 PRs (4 merged, 1 outstanding) AFAICT. I wanted to dive into those to identify the differences between that implementation and the current spec. But I haven't had the time so far :-( ... maybe this week

That definitely makes sense, you've been making a lot of great progress on the spec so it makes sense that you have not dug into all parts of the code. I was more wondering if there were additional pieces of this spec that you felt were blocking us from beginning an implementation? I.e. major unanswered questions or risks that would require us to completely shift after we'd begun? As far as I can tell, we have a few clearly-defined new method calls that we are planning to add to tendermint. These will interact directly with the consensus engine in well specified places. Because of the specificity of the changes, I think we can begin implementing a lot of this without answers to each and every question.

I agree with you: I don't see any major uncertainty that would force us to rethink the implementation. The remaining points to figure out in the spec are the TODOs that haven't been deleted yet. An additional question for which I am not sure there's a TODO is how to modify the vote data structures to not break the light client.

sergio-mena commented 2 years ago

Just came up with a regex which should be equivalent to the grammar. However I find the grammar way more readable:

(I((OA*)*OA+N)?|N)((E(R*V?R*)|(R*(CR*V?)?R*))*D)*

I  := InitChain
O  := OfferSnapshot
A  := ApplySnapshotChunk
N  := Info
E  := PrepareProposal
C  := ProcessProposal
V  := ExtendVote
R  := VerifyVoteExtension
D  := FinalizeBlock

Once the grammar is reviewed, I might consider turning this regex into a graph with the corresponding FSA.

github-actions[bot] commented 2 years ago

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

sergio-mena commented 2 years ago

Rebasing the branch to tip of master to get the lint problems fixed...

sergio-mena commented 2 years ago

As agreed during today's ABCI++ biweekly, I just reverted the commit that was addressing https://github.com/tendermint/tendermint/issues/1909 (i.e., adding boolean "need_new_block" in ResponseFinalizeBlock) On Monday morning, I will post the rest of the notes I took during the meeting.

sergio-mena commented 2 years ago

Rebasing the branch again to tip of master...

sergio-mena commented 2 years ago

My notes on the ABCI++ meeting last Friday (2022-01-14), where some points of ABCI++ design were discussed:

mpoke commented 2 years ago

Here are a few comments regarding the spec. In general it looks nice; great job. I’d just add a bit more context and structure. Here is a list with more detailed comments:

Basic concepts and definitions

Application requirements

Tendermint’s expected behavior

Methods