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

Teeerex: Be much more verbose during the process. #181

Merged
merged 9 commits into from
Jul 14, 2023
Merged

Conversation

OverOrion
Copy link
Contributor

No description provided.

@OverOrion OverOrion changed the title Teeerex: Decode V2 TCB Info + be much more verbose during the process. Teeerex: Be much more verbose during the process. Jul 3, 2023
@OverOrion OverOrion marked this pull request as ready for review July 3, 2023 11:49
Copy link
Contributor

@clangenb clangenb left a comment

Choose a reason for hiding this comment

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

Ah sorry, I just saw that you did not actually as for a review yet, so I stopped. :)

@@ -143,10 +143,16 @@ impl TcbVersionStatus {

pub fn verify_examinee(&self, examinee: &TcbVersionStatus) -> bool {
for (v, r) in self.cpusvn.iter().zip(examinee.cpusvn.iter()) {
log::debug!("teerex: verify_examinee: v={:#?},r={:#?}", v, r);
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks a lot for all these extra logs. However, I am not fond of teerex:, it is essentially redundant information as the logger does already contain the rust module path. But we could add a target: TEEREX as an argument, where teerex should be a const ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did not know about this, handy feature! Rewrote all of them to use it, thanks for the early review! :D 💯

Comment on lines 233 to 235
log::info!("teerex: called into runtime call register_tcb_info(), inside Self::is_valid.");
log::info!("teerex: called into runtime call register_tcb_info(), inside Self::is_valid, self is: {:#?}" , &self);
log::info!("teerex: called into runtime call register_tcb_info(), inside Self::is_valid, timestamp_millis: {:#?}" , &timestamp_millis);
Copy link
Contributor

Choose a reason for hiding this comment

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

Together with the above suggestion of setting a target instead of just having the teerex in the string I suggest:

Suggested change
log::info!("teerex: called into runtime call register_tcb_info(), inside Self::is_valid.");
log::info!("teerex: called into runtime call register_tcb_info(), inside Self::is_valid, self is: {:#?}" , &self);
log::info!("teerex: called into runtime call register_tcb_info(), inside Self::is_valid, timestamp_millis: {:#?}" , &timestamp_millis);
log::info!(target: TEEREX, "Called into runtime call register_tcb_info(), inside Self::is_valid.");
log::info!(target: TEEREX, "self is: {:#?}" , &self);
log::info!(target: TEEREX, "timestamp_millis: {:#?}" , &timestamp_millis);

What do you think?

Copy link
Contributor

@clangenb clangenb left a comment

Choose a reason for hiding this comment

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

I think I would downgrade some logs to trace!, and also strip some of the info from some of the logs. I have mentioned two example cases, where I think this is true. :)

primitives/teerex/src/lib.rs Outdated Show resolved Hide resolved
teerex/sgx-verify/src/lib.rs Outdated Show resolved Hide resolved
teerex/src/lib.rs Outdated Show resolved Hide resolved
@OverOrion OverOrion requested a review from clangenb July 4, 2023 14:22
Copy link
Contributor

@clangenb clangenb left a comment

Choose a reason for hiding this comment

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

Thanks for the fixes! Looks good to me now!

teerex/src/lib.rs Outdated Show resolved Hide resolved
@clangenb
Copy link
Contributor

clangenb commented Jul 7, 2023

Sorry, for merging the other one first. I remember that Alain brought in a `log::info!("teerex: ***"), maybe you can fix this while resolving the conflicts. :)

@brenzi
Copy link
Contributor

brenzi commented Jul 8, 2023

can we await the merge of #191 and #193 plz?

@brenzi brenzi merged commit 89b310f into master Jul 14, 2023
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.

3 participants