Skip to content

chore: use attestation crate types#1744

Merged
gilcu3 merged 3 commits intomainfrom
1740-inconsistent-use-of-tcbinfo
Jan 13, 2026
Merged

chore: use attestation crate types#1744
gilcu3 merged 3 commits intomainfrom
1740-inconsistent-use-of-tcbinfo

Conversation

@gilcu3
Copy link
Contributor

@gilcu3 gilcu3 commented Jan 12, 2026

Closes #1740

@gilcu3 gilcu3 linked an issue Jan 12, 2026 that may be closed by this pull request
@DSharifi DSharifi self-requested a review January 13, 2026 08:35
Copy link
Contributor

@DSharifi DSharifi left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for the change!

Can you just add some unit tests, especially to tcb_info.rs, since some of these conversions now include more logic?

rtmr1: rtmr1.into(),
rtmr2: rtmr2.into(),
rtmr3: rtmr3.into(),
os_image_hash: os_image_hash.map(|v| v.into()).unwrap_or("".into()),
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of scope for this PR;

I think we should make this field nullable on the wire, I.E. an Option instead of using empty strings.

Copy link
Contributor

@DSharifi DSharifi left a comment

Choose a reason for hiding this comment

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

Looks good. Just please split up the unit test that tests 3 cases into separate tests.

}

#[test]
fn TcbInfo__should_succeed_tryfrom_DstackTcbInfo() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I see @netrome's double underscore style is gaining popularity

#[case("zae1e4", ParsingError::UnexpectedHexCharacter('z', 0))]
#[case("8ae1e4a", ParsingError::WrongLength(7))]
#[case("8ae1e4aa", ParsingError::WrongLength(8))]
fn hexbytes_should_fail_tryfrom_string(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

some rstest shenanigan here forced me to use snake case, else clippy complains

Copy link
Contributor

@kevindeforth kevindeforth left a comment

Choose a reason for hiding this comment

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

Approved, thank you!
But we need to be mindful about contract migration.
I would expect migration to fail if we have old attestations in the contract state, due to this line here:

tee_state: TeeState,

Since we don't have any Dstack attestations stored and plan on removing them from the contract altogether, I don't expect this to be a problem.

@gilcu3 gilcu3 added this pull request to the merge queue Jan 13, 2026
Merged via the queue into main with commit f8f38de Jan 13, 2026
15 checks passed
@gilcu3 gilcu3 deleted the 1740-inconsistent-use-of-tcbinfo branch January 13, 2026 13:57
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.

inconsistent use of TcbInfo

3 participants