-
Notifications
You must be signed in to change notification settings - Fork 151
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
Fog view client #3396
base: main
Are you sure you want to change the base?
Fog view client #3396
Conversation
* Update versions * Update lockfiles
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.
This change should probably be based only against master
. Currently this PR is trying to both merge 4.1.0 to master as well as bring in this new client.
Mostly nit comments
// Logging must go to stderr to not interfere with STDOUT | ||
std::env::set_var("MC_LOG_STDERR", "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.
❓ What is the negative affect this prevents? I commented it out and saw nothing negative.
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.
Initially I was thinking to make the final log lines be a json blob on stdout, but I ended up not doing that.
I still think it's usually good for tools to send logging to stderr.
//let mr_signer_verifier = | ||
// mc_fog_view_enclave_measurement::get_mr_signer_verifier(None); | ||
|
||
let mut verifier = Verifier::default(); | ||
verifier.debug(DEBUG_ENCLAVE); //.mr_signer(mr_signer_verifier); |
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 like there is some stray debug code here
//let mr_signer_verifier = | |
// mc_fog_view_enclave_measurement::get_mr_signer_verifier(None); | |
let mut verifier = Verifier::default(); | |
verifier.debug(DEBUG_ENCLAVE); //.mr_signer(mr_signer_verifier); | |
let mut verifier = Verifier::default(); | |
verifier.debug(DEBUG_ENCLAVE); |
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.
yeah we can do this -- honestly it may be better to try to ignore attestation as much as possible here.
|
||
match grpc_client.request(0, 0, vec![]) { | ||
Ok(resp) => { | ||
log::info!(logger, "Got response:\n{:?}", resp); |
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.
🙃 nit
log::info!(logger, "Got response:\n{:?}", resp); | |
log::info!(logger, "Got response:\n{resp:?}"); |
.iter() | ||
.map(|range| range.end_block - range.start_block + 1) | ||
.sum(); | ||
log::info!(logger, "Total missed blocks: {}", total_missed_blocks); |
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.
🙃
log::info!(logger, "Total missed blocks: {}", total_missed_blocks); | |
log::info!(logger, "Total missed blocks: {total_missed_blocks}"); |
log::info!(logger, "Total missed blocks: {}", total_missed_blocks); | ||
} | ||
Err(err) => { | ||
log::error!(logger, "Got error:\n{}", err); |
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.
🙃
log::error!(logger, "Got error:\n{}", err); | |
log::error!(logger, "Got error:\n{err}"); |
.build(), | ||
); | ||
|
||
log::info!(logger, "Fog view attestation verifier: {:?}", verifier); |
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.
log::info!(logger, "Fog view attestation verifier: {:?}", verifier); | |
log::info!(logger, "Fog view attestation verifier: {verifier:?}"); |
match grpc_client.request(0, 0, vec![]) { | ||
Ok(resp) => { |
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.
💭 This is good enough and seems to be inline with other outputs, but I'm curious who the intended audience is.
The reason is that the resp
, while plain text, is not very ergonomic for human scanning as it is one line that is 7000 characters long.
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.
we can make it debug log instead
I created this client in order to dump summary stats from the fog-view response.
I got the following results:
If I understand right, this means that mc-mainnet fog has never had a missed block event. That is frankly amazing.
TODO: I would like to be able to hit signal fog this way too.