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

Feature/parallel collation #197

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

Conversation

SmaGMan
Copy link

@SmaGMan SmaGMan commented Dec 23, 2023

No description provided.

@@ -1057,6 +1754,9 @@ impl Collator {

let rand_seed = rand_seed.unwrap_or_else(|| secure_256_bits().into());

let finalize_parallel_timeout_ms =
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like method of CollatorConfig

Copy link
Author

Choose a reason for hiding this comment

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

Fixed

self.process_new_messages(!collator_data.inbound_queues_empty, prev_data,
collator_data, &mut exec_manager).await?;
if collator_data.inbound_queues_empty {
self.process_new_messages(!collator_data.inbound_queues_empty, prev_data,
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems it is a good idea to delete the first parameter in the enqueue_only func and refactor it a bit.

Copy link
Author

Choose a reason for hiding this comment

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

Fixed

@@ -2152,7 +2867,7 @@ impl Collator {
}
self.create_ticktock_transaction(config_account_id, tock, prev_data, collator_data,
exec_manager).await?;
exec_manager.wait_transactions(collator_data).await?;
exec_manager.wait_transactions(collator_data, || self.check_finilize_parallel_timeout()).await?;
Copy link
Contributor

Choose a reason for hiding this comment

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

All the wait_transactions calls receive check_finilize_parallel_timeout. Need to encapsulate that logic in the exec manager

Copy link
Author

Choose a reason for hiding this comment

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

Fixed

// process newly-generated messages (only by including them into output queue)
self.process_new_messages(
true, prev_data, collator_data, &mut exec_manager).await?;
// DO NOT NEED THIS - all new messages were queued already
Copy link
Contributor

Choose a reason for hiding this comment

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

Just delete the commented code. Git remembers all the history =)

Copy link
Author

Choose a reason for hiding this comment

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

Fixed

@@ -207,23 +223,49 @@ impl PartialOrd for NewMessage {
}
}

type TxLastLt = u64;
Copy link
Contributor

Choose a reason for hiding this comment

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

Usually, we don't use type redefinitions.

Copy link
Author

Choose a reason for hiding this comment

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

Fixed

@@ -207,23 +223,49 @@ impl PartialOrd for NewMessage {
}
}

type TxLastLt = u64;

struct CollatorData {
Copy link
Contributor

Choose a reason for hiding this comment

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

Encapsulation of the new parameters to some new struct might be a good idea.

Copy link
Author

Choose a reason for hiding this comment

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

Won't fix. Finally we should encapsulate and existing context parameters, too. Not in this PR

}
}
}
msgs_to_revert.reverse();
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider using .iter().rev()

Copy link
Author

Choose a reason for hiding this comment

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

Fixed

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