ostracon icon indicating copy to clipboard operation
ostracon copied to clipboard

Custom abci interface to extended Tendermint abci interface

Open ulbqb opened this issue 1 year ago • 4 comments

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.

  • https://github.com/Finschia/ibc-go/pull/18
  • https://github.com/Finschia/finschia-sdk/pull/1062
  • https://github.com/Finschia/wasmd/pull/1

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

  • [x] Not duplicate issue
  • [x] Appropriate labels applied
  • [x] Appropriate contributors tagged
  • [x] Contributor assigned/self-assigned

ulbqb avatar Aug 04 '23 14:08 ulbqb

@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.

tnasu avatar Aug 07 '23 11:08 tnasu

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

Yes.

ulbqb avatar Aug 08 '23 03:08 ulbqb

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:

  • Timing (before BeginBlock? before EndBlock?)
  • Height may be required to send Entropy.

ulbqb avatar Aug 08 '23 03:08 ulbqb

we can also update ResponseCheckTx now.

OK, let's update ResponseCheckTx as well.

ulbqb avatar Aug 09 '23 02:08 ulbqb