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

Determines whether transaction input is spent from the last transaction in the chain #627

Closed
samuelmanzanera opened this issue Oct 12, 2022 · 1 comment · Fixed by #689
Closed
Labels
API Involve API facing user feature New feature request P2P Involve P2P networking

Comments

@samuelmanzanera
Copy link
Member

Is your feature request related to a problem?

Our UTXO model ensure the inputs are spent for each transaction (re-created).
After #621, if a token is not used, it's marked as spent in the previous transaction and unspent in the next one.
This is a strange behavior for the UTXO model.
We should be able to determine whether a transaction input is spent based on the last transaction on the chain.

Describe the solution you'd like

After #624, the spent UTXO would not accessible in the MemTables.
Hence, to determine if the input is really spent (logically speaking within the entire chain), we should provide a way to determine this.

In the P2P request to fetch transaction inputs of a previous transaction, from the spent assets (stored on disk – after #624), we can request the last transaction of the chain to determine if the input is an UTXO.
Then we could flag the input as not unspent.

The explorer and the API will then be impacted in the way they retrieve information.

Additional context

No response

@samuelmanzanera samuelmanzanera added feature New feature request P2P Involve P2P networking API Involve API facing user labels Oct 12, 2022
@internet-zero
Copy link
Member

Hey team! Please add your planning poker estimate with Zenhub @samuelmanzanera @apoorv-2204 @Neylix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Involve API facing user feature New feature request P2P Involve P2P networking
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants