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

Test for multiple writes/reads to the same storage slot #1559

Open
Arcticae opened this issue Jan 18, 2024 · 14 comments · May be fixed by #2874
Open

Test for multiple writes/reads to the same storage slot #1559

Arcticae opened this issue Jan 18, 2024 · 14 comments · May be fixed by #2874

Comments

@Arcticae
Copy link
Contributor

Arcticae commented Jan 18, 2024

Which components does the task require to be changed? (think hard pls)

snforge

Description

We should ensure (in the tests) that multiple writes/reads across multiple contracts in the tests is not possible

Step 1

pub storage_view: HashMap<StorageEntry, Felt>,

should be modified (in order to ensure that this test fail before that):
storage_view field is a mapping from a pair (contract_address, key) to a felt, modify it to map only key to felt (don't commit!)

Step 2

Deploy following contracts in the tests (these can be contained in the same class hash, just 2 different deployments):

Contract A:
  - storage with "x" name
Contract B
  - storage with "x" name

Step 3

Write a following test:

  1. Call contract "A" (write to x a value)
  2. Call contract "B" (read x to a value)
  3. Verify that the read value is not equal to the just-input value

Context

This surfaced as we tried to perform step 1, and the CI did not fail in the process

@Arcticae Arcticae moved this to Triage in Starknet foundry Jan 18, 2024
@github-actions github-actions bot added the new label Jan 18, 2024
@Arcticae Arcticae moved this from Triage to Backlog in Starknet foundry Jan 22, 2024
@Arcticae Arcticae added good first issue Good for newcomers and removed new labels Jan 22, 2024
@Arcticae Arcticae moved this from Backlog to Triage in Starknet foundry Jan 29, 2024
@greged93
Copy link

greged93 commented Feb 5, 2024

hey, I'm down to try to work on this

@Arcticae Arcticae moved this from Triage to Backlog in Starknet foundry Mar 5, 2024
@Arcticae Arcticae moved this from Backlog to Triage in Starknet foundry May 22, 2024
@moteeullahazmi
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I can leverage my deep technical understanding and problem-solving expertise to assist in modifying contract storage mappings, developing rigorous test cases, and ensuring efficient debugging for the task at hand.

How I plan on tackling this issue

I would approach the problem by modifying the storage_view mapping, deploying the test contracts with shared keys, and writing a test to verify that the storage isolation is correctly enforced.

Copy link

onlydustapp bot commented Aug 26, 2024

The maintainer Arcticae has assigned moteeullahazmi to this issue via OnlyDust Platform.
Good luck!

@hannahredler
Copy link

hannahredler commented Nov 6, 2024

I am applying to this issue via OnlyDust platform.

Hey! I'm a full stack developer with several years web3 experience but fairly new to the Starknet ecosystem. Would love to take this on if its available!

I plan to check out the issue and write some tests that are failing at first to ensure the problem is found, and then ensuring all cases are covered.

@OWK50GA
Copy link

OWK50GA commented Nov 7, 2024

I'd like to handle this task.

@PedroRosalba
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

How I plan on tackling this issue

@cptartur
Copy link
Member

cptartur commented Dec 3, 2024

@hannahredler unassigning due to inactivity

@cptartur cptartur moved this from In Progress to Triage in Starknet foundry Dec 3, 2024
@RomThpt
Copy link

RomThpt commented Dec 6, 2024

Can I be assigned to this?

@cptartur
Copy link
Member

@OWK50GA are you still interested in tackling this one?

@olisaagbafor
Copy link

Can I contribute to this one?

@GideonBature
Copy link

May I try my hand at this?

@cptartur cptartur moved this from Triage to Backlog in Starknet foundry Jan 17, 2025
@cptartur
Copy link
Member

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.

@beeguy74
Copy link

Hi, I am a beginner Cairo developer from Paris.
Closed 3 tasks totally on cairo during previos ODHACK 11.
I don't promise to finish the issue quickly because your project is new to me =)
But I intend to do a decent job and at least do the draft PR within 24 hours.
Could I try solving this?

@beeguy74
Copy link

beeguy74 commented Jan 23, 2025

Hi! Thanks for trusting me, I've started work! I ran into a lack of performance on my pc during the build phase of the project locally, but I solved it with a vps. Today I'll create a draft so you can see the progress.

@beeguy74 beeguy74 linked a pull request Jan 24, 2025 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

Successfully merging a pull request may close this issue.