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

Initial algorithm for nominating valid 'parallel' tx sets. #4486

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dmkozh
Copy link
Contributor

@dmkozh dmkozh commented Sep 25, 2024

Initial algorithm for nominating valid 'parallel' tx sets.

This is a relatively simple algorithm, but it should be serviceable for traffic with relatively low amount of transitive IO conflicts.

@dmkozh dmkozh force-pushed the parallel_txset_nomination branch 6 times, most recently from f911313 to 46e2e52 Compare January 29, 2025 19:58
@dmkozh dmkozh marked this pull request as ready for review January 29, 2025 22:14
@dmkozh dmkozh force-pushed the parallel_txset_nomination branch from 46e2e52 to ba6137b Compare February 20, 2025 22:47
@dmkozh dmkozh changed the title Parallel txset nomination Initial algorithm for nominating valid 'parallel' tx sets. Feb 20, 2025
This is a relatively simple algorithm, but it should be serviceable for traffic with relatively low amount of transitive IO conflicts.
@dmkozh dmkozh force-pushed the parallel_txset_nomination branch from ba6137b to 8afa754 Compare February 20, 2025 23:26
{
ZoneScoped;
// A fast-fail condition to ensure that adding the transaction won't
// exceed the theorethical limit of instructions per stage.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// exceed the theorethical limit of instructions per stage.
// exceed the theoretical limit of instructions per stage.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

std::vector<std::shared_ptr<Cluster const>>
createNewClusters(BuilderTx const& tx,
std::unordered_set<Cluster const*> const& txConflicts,
bool& packed)
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of returning packed as a ref parameter, why not return a pair eg. std::pair<std::vector<std::shared_ptr<Cluster const>>, bool>?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That works as well, I just wanted to avoid copying the vector unnecessarily.

// This is not configurable for now. It doesn't need to be a network-wide
// setting, but on the other hand there aren't many good values for it and
// it's not clear what the right way to configure it would be, if at all.
SOROBAN_PHASE_STAGE_COUNT = 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you've mentioned this setting should be dynamically determined by the contents of the tx queue instead of hardcoded. What's the plan wrt that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that would be a separate PR. But I think we could make a few tx sets in parallel and use the one with the smallest amount of stages that provides roughly the same utilization.

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.

2 participants