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

bug: retdata is not a Relocatable #392

Open
2 tasks done
whichqua opened this issue Oct 1, 2024 · 1 comment
Open
2 tasks done

bug: retdata is not a Relocatable #392

whichqua opened this issue Oct 1, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@whichqua
Copy link
Collaborator

whichqua commented Oct 1, 2024

Affected blocks

This issue can be observed in the following blocks:

  • 160079
  • 160033

Background

  • This issue seems to specifically affect deploy syscalls called in an invoke transaction.
  • It occurs in this hint:
pub const CHECK_NEW_DEPLOY_RESPONSE: &str = indoc! {r#"
	# Check that the actual return value matches the expected one.
	expected = memory.get_range(
	    addr=ids.response.constructor_retdata_start,
	    size=ids.response.constructor_retdata_end - ids.response.constructor_retdata_start,
	)
	actual = memory.get_range(addr=ids.retdata, size=ids.retdata_size)
	assert expected == actual, f'Return value mismatch; expected={expected}, actual={actual}.'"#
};
  • The issue seems to constructor_args being an empty vector.

Next steps

  • Write integration tests covering deploy_contact syscall in an invoke transaction.
  • Attempt to do a deploy with empty args?
@whichqua whichqua added the bug Something isn't working label Oct 1, 2024
@whichqua
Copy link
Collaborator Author

whichqua commented Oct 4, 2024

This test was added to the test_contract.cairo via this commit.

    #[external(v0)]
    fn test_deploy_no_calldata(
        self: @ContractState,
        class_hash: ClassHash,
        contract_address_salt: felt252,
        deploy_from_zero: bool,
    ) {
        let calldata: Array::<felt252> = Default::default();
        syscalls::deploy_syscall(
            class_hash, contract_address_salt, calldata.span(), deploy_from_zero
        )
            .unwrap_syscall();
    }

This test fails showing there is an issue when handling deploying contracts without constructor_call_data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant