starknet-foundry
starknet-foundry copied to clipboard
Always use data transformer unless `--calldata` is passed
Currently, in the calldata serialization logic in sncast we only try to use data transformer if --arguments flag is prezent. If not, and no --calldata was provided, an empty vec is used as calldata and the transaction fails after execution attempt.
The logic should be changed, so if no --arguments flag is provided, data transformer is called but with an empty vec. This way instead of provider (starknet) error, the user will be shown a nice, data transformer error.
In https://github.com/foundry-rs/starknet-foundry/blob/8ce451e58b1305f7e6769451a18412970157dc1a/crates/sncast/src/main.rs#L168 update the logic, so Ok(vec![]) fallback is removed. If calldata is some, use it, otherwise always call Calldata::new(arguments).serialized(contract_class, selector) and, if not arguments were provided by the user, provide empty vec![] as arguments.
Additionaly, introduce an e2e test verifying that even if no --arguments or --calldata is provided and a called contract expects calldata, relevant error from data transformer (Calldata::new(arguments).serialized(contract_class, selector)) is displayed and/or update any relevant existing tests.
@cptartur hey I would like to work on this .
Hey, this issue will be available for taking during the ODBoost https://app.onlydust.com/hackathons/odboost-1. If you are still interested in tacking on this one, please apply after the ODBoost start tomorrow after 3 PM CET.
Can I contribute to this one?
Can I contribute to this one?
Would love do this.
Is it okay if I take this?
I’d like to help with this.
Application for Contribution
I am excited about the opportunity to contribute to this issue and am confident that my expertise aligns well with the requirements. With a strong background in Cairo programming and decentralized application development on StarkNet, I bring a well-rounded skill set to deliver an effective solution.
Relevant Expertise
- Blockchain & Smart Contracts: Extensive experience with StarkNet, Stellar, and Rust, specializing in developing secure and optimized smart contracts, blockchain integrations, and high-performance backend infrastructure.
- Backend Development: Well-versed in API design, server-side logic, and scalable system architecture, ensuring efficient and seamless backend performance.
- Frontend Engineering: Skilled in crafting interactive and responsive UI components using React and Next.js, enhancing the user experience for blockchain-based platforms.
Why Consider My Application?
My proven track record of delivering high-quality, optimized solutions in blockchain and full-stack development sets me apart. I have a deep understanding of smart contract security, decentralized architectures, and the synergy between frontend, backend, and blockchain layers—ensuring a seamless and efficient implementation.
ETA
I expect to have a working solution ready within 48 hours. Please let me know if I can proceed with the implementation.
Is it okay if I take this?
Hey @emarc99 assigning to you. If you are no longer interesed in taking on this one, please let me know.
Thanks for the opportunity to do this. I am definitely taking this, sir!
@emarc99 okay, please open a draft PR soon.
@emarc99 please open a (draft) PR today or we'll have to remove the assignment due to inactivity.
@emarc99 removing assignment due to inactivity.
I'm still working, sir. Thouht you meant EoD today?
Currently running tests.
Mind if I take this issue?
Can I have this issue? I plan to implement a implement calldata is some check before passing an empty vec as args
Can I try solving this issue?
Could I try solving this?
@cptartur , apologies for not showing activities, running the e2e tests under sncast directory alone takes 2 hours on my PC (WSL linux). 25 tests unrelated to calldata or argument in the sncast kept failing. While debugging, I have almost maxed out my February allocated github codespace usage (>75%). So, I am treading carefully on my PC. I will appreciate you reviewing my new PR that will be opened when I successfully achieved the feature, in the case you have not reassigned the issue.
Kindly signify if I should not bother handling this issue anymore, thanks. 👍
Can I take this issue? first time contributor
@cptartur , apologies for not showing activities, running the e2e tests under
sncastdirectory alone takes 2 hours on my PC (WSL linux). 25 tests unrelated to calldata or argument in thesncastkept failing. While debugging, I have almost maxed out my February allocated github codespace usage (>75%). So, I am treading carefully on my PC. I will appreciate you reviewing my new PR that will be opened when I successfully achieved the feature, in the case you have not reassigned the issue.Kindly signify if I should not bother handling this issue anymore, thanks. 👍
@emarc99 we will gladly accept a contribution that is working (i.e. all tests are passing and relevant changes were introduced). Please note, this would not count as an ODBoost contribution.
Alright. Duly noted.