Skip to content
This repository was archived by the owner on Aug 3, 2026. It is now read-only.

Commit ec8a925

Browse files
Fix assertion (#641)
Co-authored-by: smtmfft <99081233+smtmfft@users.noreply.github.com>
1 parent 87a1c86 commit ec8a925

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

lib/src/builder.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ fn validate_final_batch_blocks(input: &GuestBatchInput, final_blocks: &[Block])
109109
);
110110
assert!(
111111
parent_block.header.state_root == current_input.parent_header.state_root,
112-
"Parent hash mismatch, expected: {}, got: {}",
113-
parent_block.header.hash_slow(),
114-
current_block.header.parent_hash
112+
"State root mismatch, expected: {}, got: {}",
113+
parent_block.header.state_root,
114+
current_input.parent_header.state_root
115115
);
116116
// state root is checked in finalize(), skip here
117117
// assert!(current_block.state_root == current_input.block.state_root)

provers/sgx/prover/src/sgx_register_utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ sol! {
134134
}
135135

136136
fn little_endian_decode(encoded: &[u8]) -> u64 {
137-
assert!(encoded.len() <= 8, "encoded bytes should be less than 8");
137+
assert!(encoded.len() <= 8, "encoded bytes should be less than or equal to 8");
138138
let mut decoded = 0;
139139
for (i, byte) in encoded.iter().enumerate() {
140140
let digits = *byte as u64;
@@ -151,7 +151,7 @@ fn little_endian_decode(encoded: &[u8]) -> u64 {
151151
}
152152

153153
fn parse_quote_header(quote_bytes: &[u8]) -> Result<Header, Box<dyn std::error::Error>> {
154-
assert!(quote_bytes.len() > 48, "quote bytes should be at least 48");
154+
assert!(quote_bytes.len() >= 48, "quote bytes should be at least 48");
155155
let version = &quote_bytes[0..2];
156156
let attestation_key_type = &quote_bytes[2..4];
157157
let tee_type = &quote_bytes[4..8];

0 commit comments

Comments
 (0)