Finschia / ostracon

Ostracon, a consensus algorithm, is forked from Tendermint Core. We have added VRF to Tendermint BFT. It adds randomness to PoS Validator elections and improves security.
Apache License 2.0
70 stars 28 forks source link

Custom abci interface to extended Tendermint abci interface #688

Open ulbqb opened 11 months ago

ulbqb commented 11 months ago

Protocol Change Proposal

Note This proposal is not breaking change.

Summary

I propose to make current Ostracon ABCI interface extended Tendermint abci interface.

Problem Definition

Many things must be done to leverage the cosmos ecosystem.

This proposal reduces tasks for abci interface diff.

Proposal

I propose following changes.

- message RequestBeginBlock {
-   bytes                          hash                    = 1;
-   tendermint.types.Header        header                  = 2 [(gogoproto.nullable) = false];
-   tendermint.abci.LastCommitInfo last_commit_info        = 3 [(gogoproto.nullable) = false];
-   repeated tendermint.abci.Evidence byzantine_validators = 4 [(gogoproto.nullable) = false];
- 
-   // *** Ostracon Extended Fields ***
-   ostracon.types.Entropy entropy = 1000 [(gogoproto.nullable) = false];
- }

+ message RequestPreBeginBlock {
+   ostracon.types.Entropy entropy = 1 [(gogoproto.nullable) = false];
+ }
+ 
+ message ResponsePreBeginBlock {}

service ABCIApplication {
  rpc Echo(tendermint.abci.RequestEcho) returns (tendermint.abci.ResponseEcho);
  rpc Flush(tendermint.abci.RequestFlush) returns (tendermint.abci.ResponseFlush);
  rpc Info(tendermint.abci.RequestInfo) returns (tendermint.abci.ResponseInfo);
  rpc SetOption(tendermint.abci.RequestSetOption) returns (tendermint.abci.ResponseSetOption);
  rpc DeliverTx(tendermint.abci.RequestDeliverTx) returns (tendermint.abci.ResponseDeliverTx);
  rpc CheckTx(tendermint.abci.RequestCheckTx) returns (ResponseCheckTx);
  rpc Query(tendermint.abci.RequestQuery) returns (tendermint.abci.ResponseQuery);
  rpc Commit(tendermint.abci.RequestCommit) returns (tendermint.abci.ResponseCommit);
  rpc InitChain(tendermint.abci.RequestInitChain) returns (tendermint.abci.ResponseInitChain);
-   rpc BeginBlock(RequestBeginBlock) returns (tendermint.abci.ResponseBeginBlock);
+   rpc PreBeginBlock(PreRequestBeginBlock) returns (PreResponseBeginBlock);
+   rpc BeginBlock(tendermint.abci.RequestBeginBlock) returns (tendermint.abci.ResponseBeginBlock);
  rpc EndBlock(tendermint.abci.RequestEndBlock) returns (tendermint.abci.ResponseEndBlock);
  rpc ListSnapshots(tendermint.abci.RequestListSnapshots) returns (tendermint.abci.ResponseListSnapshots);
  rpc OfferSnapshot(tendermint.abci.RequestOfferSnapshot) returns (tendermint.abci.ResponseOfferSnapshot);
  rpc LoadSnapshotChunk(tendermint.abci.RequestLoadSnapshotChunk) returns (tendermint.abci.ResponseLoadSnapshotChunk);
  rpc ApplySnapshotChunk(tendermint.abci.RequestApplySnapshotChunk) returns (tendermint.abci.ResponseApplySnapshotChunk);
  rpc BeginRecheckTx(RequestBeginRecheckTx) returns (ResponseBeginRecheckTx);
  rpc EndRecheckTx(RequestEndRecheckTx) returns (ResponseEndRecheckTx);
}

This change make current Ostracon interface purely extended Tendermint interface. Entropy is not used anywhere, so it may not be necessary to implement PreBeginBlock. Ostracon ABCI = Tendermint ABCI + PreBeginBlock + BeginRecheckTx + EndRecheckTx


For Admin Use

tnasu commented 11 months ago

@ulbqb Do you mean that our change should only be adding services (and requests/responses) in the ABCI interface? I agree with your proposal since we were taking a lot of time to solve conflicts when we were doing backporting.

NOTE:

rpc CheckTx(tendermint.abci.RequestCheckTx) returns (ResponseCheckTx);

we can also update ResponseCheckTx now.

ulbqb commented 11 months ago

Do you mean that our change should only be adding services (and requests/responses) in the ABCI interface?

Yes.

ulbqb commented 11 months ago

It was decided to just delete Entropy from RequestBeginBlock in a private discussion. Sending Entropy to SDK is pending until It's time to use Entropy.

Also, sending Entropy has following considerations:

ulbqb commented 11 months ago

we can also update ResponseCheckTx now.

OK, let's update ResponseCheckTx as well.