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

What to do if a tx gets copied from an undecided or decided_valid block to the backlog? #220

Closed
ttmc opened this issue Apr 25, 2016 · 8 comments
Assignees

Comments

@ttmc
Copy link
Contributor

ttmc commented Apr 25, 2016

What if a "bad" node copies a transaction from an undecided or decided_valid block to the backlog? (That shouldn't happen, but hey, it's possible.)

Maybe when a node builds a block, it should check each transaction to see if that transaction is already in an undecided or decided_valid block. If so, it should delete the transaction in question (i.e. delete the one in the backlog table, not the one in the bigchain table).

@r-marques
Copy link
Contributor

this is related to #131

@rhsimplex
Copy link
Contributor

Related to #568, closing to consolidate discussion.

@ttmc
Copy link
Contributor Author

ttmc commented Aug 30, 2016

@rhsimplex Are you thinking that the soon-to-come check for duplicate transactions will handle this scenario (where a bad node copies a transaction from a block in the bigchain table to the backlog, when it shouldn't)?

@rhsimplex
Copy link
Contributor

That's the idea...did I miss something?

@ttmc
Copy link
Contributor Author

ttmc commented Aug 30, 2016

@rhsimplex I was just making sure I understood your reasoning. All is well, carry on.

@rhsimplex
Copy link
Contributor

Reopening, because #359 and #609 don't fully solve this. There is no explicit check for duplicate CREATE transactions in validate_block. Even if there were, it's no guarantee due to concurrency. Will the votes take care of it?

@rhsimplex rhsimplex reopened this Sep 8, 2016
@sohkai sohkai assigned r-marques and unassigned rhsimplex Feb 10, 2017
@ttmc
Copy link
Contributor Author

ttmc commented Apr 3, 2017

I think this issue is resolved now. I'm pretty sure that if a transaction in a valid or undecided block gets copied to the backlog, the copy will get deleted as invalid (either as a double-create or as a double-spend).

@libscott Can you confirm?

@ssadler
Copy link
Contributor

ssadler commented Apr 3, 2017

This is correct, all transactions are checked for conflicting transactions (another tx that spends same outputs or has same ID in a non INVALID block):

new = self.bigchain.is_new_transaction(tx.id, exclude_block_id=block_id)

def test_vote_no_double_inclusion(b):

@ssadler ssadler closed this as completed Apr 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants