abci: Refactor CheckTx to notify of recheck (#3744)
As per #2127, this refactors the RequestCheckTx ProtoBuf struct to allow for a flag indicating whether a query is a recheck or not (and allows for possible future, more nuanced states).
In order to pass this extended information through to the ABCI app, the proxy.AppConnMempool (and, for consistency, the proxy.AppConnConsensus) interface seems to need to be refactored along with abcicli.Client.
And, as per this comment, I've made the following modification to the protobuf definition for the RequestCheckTx structure:
enum CheckTxType {
New = 0;
Recheck = 1;
}
message RequestCheckTx {
bytes tx = 1;
CheckTxType type = 2;
}
* Refactor ABCI CheckTx to notify of recheck
As per #2127, this refactors the `RequestCheckTx` ProtoBuf struct to allow for:
1. a flag indicating whether a query is a recheck or not (and allows for
possible future, more nuanced states)
2. an `additional_data` bytes array to provide information for those more
nuanced states.
In order to pass this extended information through to the ABCI app, the
`proxy.AppConnMempool` (and, for consistency, the
`proxy.AppConnConsensus`) interface seems to need to be refactored.
Commits:
* Fix linting issue
* Add CHANGELOG_PENDING entry
* Remove extraneous explicit initialization
* Update ABCI spec doc to include new CheckTx params
* Rename method param for consistency
* Rename CheckTxType enum values and remove additional_data param
5 years ago abci: Refactor CheckTx to notify of recheck (#3744)
As per #2127, this refactors the RequestCheckTx ProtoBuf struct to allow for a flag indicating whether a query is a recheck or not (and allows for possible future, more nuanced states).
In order to pass this extended information through to the ABCI app, the proxy.AppConnMempool (and, for consistency, the proxy.AppConnConsensus) interface seems to need to be refactored along with abcicli.Client.
And, as per this comment, I've made the following modification to the protobuf definition for the RequestCheckTx structure:
enum CheckTxType {
New = 0;
Recheck = 1;
}
message RequestCheckTx {
bytes tx = 1;
CheckTxType type = 2;
}
* Refactor ABCI CheckTx to notify of recheck
As per #2127, this refactors the `RequestCheckTx` ProtoBuf struct to allow for:
1. a flag indicating whether a query is a recheck or not (and allows for
possible future, more nuanced states)
2. an `additional_data` bytes array to provide information for those more
nuanced states.
In order to pass this extended information through to the ABCI app, the
`proxy.AppConnMempool` (and, for consistency, the
`proxy.AppConnConsensus`) interface seems to need to be refactored.
Commits:
* Fix linting issue
* Add CHANGELOG_PENDING entry
* Remove extraneous explicit initialization
* Update ABCI spec doc to include new CheckTx params
* Rename method param for consistency
* Rename CheckTxType enum values and remove additional_data param
5 years ago abci: Refactor CheckTx to notify of recheck (#3744)
As per #2127, this refactors the RequestCheckTx ProtoBuf struct to allow for a flag indicating whether a query is a recheck or not (and allows for possible future, more nuanced states).
In order to pass this extended information through to the ABCI app, the proxy.AppConnMempool (and, for consistency, the proxy.AppConnConsensus) interface seems to need to be refactored along with abcicli.Client.
And, as per this comment, I've made the following modification to the protobuf definition for the RequestCheckTx structure:
enum CheckTxType {
New = 0;
Recheck = 1;
}
message RequestCheckTx {
bytes tx = 1;
CheckTxType type = 2;
}
* Refactor ABCI CheckTx to notify of recheck
As per #2127, this refactors the `RequestCheckTx` ProtoBuf struct to allow for:
1. a flag indicating whether a query is a recheck or not (and allows for
possible future, more nuanced states)
2. an `additional_data` bytes array to provide information for those more
nuanced states.
In order to pass this extended information through to the ABCI app, the
`proxy.AppConnMempool` (and, for consistency, the
`proxy.AppConnConsensus`) interface seems to need to be refactored.
Commits:
* Fix linting issue
* Add CHANGELOG_PENDING entry
* Remove extraneous explicit initialization
* Update ABCI spec doc to include new CheckTx params
* Rename method param for consistency
* Rename CheckTxType enum values and remove additional_data param
5 years ago abci: Refactor CheckTx to notify of recheck (#3744)
As per #2127, this refactors the RequestCheckTx ProtoBuf struct to allow for a flag indicating whether a query is a recheck or not (and allows for possible future, more nuanced states).
In order to pass this extended information through to the ABCI app, the proxy.AppConnMempool (and, for consistency, the proxy.AppConnConsensus) interface seems to need to be refactored along with abcicli.Client.
And, as per this comment, I've made the following modification to the protobuf definition for the RequestCheckTx structure:
enum CheckTxType {
New = 0;
Recheck = 1;
}
message RequestCheckTx {
bytes tx = 1;
CheckTxType type = 2;
}
* Refactor ABCI CheckTx to notify of recheck
As per #2127, this refactors the `RequestCheckTx` ProtoBuf struct to allow for:
1. a flag indicating whether a query is a recheck or not (and allows for
possible future, more nuanced states)
2. an `additional_data` bytes array to provide information for those more
nuanced states.
In order to pass this extended information through to the ABCI app, the
`proxy.AppConnMempool` (and, for consistency, the
`proxy.AppConnConsensus`) interface seems to need to be refactored.
Commits:
* Fix linting issue
* Add CHANGELOG_PENDING entry
* Remove extraneous explicit initialization
* Update ABCI spec doc to include new CheckTx params
* Rename method param for consistency
* Rename CheckTxType enum values and remove additional_data param
5 years ago |
|
- package proxy
-
- import (
- abcicli "github.com/tendermint/tendermint/abci/client"
- "github.com/tendermint/tendermint/abci/types"
- )
-
- //go:generate mockery -case underscore -name AppConnConsensus|AppConnMempool|AppConnQuery|AppConnSnapshot
-
- //----------------------------------------------------------------------------------------
- // Enforce which abci msgs can be sent on a connection at the type level
-
- type AppConnConsensus interface {
- SetResponseCallback(abcicli.Callback)
- Error() error
-
- InitChainSync(types.RequestInitChain) (*types.ResponseInitChain, error)
-
- BeginBlockSync(types.RequestBeginBlock) (*types.ResponseBeginBlock, error)
- DeliverTxAsync(types.RequestDeliverTx) *abcicli.ReqRes
- EndBlockSync(types.RequestEndBlock) (*types.ResponseEndBlock, error)
- CommitSync() (*types.ResponseCommit, error)
- }
-
- type AppConnMempool interface {
- SetResponseCallback(abcicli.Callback)
- Error() error
-
- CheckTxAsync(types.RequestCheckTx) *abcicli.ReqRes
- CheckTxSync(types.RequestCheckTx) (*types.ResponseCheckTx, error)
-
- FlushAsync() *abcicli.ReqRes
- FlushSync() error
- }
-
- type AppConnQuery interface {
- Error() error
-
- EchoSync(string) (*types.ResponseEcho, error)
- InfoSync(types.RequestInfo) (*types.ResponseInfo, error)
- QuerySync(types.RequestQuery) (*types.ResponseQuery, error)
-
- // SetOptionSync(key string, value string) (res types.Result)
- }
-
- type AppConnSnapshot interface {
- Error() error
-
- ListSnapshotsSync(types.RequestListSnapshots) (*types.ResponseListSnapshots, error)
- OfferSnapshotSync(types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error)
- LoadSnapshotChunkSync(types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error)
- ApplySnapshotChunkSync(types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error)
- }
-
- //-----------------------------------------------------------------------------------------
- // Implements AppConnConsensus (subset of abcicli.Client)
-
- type appConnConsensus struct {
- appConn abcicli.Client
- }
-
- func NewAppConnConsensus(appConn abcicli.Client) AppConnConsensus {
- return &appConnConsensus{
- appConn: appConn,
- }
- }
-
- func (app *appConnConsensus) SetResponseCallback(cb abcicli.Callback) {
- app.appConn.SetResponseCallback(cb)
- }
-
- func (app *appConnConsensus) Error() error {
- return app.appConn.Error()
- }
-
- func (app *appConnConsensus) InitChainSync(req types.RequestInitChain) (*types.ResponseInitChain, error) {
- return app.appConn.InitChainSync(req)
- }
-
- func (app *appConnConsensus) BeginBlockSync(req types.RequestBeginBlock) (*types.ResponseBeginBlock, error) {
- return app.appConn.BeginBlockSync(req)
- }
-
- func (app *appConnConsensus) DeliverTxAsync(req types.RequestDeliverTx) *abcicli.ReqRes {
- return app.appConn.DeliverTxAsync(req)
- }
-
- func (app *appConnConsensus) EndBlockSync(req types.RequestEndBlock) (*types.ResponseEndBlock, error) {
- return app.appConn.EndBlockSync(req)
- }
-
- func (app *appConnConsensus) CommitSync() (*types.ResponseCommit, error) {
- return app.appConn.CommitSync()
- }
-
- //------------------------------------------------
- // Implements AppConnMempool (subset of abcicli.Client)
-
- type appConnMempool struct {
- appConn abcicli.Client
- }
-
- func NewAppConnMempool(appConn abcicli.Client) AppConnMempool {
- return &appConnMempool{
- appConn: appConn,
- }
- }
-
- func (app *appConnMempool) SetResponseCallback(cb abcicli.Callback) {
- app.appConn.SetResponseCallback(cb)
- }
-
- func (app *appConnMempool) Error() error {
- return app.appConn.Error()
- }
-
- func (app *appConnMempool) FlushAsync() *abcicli.ReqRes {
- return app.appConn.FlushAsync()
- }
-
- func (app *appConnMempool) FlushSync() error {
- return app.appConn.FlushSync()
- }
-
- func (app *appConnMempool) CheckTxAsync(req types.RequestCheckTx) *abcicli.ReqRes {
- return app.appConn.CheckTxAsync(req)
- }
-
- func (app *appConnMempool) CheckTxSync(req types.RequestCheckTx) (*types.ResponseCheckTx, error) {
- return app.appConn.CheckTxSync(req)
- }
-
- //------------------------------------------------
- // Implements AppConnQuery (subset of abcicli.Client)
-
- type appConnQuery struct {
- appConn abcicli.Client
- }
-
- func NewAppConnQuery(appConn abcicli.Client) AppConnQuery {
- return &appConnQuery{
- appConn: appConn,
- }
- }
-
- func (app *appConnQuery) Error() error {
- return app.appConn.Error()
- }
-
- func (app *appConnQuery) EchoSync(msg string) (*types.ResponseEcho, error) {
- return app.appConn.EchoSync(msg)
- }
-
- func (app *appConnQuery) InfoSync(req types.RequestInfo) (*types.ResponseInfo, error) {
- return app.appConn.InfoSync(req)
- }
-
- func (app *appConnQuery) QuerySync(reqQuery types.RequestQuery) (*types.ResponseQuery, error) {
- return app.appConn.QuerySync(reqQuery)
- }
-
- //------------------------------------------------
- // Implements AppConnSnapshot (subset of abcicli.Client)
-
- type appConnSnapshot struct {
- appConn abcicli.Client
- }
-
- func NewAppConnSnapshot(appConn abcicli.Client) AppConnSnapshot {
- return &appConnSnapshot{
- appConn: appConn,
- }
- }
-
- func (app *appConnSnapshot) Error() error {
- return app.appConn.Error()
- }
-
- func (app *appConnSnapshot) ListSnapshotsSync(req types.RequestListSnapshots) (*types.ResponseListSnapshots, error) {
- return app.appConn.ListSnapshotsSync(req)
- }
-
- func (app *appConnSnapshot) OfferSnapshotSync(req types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) {
- return app.appConn.OfferSnapshotSync(req)
- }
-
- func (app *appConnSnapshot) LoadSnapshotChunkSync(
- req types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) {
- return app.appConn.LoadSnapshotChunkSync(req)
- }
-
- func (app *appConnSnapshot) ApplySnapshotChunkSync(
- req types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) {
- return app.appConn.ApplySnapshotChunkSync(req)
- }
|