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

Mempool should discard any transaction with repeated nullifier #1389

Merged
merged 5 commits into from
May 6, 2022

Conversation

goshawk-3
Copy link
Contributor

fixes #1388

@goshawk-3 goshawk-3 marked this pull request as ready for review May 5, 2022 14:25
Copy link
Member

@autholykos autholykos left a comment

Choose a reason for hiding this comment

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

LGTM. Some minor nits that we should probably handle separately

## Implementation details

### Exposed methods
Mempool exposes `ProcessTx` method that is concurrent-safe, implements trasaction acceptance criteria and adds valid transaction to the mempool state.
Copy link
Member

Choose a reason for hiding this comment

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

s/trasaction/transaction/
s/valid transaction/valid transactions/

- Block Accepted event triggered by Chain component.

`PropagateLoop` goroutine handles:
- any request for transaction repropagation sent by `ProcessTx` and repropagates at proper rate. It also should prioritize propagation by transaction fee (not implemented).
Copy link
Member

Choose a reason for hiding this comment

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

Here you can maybe add github issue for transaction prioritization (#1240)

Comment on lines +249 to +251
if err != nil {
continue
}
Copy link
Member

Choose a reason for hiding this comment

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

should we really fail silently here? What to do if data is corrupted?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

m.data represents transactions that pass all checks and are accepted in mempool. If for some odd case m.data has accepted a corrupted tx, this (ContainAnyNullifiers) should not fail here, disallowing acceptance of other valid transactions.

@goshawk-3 goshawk-3 merged commit aae5536 into master May 6, 2022
@goshawk-3 goshawk-3 deleted the fix-1388 branch May 6, 2022 09:20
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.

Mempool should discard any transaction with repeated nullifier
2 participants