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

(Logs) Build transactions batch #189

Merged
merged 8 commits into from
Jan 30, 2024
Merged

(Logs) Build transactions batch #189

merged 8 commits into from
Jan 30, 2024

Conversation

polydez
Copy link
Contributor

@polydez polydez commented Jan 26, 2024

Added logs for transaction batch building flow.

Sample output:

2024-01-29T09:01:42.062953Z  INFO block_producer:try_build_batches: miden-block-producer: block-producer/src/txqueue/mod.rs:162: new
2024-01-29T09:01:42.063159Z  INFO block_producer:try_build_batches:batch_builder: miden-block-producer: block-producer/src/txqueue/mod.rs:192: new
2024-01-29T09:01:42.063304Z  INFO block_producer:try_build_batches:batch_builder:build_batch: miden-block-producer: block-producer/src/batch_builder/mod.rs:116: new
2024-01-29T09:01:42.063354Z  INFO block_producer:try_build_batches:batch_builder:build_batch: miden-block-producer: block-producer/src/batch_builder/mod.rs:123: Building a transaction batch, num_txs: 1
2024-01-29T09:01:42.063412Z  INFO block_producer:try_build_batches:batch_builder:build_batch:new_batch: miden-block-producer: block-producer/src/batch_builder/batch.rs:41: new
2024-01-29T09:01:42.072082Z  INFO block_producer:try_build_batches:batch_builder:build_batch:new_batch: miden-block-producer: block-producer/src/batch_builder/batch.rs:41: close, time.busy: 8.14ms, time.idle: 526µs
2024-01-29T09:01:42.072189Z  INFO block_producer:try_build_batches:batch_builder:build_batch: miden-block-producer: block-producer/src/batch_builder/mod.rs:128: Transaction batch built
2024-01-29T09:01:42.072302Z  INFO block_producer:try_build_batches:batch_builder:build_batch: miden-block-producer: block-producer/src/batch_builder/mod.rs:116: close, time.busy: 8.95ms, time.idle: 50.4µs batch_id: "0x8a73a469f0af54c4c32588af08f7fd840f80a25e690a3247f252500fddc6f534"
2024-01-29T09:01:42.092294Z  INFO block_producer:try_build_batches:batch_builder: miden-block-producer: block-producer/src/txqueue/mod.rs:192: close, time.busy: 29.0ms, time.idle: 141µs
2024-01-29T09:01:42.092359Z  INFO block_producer:try_build_batches: miden-block-producer: block-producer/src/txqueue/mod.rs:162: close, time.busy: 174µs, time.idle: 29.3ms

@polydez polydez requested a review from bobbinth January 26, 2024 08:46
@polydez polydez marked this pull request as ready for review January 27, 2024 04:00
Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

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

Thank you! Looks good! I added some comments inline - most of them are related to removing some intermediary spans which I don't think add much value. Basically, in my mind the deepest span path could look like so:

block_producer:try_build_batches:build_batch:new_batch

As compared to the current:

block_producer::serve:transaction_queue:run:try_build_batches:block_producer::batch_builder::build_batch:build_batch:new

store/src/server/mod.rs Outdated Show resolved Hide resolved
rpc/src/server/mod.rs Outdated Show resolved Hide resolved
block-producer/src/server/mod.rs Outdated Show resolved Hide resolved
block-producer/src/server/mod.rs Outdated Show resolved Hide resolved
block-producer/src/server/mod.rs Outdated Show resolved Hide resolved
block-producer/src/txqueue/mod.rs Outdated Show resolved Hide resolved
block-producer/src/batch_builder/mod.rs Outdated Show resolved Hide resolved
block-producer/src/batch_builder/mod.rs Outdated Show resolved Hide resolved
block-producer/src/batch_builder/mod.rs Outdated Show resolved Hide resolved
block-producer/src/batch_builder/batch.rs Outdated Show resolved Hide resolved
@bobbinth bobbinth mentioned this pull request Jan 28, 2024
Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

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

Thank you! Looks good! I left a couple of small comments inline. After these, we are good to merge.

block-producer/src/server/mod.rs Show resolved Hide resolved
block-producer/src/batch_builder/batch.rs Outdated Show resolved Hide resolved
block-producer/src/batch_builder/batch.rs Outdated Show resolved Hide resolved
Comment on lines 137 to 139
let mut tx_id = tx.id().as_bytes().to_vec();
buf.append(&mut tx_id);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Here, I would do something like:

but.extend_from_slice(&tx.id().as_bytes());

@polydez polydez merged commit d81d3c1 into main Jan 30, 2024
4 checks passed
@polydez polydez deleted the polydez-logs-build-batch branch January 30, 2024 07:51
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