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

Verify new message type2 #1452

Merged
merged 6 commits into from
Jun 1, 2023
Merged

Verify new message type2 #1452

merged 6 commits into from
Jun 1, 2023

Conversation

Cashmaney
Copy link
Member

No description provided.

toml01
toml01 previously approved these changes May 29, 2023
Copy link
Member

@toml01 toml01 left a 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

}
Err(e) => {
debug!("Error decoding registation protobuf: {}", e);
error!("Error decoding msg from block validator - 0xA0F2");
Copy link
Member

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?

Copy link
Member Author

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();
Copy link
Member

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

Copy link
Member Author

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

Copy link
Member

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.

cosmwasm/enclaves/execute/Cargo.toml Outdated Show resolved Hide resolved
@Cashmaney Cashmaney merged commit b6572e6 into master Jun 1, 2023
@Cashmaney Cashmaney deleted the verify-new-message-type2 branch June 1, 2023 07:02
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