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

add support for return data #63

Merged
merged 4 commits into from
Dec 10, 2024
Merged

add support for return data #63

merged 4 commits into from
Dec 10, 2024

Conversation

2501babe
Copy link
Member

@2501babe 2501babe commented Dec 6, 2024

using this for minimum delegation tests with normal mollusk, i didnt modify any of the fuzz types since im not sure what support is needed for those

Copy link
Collaborator

@buffalojoec buffalojoec left a comment

Choose a reason for hiding this comment

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

Change looks good, but I think we need to extend the support to the fuzzing features.

@@ -94,6 +94,7 @@ impl From<&FuzzEffects> for InstructionResult {
execution_time,
program_result,
raw_result,
return_data: None, // TODO: Omitted for now.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add this field to the non-Firedancer protobuf and fixture lib? It should be pretty simple, let's just do Vec<u8> like FD does.

Now that the Mollusk result type tracks return data, the Mollusk-based fixture effects should also.

@@ -235,6 +235,7 @@ fn parse_fixture_effects(
.compute_budget
.compute_unit_limit
.saturating_sub(effects.compute_units_available),
return_data: None, // TODO: Omitted for now.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Have you seen fixtures in the Firedancer test-vectors that test the return data for Stake? If so, we might want to add this to the Firedancer support here.

I can get a test going that actually runs against real test vectors to make sure this thing actually works, and you could rebase onto it if you want.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Here's the PR: #65

Copy link
Member Author

Choose a reason for hiding this comment

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

yea a lot of the fixtures contain expected return data for GetMinimumDelegation, i just havent looked through the fuzz and fd-fuzz code yet to see what support is needed since my usecase only depends on harness. will do that tho

Copy link
Collaborator

Choose a reason for hiding this comment

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

You shouldn't even have to mess with the fuzz-related crates, the change(s) should be local to the main harness's fuzz dir.

But lmk if you want me to land my stuff first, so we have the coverage.

@buffalojoec buffalojoec added v2.0 Backport to solana-v2.0 v1.18 Backport to solana-v1.18 labels Dec 10, 2024
@2501babe 2501babe requested a review from buffalojoec December 10, 2024 09:32
@2501babe
Copy link
Member Author

ok it took me a couple tries but i think i got it now haha

Copy link
Collaborator

@buffalojoec buffalojoec left a comment

Choose a reason for hiding this comment

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

Looks perfect. Thank you!!

@@ -191,7 +193,7 @@ fn build_fixture_effects(context: &FuzzContext, result: &InstructionResult) -> F
compute_units_available: context
.compute_units_available
.saturating_sub(result.compute_units_consumed),
return_data: Vec::new(), // TODO: Mollusk doesn't capture return data.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Niceeee

@buffalojoec buffalojoec merged commit 2be6299 into anza-xyz:main Dec 10, 2024
4 checks passed
buffalojoec pushed a commit that referenced this pull request Dec 10, 2024
buffalojoec pushed a commit that referenced this pull request Dec 10, 2024
@2501babe 2501babe deleted the ret-data branch December 11, 2024 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v1.18 Backport to solana-v1.18 v2.0 Backport to solana-v2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants