-
Notifications
You must be signed in to change notification settings - Fork 295
Conversation
Signed-off-by: Akvinikym <[email protected]>
Signed-off-by: Akvinikym <[email protected]>
Signed-off-by: Akvinikym <[email protected]>
Signed-off-by: Akvinikym <[email protected]>
Signed-off-by: Akvinikym <[email protected]>
Signed-off-by: Akvinikym <[email protected]>
Signed-off-by: Akvinikym <[email protected]>
Signed-off-by: Akvinikym <[email protected]>
Signed-off-by: Akvinikym <[email protected]>
log_->info("Queue size is {}", queue_.unsafe_size()); | ||
void OrderingServiceImpl::onBatch( | ||
shared_model::interface::TransactionBatch &&batch) { | ||
current_size_.fetch_add(batch.transactions().size()); |
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.
Race condition related to several concurrent batches
Signed-off-by: Akvinikym <[email protected]>
Signed-off-by: Akvinikym <[email protected]>
batch->transactions().end(), | ||
[this, &proto_proposal](auto &tx) { | ||
*proto_proposal.add_transactions() = | ||
static_cast<shared_model::proto::Transaction *>(tx.get()) |
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.
std::static_pointer_cast
Signed-off-by: Akvinikym <[email protected]>
#include <rxcpp/rx.hpp> | ||
#include <shared_mutex> |
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.
Please reorganize includes as follows:
- std includes
- third party
- ours
@@ -157,7 +143,8 @@ TEST_F(OrderingServiceTest, ValidWhenProposalSizeStrategy) { | |||
fake_transport->subscribe(ordering_service); | |||
|
|||
for (size_t i = 0; i < tx_num; ++i) { | |||
ordering_service->onTransaction(getTx()); | |||
auto batch = framework::batch::createValidBatch(1); |
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.
if you add "namespace framework" you can make it one liner
.WillRepeatedly(Return(true)); | ||
EXPECT_CALL(*fake_persistent_state, loadProposalHeight()) | ||
.Times(1) | ||
.WillOnce(Return(boost::optional<size_t>(15))); |
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.
please make 15 a constant. Even better is to replace with expession (batch1.size + batch2.size)
Signed-off-by: Akvinikym <[email protected]>
log_->info("Queue size is {}", queue_.unsafe_size()); | ||
void OrderingServiceImpl::onBatch( | ||
shared_model::interface::TransactionBatch &&batch) { | ||
std::shared_lock<std::shared_timed_mutex> batch_prop_lock( |
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.
Please add comments about why this mutex is necessary
Signed-off-by: Akvinikym <[email protected]>
Signed-off-by: Akvinikym <[email protected]>
Signed-off-by: Akvinikym <[email protected]>
Signed-off-by: Akvinikym <[email protected]>
Signed-off-by: Akvinikym <[email protected]>
Signed-off-by: Akvinikym <[email protected]>
Signed-off-by: Akvinikym <[email protected]>
Signed-off-by: Akvinikym <[email protected]>
Description of the Change
In this pull request support for transaction batches in ordering service was added, which ends the batch pipeline, as after it they go into proposal. Also, one can pay attention that ordering service now accepts only batches, no single transactions anymore (except those which are wrapped into batches).
Benefits
Ends batch pipeline.
Possible Drawbacks
None