-
Notifications
You must be signed in to change notification settings - Fork 39
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) Submit proven transaction logs #172
Conversation
a7a3e3a
to
9bb8583
Compare
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.
Thank you! Looks good! I left some comments inline, but also a few general comments:
- Looks like we are missing the RPC part of the flow.
- It seems like child spans inherit fields of parent spans. If this is correct, then we don't need to add things like
COMPONENT
to every log message. Same goes for transaction ID which we should be able to set once and then it would be associated with subsequent logs. - For things which may result in kilobytes of data being logged (e.g., full requests/responses), let's use
DEBUG
level. - Let's make sure that data gets serialized in a usable format. This may require introducing wrapper structs and implementing
Display
traits on them.
…ForTransactionInput`
…roven-transaction # Conflicts: # store/src/db/mod.rs # store/src/db/tests.rs # store/src/lib.rs
…tting of `AccountId`" This reverts commit 8e77403
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.
Thank you! Looks good! Not a full review - but I did leave a few comments inline.
@bobbinth, I've addressed all comments. If you have a chance, please, take a look! |
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.
Thank you! Looks good! I left some comments inline - but they are all pretty small.
…roven-transaction # Conflicts: # block-producer/src/state_view/mod.rs # store/src/state.rs
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 good! Thank you! I left some more small comments inline. After these are addressed, we can merge.
utils/src/logging.rs
Outdated
let metadata = envelope.metadata(); | ||
format!( | ||
"{{ note_id: {}, note_metadata: {{sender: {}, tag: {} }}}}", | ||
envelope.note_id().inner(), |
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.
For note ID, let's use to_hex()
here.
store/src/main.rs
Outdated
#[instrument(target = "miden-store", skip_all)] | ||
async fn query( |
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.
Why do we need to instrument this? As I mentioned previously, this command will be run from the CLI - so, not sure we need to collect any logs here.
store/src/server/mod.rs
Outdated
pub async fn serve( | ||
config: StoreConfig, | ||
db: Db, | ||
) -> Result<()> { | ||
info!(target: COMPONENT, %config); |
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.
Any reason not to add a message here? e.g., so that it looks like so:
info!(target: COMPONENT, %config, "Initializing server");
Then, line 28 could be something like this:
info!(target: COMPONENT, "Server initialized");
(i.e., I'm not sure we need to log config
twice).
store/src/db/mod.rs
Outdated
pub async fn setup(config: StoreConfig) -> Result<Self, anyhow::Error> { | ||
info!(target: COMPONENT, %config); |
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.
Similar comment as above: any reason not to make it:
info!(target: COMPONENT, %config, "Connecting to the database");
Also, I'd change "DB" on line 87 below to "database".
rpc/src/server/mod.rs
Outdated
pub async fn serve(config: RpcConfig) -> Result<()> { | ||
info!(target: COMPONENT, %config); |
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.
Similar comment to above: any reason not to change this to:
info!(target: COMPONENT, %config, "Initializing server");
Then, we can probably change line 24 to something like this:
info!(target: COMPONENT, "Server initialized");
block-producer/src/server/mod.rs
Outdated
pub async fn serve(config: BlockProducerConfig) -> Result<()> { | ||
info!(target: COMPONENT, %config); |
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.
Let's change this to:
info!(target: COMPONENT, %config, "Initializing server");
And line 72 below to:
info!(target: COMPONENT, "Server initialized");
…roven-transaction # Conflicts: # block-producer/src/server/mod.rs # rpc/src/server/mod.rs # store/src/server/mod.rs # utils/src/config.rs
Sample output:
Sample output (error):