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

Update StackOutputs fields #1268

Merged
merged 1 commit into from
Mar 5, 2024
Merged

Update StackOutputs fields #1268

merged 1 commit into from
Mar 5, 2024

Conversation

Fumuran
Copy link
Contributor

@Fumuran Fumuran commented Mar 4, 2024

This PR updates the fields of StackOutputs struct.
It changes them from Vec<u64> to Vec<Felt> to make them consistent with the stack values.

@Fumuran Fumuran linked an issue Mar 4, 2024 that may be closed by this pull request
Copy link
Contributor

@hackaugusto hackaugusto left a comment

Choose a reason for hiding this comment

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

LGTM

@Fumuran Fumuran force-pushed the andrew-update-stack-outputs branch 2 times, most recently from 4f7f8ca to 7dec536 Compare March 4, 2024 21:43
Copy link
Contributor

@bobbinth bobbinth 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! Thank you! I left a couple of small nits inline - after these, we can merge.

@@ -170,7 +170,7 @@ where
let program_info = ProgramInfo::new(program.hash(), kernel);

if fail {
outputs.stack_mut()[0] += 1;
outputs.stack_mut()[0] += Felt::new(1);
Copy link
Contributor

Choose a reason for hiding this comment

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

We can use just ONE here.

@@ -252,7 +252,7 @@ impl Test {

let program_info = ProgramInfo::from(program);
if test_fail {
stack_outputs.stack_mut()[0] += 1;
stack_outputs.stack_mut()[0] += Felt::new(1);
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as above.

/// Returns an error if:
/// - Any of the provided stack elements are invalid field elements.
/// - Any of the provided overflow addresses are invalid field elements.
pub fn try_from_values(stack: Vec<u64>, overflow_addrs: Vec<u64>) -> Result<Self, OutputError> {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I would rename this to try_from_ints.

@bobbinth
Copy link
Contributor

bobbinth commented Mar 5, 2024

Oh - and also, let's update the changelog.

@Fumuran Fumuran force-pushed the andrew-update-stack-outputs branch 2 times, most recently from 50e2e09 to 3677c75 Compare March 5, 2024 20:48
@Fumuran Fumuran force-pushed the andrew-update-stack-outputs branch from 3677c75 to 8c66eb0 Compare March 5, 2024 21:06
@Fumuran Fumuran merged commit 3b0d975 into next Mar 5, 2024
15 checks passed
@Fumuran Fumuran deleted the andrew-update-stack-outputs branch March 5, 2024 21:13
@@ -4,6 +4,7 @@

#### VM Internals
- Removed unused `find_lone_leaf()` function from the Advice Provider (#1262).
- Changed fields type of the `StackOutputs` struct from `Vec<u64>` to `Vec<Felt>` (#1268).
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a breaking change (i.e., it changes the public interface). We should mark it as such.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, Indeed, I merged this PR too early. Will it be OK if I make this change in the #1266 PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep - that's fine.

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.

Update StackOutputs fields
3 participants