-
Notifications
You must be signed in to change notification settings - Fork 60
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
base: master
Are you sure you want to change the base?
Conversation
src/validator/collator.rs
Outdated
@@ -1057,6 +1754,9 @@ impl Collator { | |||
|
|||
let rand_seed = rand_seed.unwrap_or_else(|| secure_256_bits().into()); | |||
|
|||
let finalize_parallel_timeout_ms = |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
src/validator/collator.rs
Outdated
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, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
src/validator/collator.rs
Outdated
@@ -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?; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
src/validator/collator.rs
Outdated
// 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 |
There was a problem hiding this comment.
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 =)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
src/validator/collator.rs
Outdated
@@ -207,23 +223,49 @@ impl PartialOrd for NewMessage { | |||
} | |||
} | |||
|
|||
type TxLastLt = u64; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
src/validator/collator.rs
Outdated
} | ||
} | ||
} | ||
msgs_to_revert.reverse(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using .iter().rev()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
b33a3b3
to
0440c96
Compare
No description provided.