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

Implement Cargo Stylus Developer Tool #93

Closed
wants to merge 65 commits into from
Closed

Conversation

rauljordan
Copy link
Contributor

@rauljordan rauljordan commented Jul 26, 2023

See the design document here

Overview

This PR implements the cargo stylus developer tool's foundations, with two subcommands to start with:

cargo stylus check: checks if a contract can be brotli compressed to <= 24kb and if it can compile correctly onchain by using an eth_call with state overrides
cargo stylus deploy: attempts to submit deploy + compile txs for a stylus program to an Arbitrum backend. A user can also choose to separate out both steps, or just run gas estimates.

The deploy function creates a local signer based on either a private key file or a keystore path and keystore password file path

How to Try It

Inside the cargo-stylus folder:

cargo install --path .

To try the PR, another branch exists called test-cargo-stylus with a Stylus system test which just spins up a node which hangs forever, exposing an HTTP RPC endpoint at localhost:9999. This means the CLI tool can be used to perform these actions.

Run it with:

go test ./system_tests -run=TestStylusCargo -v

The branch is test-cargo-stylus. Navigate to any arbitrator/stylus/tests/ folder, then save the deployer private key (ArbOwner test fixture) in a file called privkey

009f3fd6848015f83b9210c89f7744e3941acae1195c8bf9f5798c090dc8f497

then run:

cargo stylus deploy --private-key-path=privkey --endpoint=http://localhost:9999

@codecov
Copy link

codecov bot commented Jul 26, 2023

Codecov Report

Merging #93 (6e4feff) into stylus (b91e322) will decrease coverage by 0.02%.
Report is 1 commits behind head on stylus.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           stylus      #93      +/-   ##
==========================================
- Coverage   56.00%   55.98%   -0.02%     
==========================================
  Files         272      272              
  Lines       41398    41387      -11     
==========================================
- Hits        23183    23169      -14     
- Misses      15832    15837       +5     
+ Partials     2383     2381       -2     

arbitrator/cargo-stylus/src/project.rs Outdated Show resolved Hide resolved
arbitrator/cargo-stylus/src/check.rs Outdated Show resolved Hide resolved
@rauljordan rauljordan closed this Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants