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

Send AdvertiseTransactionIds to peers #2823

Merged
merged 28 commits into from
Oct 8, 2021

Conversation

oxarbitrage
Copy link
Contributor

Motivation

After any transaction is inserted into our mempool it must be broadcasted to active peers. Close #2758 when merged.

Solution

Add a watch channel to send inserted transactions from the mempool into a gossip transactions module. Some ideas for this are taken from #2729

Review

Maybe @jvff can do the initial review :)

@jvff jvff self-requested a review October 4, 2021 21:54
Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

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

This looks like a good start, but there are some tricky edge cases we might want to handle.

Have you tested syncing to tip on mainnet or testnet?

zebrad/src/commands/start.rs Outdated Show resolved Hide resolved
zebrad/src/components/mempool.rs Outdated Show resolved Hide resolved
zebrad/src/components/mempool.rs Outdated Show resolved Hide resolved
zebrad/src/components/mempool.rs Outdated Show resolved Hide resolved
zebrad/src/components/mempool/gossip.rs Outdated Show resolved Hide resolved
zebrad/src/components/mempool/gossip.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

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

I did some checks in PR #2729 that you might find useful.

zebrad/src/components/inbound/tests.rs Outdated Show resolved Hide resolved
zebrad/src/components/inbound/tests.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

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

Thanks for rebasing on top of my mempool refactor and gossip test PRs!

We could merge this PR as it is, but I think it's important that we test that the transaction gossip task doesn't panic or have errors.

Did you want to open the follow up ticket for skipping expired transactions and transactions that the mempool storage rejected? (I can do it if you want.)

Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

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

I'm ok with merging this, if @oxarbitrage is ok with my bug fix and cleanup.

@oxarbitrage
Copy link
Contributor Author

Everything looks good here, merging.

@oxarbitrage oxarbitrage merged commit 724967d into ZcashFoundation:main Oct 8, 2021
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.

Broadcast AdvertiseTransactionIds to peers when transactions are added to our mempool
2 participants