-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
feat!: Comet v0.38 Integration #15519
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alexanderbez
changed the title
feat!: [DNM] Comet v0.38 Integration
feat!: Comet v0.38 Integration [1/n]
Apr 6, 2023
@alexanderbez your pull request is missing a changelog! |
baseapp/abci.go
Outdated
Comment on lines
359
to
424
} | ||
} | ||
|
||
return res | ||
return resp | ||
} | ||
|
||
// EndBlock implements the ABCI interface. | ||
func (app *BaseApp) EndBlock(req abci.RequestEndBlock) (res abci.ResponseEndBlock) { | ||
if app.deliverState.ms.TracingEnabled() { | ||
app.deliverState.ms = app.deliverState.ms.SetTracingContext(nil).(storetypes.CacheMultiStore) | ||
} | ||
func (app *BaseApp) legacyEndBlock(req *abci.RequestFinalizeBlock) sdk.LegacyResponseEndBlock { | ||
var ( | ||
resp sdk.LegacyResponseEndBlock | ||
err error | ||
) | ||
|
||
// TODO: Fill out! | ||
legacyReq := sdk.LegacyRequestEndBlock{} | ||
|
||
if app.endBlocker != nil { | ||
var err error | ||
res, err = app.endBlocker(app.deliverState.ctx, req) | ||
resp, err = app.endBlocker(app.finalizeBlockState.ctx, legacyReq) | ||
if err != nil { | ||
panic(err) | ||
} | ||
res.Events = sdk.MarkEventsToIndex(res.Events, app.indexEvents) | ||
|
||
resp.Response.Events = sdk.MarkEventsToIndex(resp.Response.Events, app.indexEvents) | ||
} | ||
|
||
cp := app.GetConsensusParams(app.deliverState.ctx) | ||
res.ConsensusParamUpdates = &cp | ||
cp := app.GetConsensusParams(app.finalizeBlockState.ctx) | ||
resp.Response.ConsensusParamUpdates = &cp | ||
|
||
// call the streaming service hook with the EndBlock messages | ||
for _, abciListener := range app.streamingManager.ABCIListeners { | ||
ctx := app.deliverState.ctx | ||
ctx := app.finalizeBlockState.ctx | ||
blockHeight := ctx.BlockHeight() | ||
|
||
// TODO: Figure out what to do with ListenEndBlock and the types necessary | ||
// as we cannot have the store sub-module depend on the root SDK module. | ||
// | ||
// Ref: https://github.com/cosmos/cosmos-sdk/issues/12272 | ||
if err := abciListener.ListenEndBlock(ctx, req, res); err != nil { | ||
app.logger.Error("EndBlock listening hook failed", "height", blockHeight, "err", err) | ||
} | ||
} | ||
|
||
return res | ||
return resp | ||
} | ||
|
||
// CheckTx implements the ABCI interface and executes a tx in CheckTx mode. In | ||
// CheckTx mode, messages are not executed. This means messages are only validated | ||
// and only the AnteHandler is executed. State is persisted to the BaseApp's | ||
// internal CheckTx state if the AnteHandler passes. Otherwise, the ResponseCheckTx | ||
// will contain relevant error information. Regardless of tx execution outcome, | ||
// the ResponseCheckTx will contain relevant gas execution context. | ||
func (app *BaseApp) CheckTx(_ context.Context, req *abci.RequestCheckTx) (*abci.ResponseCheckTx, error) { | ||
var mode runTxMode | ||
|
||
switch { | ||
case req.Type == abci.CheckTxType_New: | ||
mode = runTxModeCheck | ||
|
||
case req.Type == abci.CheckTxType_Recheck: | ||
mode = runTxModeReCheck | ||
|
||
default: | ||
panic(fmt.Sprintf("unknown RequestCheckTx type: %s", req.Type)) | ||
} | ||
|
||
gInfo, result, anteEvents, err := app.runTx(mode, req.Tx) | ||
if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change potentially affects state.
Call sequence:
(*github.com/cosmos/cosmos-sdk/baseapp.BaseApp).DeliverTx (baseapp/abci.go:410)
github-actions
bot
removed
C:x/crisis
C:Hubl
Tool: Hubl
Type: CI
C:Confix
Issues and PR related to Confix
C:x/mint
C:log
C:Cosmovisor
Issues and PR related to Cosmovisor
C:collections
C:orm
labels
May 24, 2023
julienrbrt
approved these changes
May 24, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Co-authored-by: Julien Robert <julien@rbrt.fr>
19 tasks
12 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C:CLI
C:Rosetta
Issues and PR related to Rosetta
C:Simulations
C:Store
C:x/auth
C:x/authz
C:x/bank
C:x/circuit
C:x/consensus
C:x/distribution
distribution module related
C:x/evidence
C:x/feegrant
C:x/genutil
genutil module issues
C:x/gov
C:x/group
C:x/nft
C:x/slashing
C:x/staking
C:x/upgrade
Type: Build
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR acts as the base feature PR for Comet v0.38 integration into the SDK. Primarily, it contains the following:
abci.go
FinalizeBlock
Subsequent PRs should be based off of this branch and use this branch as the base branch when creating PRs.
ref: #12272
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change