question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RFC: Decouple Protostar from StarkNet

See original GitHub issue

Protostar is heavily coupled with StarkNet which:

  • increases maintenance and modification cost
  • delays releases relatively to cairo-lang
  • makes the boundary between Protostar and StarkNet vague

This proposal suggest:

  • introducing an abstract module (protostar.blockchain) between Protostar and StarkNet
    • StarkNet internals are unstable, hence shouldn’t be used as a dependency

      The dependencies between packages should be in the direction of the stability of the packages. A package should only depend upon packages that are more stable than it is. https://wiki.c2.com/?StableDependenciesPrinciple

    • Abstraction represents Protostar’s expectations from StarkNet, which could allow us to move some parts of the adapter to the cairo-lang package reducing the maintenance cost
    • better modularity improves work separation / code ownership
    • improved testability removes the need for creating integration tests when it’s not necessary resulting in faster tests
    • recreating Protostar and StarkNet in Rust is going to be easier if both teams know interface ahead
  • keeping Protostar state in the TestExecutionState rather than in the adapter module
    • currently, part of the state is kept in the TestExecuteState (e.g. TestContext) and other part in CheatableState for unknown reasons

Image

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
mkaputcommented, Oct 10, 2022

We have to discuss this F2F soon.

1reaction
kasperski95commented, Sep 15, 2022

I’d say Commander is an abstraction over Cheaters.

BlockInfoCheater leaks StarkNet implementation details in its name.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Testing StarkNet contracts made easy with Protostar
Testing StarkNet contracts made easy with Protostar. In this article, I would like to introduce you to using Protostar for writing smart contracts...
Read more >
Journey Through Cairo VIII — Writing And Deploying your first ...
Write a simple Starknet contract with Cairo. Understand Events, Constructors, External and View functions. Deploy your contract using Protostar.
Read more >
Testing your StarkNet contracts with Protostar — Only Dust
In this article, I will give some tips to write unit tests with Protostar efficiently, and some proposal to design complicated tests and...
Read more >
Deploy a simple storage smart contract on StarkNet - Chainstack
From the project main directory, run the following command to compile. You will receive a success message if the contract is compiled correctly....
Read more >
StarkNet - Starkware
StarkNet is a permissionless decentralized Validity-Rollup (often referred to as ZK-Rollup). It operates as an L2 network over Ethereum, enabling any dApp ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found