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

Ignore invalid blocks #324

Merged
merged 61 commits into from May 25, 2016
Merged

Ignore invalid blocks #324

merged 61 commits into from May 25, 2016

Conversation

rhsimplex
Copy link
Contributor

Addresses #192 except for checking blocks on get_tx_by_payload_hash, because no tests exist for this query and I understand we're going to change it soon anyway.

May also duplicate #320.

All queries now have one extra query for block validity. I haven't found a more compact/elegant way to do it.

@vrde vrde self-assigned this May 25, 2016
@vrde vrde changed the title Core/192/ignore invalid blocks Ignore invalid blocks May 25, 2016
break

# Query the transaction in the target block and return
response = r.table('bigchain').filter(lambda block: block['id'] == target_block_id).nth(0)\
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use just get? The id is the primary index, so it's fast and the code is more compact. Also, we can get rid of the nth(0) operator.

Copy link
Contributor Author

@rhsimplex rhsimplex May 25, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What? No! If anything I need to chain more methods on there. jk, i have no idea what I was thinking with that one.


# vote the block invalid
vote = b.vote(block, b.get_last_voted_block()['id'], False)
b.write_vote(block, vote, 2)
Copy link
Contributor

@vrde vrde May 25, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should the block_number be 3 instead of 2? Should work anyway in the context of the test.

Same here:
https://github.com/bigchaindb/bigchaindb/pull/324/files#diff-5dbcdadd05006f510ee75ac7dae5db47R1083

@vrde vrde merged commit 53b1c2a into master May 25, 2016
ttmc added a commit that referenced this pull request May 25, 2016
sbellem pushed a commit to sbellem/bigchaindb that referenced this pull request Oct 24, 2016
@vrde vrde deleted the core/192/ignore-invalid-blocks branch March 21, 2018 15:02
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

Successfully merging this pull request may close these issues.

None yet

4 participants