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

MessagePool Greedy Message Selection #856

Merged
merged 20 commits into from
Nov 20, 2020
Merged

MessagePool Greedy Message Selection #856

merged 20 commits into from
Nov 20, 2020

Conversation

ec2
Copy link
Member

@ec2 ec2 commented Nov 18, 2020

Summary of changes
Changes introduced in this pull request:

  • Implements greedy message selection for mining

Reference issue to close (if applicable)

Closes #709

Other information and links

  • Remaining to do for future PRs is hooking this up to RPC and writing the optimized selection algorithm for more dense blocks.

blockchain/message_pool/src/msgpool/mod.rs Outdated Show resolved Hide resolved
blockchain/message_pool/src/msgpool/mod.rs Show resolved Hide resolved
blockchain/message_pool/src/msgpool/mod.rs Outdated Show resolved Hide resolved
blockchain/message_pool/src/msgpool/selection.rs Outdated Show resolved Hide resolved
blockchain/message_pool/src/msgpool/selection.rs Outdated Show resolved Hide resolved
blockchain/message_pool/src/msgpool/selection.rs Outdated Show resolved Hide resolved
blockchain/message_pool/src/msgpool/selection.rs Outdated Show resolved Hide resolved
/// Like head_change, except it doesnt change the state of the MessagePool.
/// It simulates a head change call.
pub async fn run_head_change<T>(
api: &RwLock<T>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can definitely come in another PR, but it's really weird and probably really slow to have all interactions with the provider be behind a mutex, even for operations not relating to each other. It doesn't make sense that any of the functions require a mutable reference, so requiring an exclusive lock is definitely inefficient

blockchain/message_pool/src/msgpool/selection.rs Outdated Show resolved Hide resolved
blockchain/message_pool/src/msgpool/mod.rs Outdated Show resolved Hide resolved
@ec2 ec2 requested a review from austinabell November 20, 2020 17:49
@ec2 ec2 merged commit db64246 into main Nov 20, 2020
@ec2 ec2 deleted the ec2/mpool-selection branch November 20, 2020 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Message Selection
3 participants