Skip to content

Commit

Permalink
[refactor] hyperledger-iroha#4315: split pipeline events
Browse files Browse the repository at this point in the history
Signed-off-by: Marin Veršić <[email protected]>
  • Loading branch information
mversic committed Mar 14, 2024
1 parent be0e67f commit 063a201
Show file tree
Hide file tree
Showing 17 changed files with 629 additions and 436 deletions.
5 changes: 3 additions & 2 deletions core/benches/blocks/apply_blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ impl WsvApplyBlocks {
.into_iter()
.map(|instructions| {
let block = create_block(&mut wsv, instructions, account_id.clone(), &key_pair);
wsv.apply_without_execution(&block).map(|()| block)
let _wsv_events = wsv.apply_without_execution(&block);
block
})
.collect::<Result<Vec<_>, _>>()?
.collect::<Vec<_>>()
};

Ok(Self { wsv, blocks })
Expand Down
2 changes: 2 additions & 0 deletions core/benches/blocks/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ pub fn create_block(
)
.chain(0, wsv)
.sign(key_pair)
.unpack(|_| {})
.commit(&topology)
.unpack(|_| {})
.unwrap();

// Verify that transactions are valid
Expand Down
2 changes: 1 addition & 1 deletion core/benches/blocks/validate_blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl WsvValidateBlocks {
for (instructions, i) in instructions.into_iter().zip(1..) {
finalized_wsv = wsv.clone();
let block = create_block(&mut wsv, instructions, account_id.clone(), &key_pair);
wsv.apply_without_execution(&block)?;
let _wsv_events = wsv.apply_without_execution(&block);
assert_eq!(wsv.height(), i);
assert_eq!(wsv.height(), finalized_wsv.height() + 1);
}
Expand Down
3 changes: 2 additions & 1 deletion core/benches/kura.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ async fn measure_block_size_for_n_executors(n_executors: u32) {
let topology = Topology::new(UniqueVec::new());
let mut block = BlockBuilder::new(vec![tx], topology, Vec::new())
.chain(0, &mut wsv)
.sign(&KeyPair::random());
.sign(&KeyPair::random())
.unpack(|_| {});

for _ in 1..n_executors {
block = block.sign(&KeyPair::random());
Expand Down
2 changes: 1 addition & 1 deletion core/benches/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ fn sign_blocks(criterion: &mut Criterion) {
b.iter_batched(
|| block.clone(),
|block| {
let _: ValidBlock = block.sign(&key_pair);
let _: ValidBlock = block.sign(&key_pair).unpack(|_| {});
count += 1;
},
BatchSize::SmallInput,
Expand Down
Loading

0 comments on commit 063a201

Please sign in to comment.