-
Notifications
You must be signed in to change notification settings - Fork 209
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
Verify new message type2 #1452
Verify new message type2 #1452
Conversation
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.
Left a few small comments but overall looks good.
We should implement the message type check though before merging to master
cosmwasm/enclaves/shared/block-verifier/src/verify/registration.rs
Outdated
Show resolved
Hide resolved
} | ||
Err(e) => { | ||
debug!("Error decoding registation protobuf: {}", e); | ||
error!("Error decoding msg from block validator - 0xA0F2"); |
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's the deal with this hex 0xA0F2
?
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.
I kind of like adding random error codes - makes finding the exact error easier in a month or two when someone randomly pastes their error. Also we can one day create a codex of error codes & their meaning/more info, etc.
use protobuf::Message; | ||
|
||
pub fn verify_reg_msg(certificate: &[u8]) -> bool { | ||
let mut verified_msgs = VERIFIED_MESSAGES.lock().unwrap(); |
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.
Not relevant specifically to this PR but just a thought, should we log a certain error in case this lock().unwrap()
fails? Debugging this would be hell
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.
I actually think it would be kind of dramatic, as this would mean a failure in the lock or something? Not sure when this is even possible
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, it's going to give no details if it fails, but it should never fail.
No description provided.