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

[Feature]: Add TxIndex / TxBlockPos to transaction.Service #22895

Closed
julienrbrt opened this issue Dec 16, 2024 · 1 comment
Closed

[Feature]: Add TxIndex / TxBlockPos to transaction.Service #22895

julienrbrt opened this issue Dec 16, 2024 · 1 comment
Assignees

Comments

@julienrbrt
Copy link
Member

julienrbrt commented Dec 16, 2024

Summary

Possibly add a new method in the transaction.Service.

// Service creates a transaction service.
type Service interface {
	// ExecMode returns the current execution mode.
	ExecMode(ctx context.Context) ExecMode
++    // TxIndex returns the transaction position in a block
++    TxIndex(ctx context.Context) (uint64, error)
}

Problem Definition

No response

Proposed Feature

This method, called func TxIndex(ctx) (uint64, error) or TxBlockPos should return the tx position in a block.
Some consumer (like wasmd) require this and do that manually: https://github.com/CosmWasm/wasmd/blob/02354c6/x/wasm/keeper/ante.go#L25-L55

⚠ This should only be done if it is not ugly to do in baseapp and stf

@github-project-automation github-project-automation bot moved this to 📋 Backlog in Cosmos-SDK Dec 16, 2024
@tac0turtle tac0turtle moved this from 📋 Backlog to 🤸‍♂️ In Progress in Cosmos-SDK Dec 18, 2024
@tac0turtle
Copy link
Member

looking into the design, im not sure this would work in the world of parallelisation. As this is something being explored this api would need to be broken. I would propose keeping the antehandler and not making this part of core.

@github-project-automation github-project-automation bot moved this from 🤸‍♂️ In Progress to 🥳 Done in Cosmos-SDK Dec 18, 2024
@julienrbrt julienrbrt closed this as not planned Won't fix, can't repro, duplicate, stale Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🥳 Done
Development

No branches or pull requests

3 participants