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

limit local snark work broadcast #9011

Merged
merged 7 commits into from Jun 16, 2021
Merged

Conversation

deepthiskumar
Copy link
Member

@deepthiskumar deepthiskumar commented Jun 9, 2021

limit local snark work broadcasts as per the current rate limit to avoid being rejected by peers

@deepthiskumar deepthiskumar requested a review from a team as a code owner June 9, 2021 08:26
@deepthiskumar deepthiskumar added the ci-build-me Add this label to trigger a circle+buildkite build for this branch label Jun 9, 2021
; peer_id= "" }
in
let rl = Network_pool.Transaction_pool.create_rate_limiter () in
log_rate_limiter_occasionally rl ~label:"local_transactions" ;
Copy link
Member

Choose a reason for hiding this comment

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

Nit: this also applies to rebroadcast of non-local transactions; perhaps the message should be transactions?

Copy link
Member

@mrmr1993 mrmr1993 left a comment

Choose a reason for hiding this comment

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

I'd misunderstood you when we were talking OOB about the inclusion_table. I think we still need it -- or something like it -- to prevent us from rebroadcasting snark work until its statement falls off the edge of the frontier.

I originally thought you were talking about keeping work around during a re-org, but I guess that's a far more complicated problem. Probably we should just leave the inclusion_table as is.

@deepthiskumar
Copy link
Member Author

deepthiskumar commented Jun 9, 2021

I'd misunderstood you when we were talking OOB about the inclusion_table. I think we still need it -- or something like it -- to prevent us from rebroadcasting snark work until its statement falls off the edge of the frontier.

I originally thought you were talking about keeping work around during a re-org, but I guess that's a far more complicated problem. Probably we should just leave the inclusion_table as is.

We rebroadcast work from the latest 10 blocks in the best chain. So this should be ok?

if in_best_tip_table stmt then

@aneesharaines aneesharaines linked an issue Jun 9, 2021 that may be closed by this pull request
Copy link
Member

@nholland94 nholland94 left a comment

Choose a reason for hiding this comment

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

Code changes LGTM.

RE: the conversation about removing the inclusion_table -- seems to me that with the old behavior, we would not broadcast snark work that was included in a fork but not in the best tip chain. This sounds like it could, in theory, deadlock the scan state on a network if 1 node was forked on a chain that included the work, but the block producers on the canonical chain do not have that work in their mempool. Other nodes in the network would fail to notify the block producer's of the necessary snark work since it's already included in a fork.

So, looking at that, it seems to me that choosing to rebroadcast snark work based off of txns that need to be proven in the current canonical chain makes more sense than the old behavior. But I'm not 100% confident in this, and am curious to see what @mrmr1993 thinks.

@deepthiskumar
Copy link
Member Author

Discussed with @mrmr1993 some more- with the inclusion table we were essentially only rebroadcasting work from the latest scan state (if they were no re-orgs). But we do want to rebroadcast work from scan state of older blocks given there are many tiny forks. But 10 blocks seems unnecessary and will go over the current rate limit. So now, rebroadcasting work from the scan state of last 3 blocks in the best chain. This should help with the rate limiting problem cc @nholland94

Copy link
Member

@mrmr1993 mrmr1993 left a comment

Choose a reason for hiding this comment

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

After talking OOB, I'm convinced that it's better to rebroadcast older snark work from the last 3 blocks, and I'm happy approving this in its current version. This should be an improvement in all aspects of our snark pool behaviour.

There are still issues around rate limiting, but fixing those fully could end up a significant undertaking, and bitswap will fix these issues properly anyway.

@lk86 lk86 merged commit 501d750 into release/1.1.6 Jun 16, 2021
@lk86 lk86 deleted the fix/snark-pool-rate-limit branch June 16, 2021 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-build-me Add this label to trigger a circle+buildkite build for this branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigating no transaction issue in devnet
4 participants