Skip to content
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

0.46 provides post transaction handlers, could potentially migrate MsgFeeHandler to that #1018

Closed
4 tasks
arnabmitra opened this issue Aug 16, 2022 · 2 comments
Closed
4 tasks

Comments

@arnabmitra
Copy link
Contributor

arnabmitra commented Aug 16, 2022

Summary

0.46 provides post transaction handlers, could potentially migrate MsgFeeHandler to that.

Problem Definition

PostHandler are like AnteHandler (they share the same signature), but they execute after [RunMsgs](https://docs.cosmos.network/master/core/baseapp.html#runmsgs).

Like AnteHandlers, PostHandlers are theoretically optional, 

Also

Note, when PostHandlers fail, the state from runMsgs is also reverted, effectively making the transaction fail.

So fit's well, may require some finagling on current events being emitted but probably possible?

This would eliminate changes in our cosmos fork, make code easier to maintain etc.

Proposal

1.Add posthandler to provenance.

func NewPostHandler(options HandlerOptions) (sdk.AnteHandler, error) {
	// pseudo code
	postDecorators := []sdk.AnteDecorator{
		NewMsgFeeDecorator(options.MsgFeeKeeper),
	}

	return sdk.ChainAnteDecorators(postDecorators...), nil
}

2.Migrate MsgFeeHandler to be a postHandler

func (d msgFeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error)
  1. verify wasm message's work and other tests pass.

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@SpicyLemon
Copy link
Contributor

They changed a bunch of stuff around with v0.46 and we need to fix it before we can ship v1.12. #1006 is for doing that.

They also replaced NewMempoolDecorator with NewDeductFeeDecorator. The NewDeductFeeDecorator function takes in a TxFeeChecker (func(ctx sdk.Context, tx sdk.Tx) (sdk.Coins, int64, error)) that might also be leveraged. So there's options.

@SpicyLemon
Copy link
Contributor

I'm going to close this as a duplicate of #1006. There's some good stuff in here that will help with that one though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants