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

Prio scheduler crate #3167

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Conversation

flame4
Copy link

@flame4 flame4 commented Oct 15, 2024

Problem

Currently the definition and implementation of PrioGraphScheduler and related components is coupled with banking-stage on solana-core crate, with most of useful api availabilty a pub(crate), so it's hard to reuse.

Summary of Changes

  • Extract PrioGraphScheduler as indepent component to use.
  • The SchedulerController handles a lot of forwarding and decision making logic, which is not related to scheduer itself, so just left in solana_core.
  • Scheduler is coupled with ImmutableDeserializedPacket. To avoid circular dependencies, just raise up a Trait type DeserializableTxPacket and let ImmutableDeserializedPacket impls this trait. It also helps modularity of solana crate.
  • Impls a unified IdGenerator to replace TransactionIdGenerator and BatchIdGenerator, which is quite same.
  • two duplicated things: TARGET_NUM_TRANSACTIONS_PER_BATCH and ReadWriteAccountSet, have no good idea to public them somewhere.
  • other codes, basically speaking, just copy-paste of the scheduler implementations.

/// DeserializablePacket can be deserialized from a Packet.
///
/// DeserializablePacket will be deserialized as a SanitizedTransaction
/// to be scheduled in transaction stream and scheduler.
Copy link
Author

Choose a reason for hiding this comment

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

Extract a trait from ImmutableDeserializedPacket itself, and let ImmutableDeserializedPacket implement this to avoid circular dependency

};

/// Wrapper struct to accumulate locks for a batch of transactions.
#[derive(Debug, Default)]
Copy link
Author

Choose a reason for hiding this comment

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

have no idea about where to public this type. Since the usage on scheduler is only here, i just copy one now.

@flame4 flame4 force-pushed the prio-scheduler-crate branch 2 times, most recently from 739519a to b118a73 Compare October 16, 2024 02:52
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.

2 participants