Skip to content

Commit

Permalink
Merge branch 'main' into rpc-unix
Browse files Browse the repository at this point in the history
  • Loading branch information
Exca-DK committed Dec 15, 2023
2 parents 7ca7ee9 + 23bcc52 commit 3a41f24
Show file tree
Hide file tree
Showing 163 changed files with 47,669 additions and 40,611 deletions.
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "cargo"
directory: "/vm/rust"
schedule:
interval: "daily"
- package-ecosystem: "npm"
directory: "/docs"
schedule:
interval: "weekly"
31 changes: 17 additions & 14 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,27 +59,26 @@ jobs:
IMAGE_TAG: ${{ needs.docker_build_and_publish.outputs.IMAGE_TAG }}
GOERLI: apps/juno-dev/overlays/dev-goerli-1/config.yaml
INTEGRATION: apps/juno-dev/overlays/dev-integration/config.yaml
MAINNET: apps/juno-dev/overlays/dev-mainnet/config.yaml
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token ${{ secrets.ACCESS_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/NethermindEth/argo/dispatches \
-d '{"event_type": "${{ env.EVENT_NAME }}", "client_payload":{"name": "${{ env.EVENT_NAME }}", "goerli_config": "${{ env.GOERLI }}", "integration_config": "${{ env.INTEGRATION }}", "mainnet_config": "${{ env.MAINNET }}", "tag": "${{ env.IMAGE_TAG }}"}}'
-d '{"event_type": "${{ env.EVENT_NAME }}", "client_payload":{"name": "${{ env.EVENT_NAME }}", "goerli_config": "${{ env.GOERLI }}", "integration_config": "${{ env.INTEGRATION }}", "tag": "${{ env.IMAGE_TAG }}"}}'
dev-starknet-rs-tests:
needs: [deploy_to_dev]
uses: ./.github/workflows/starknet-rs-tests.yml
secrets:
STARKNET_RPC: ${{ secrets.DEV_GOERLI_URL }}/v0_4
STARKNET_RPC: ${{ secrets.DEV_GOERLI_URL }}/v0_6

dev-starknet-js-tests:
needs: [deploy_to_dev]
uses: ./.github/workflows/starknet-js-tests.yml
secrets:
TEST_RPC_URL: ${{ secrets.DEV_GOERLI_URL }}/v0_4
TEST_RPC_URL: ${{ secrets.DEV_GOERLI_URL }}/v0_5
TEST_ACCOUNT_ADDRESS: ${{ secrets.GOERLI_TEST_ACCOUNT_ADDRESS }}
TEST_ACCOUNT_PRIVATE_KEY: ${{ secrets.GOERLI_TEST_ACCOUNT_PRIVATE_KEY }}

Expand All @@ -96,26 +95,28 @@ jobs:
GOERLI: apps/juno-staging/overlays/staging-goerli-1/config.yaml
INTEGRATION: apps/juno-staging/overlays/staging-integration/config.yaml
MAINNET: apps/juno-staging/overlays/staging-mainnet/config.yaml
SEPOLIA: apps/juno-staging/overlays/staging-sepolia/config.yaml
SEPOLIA-INTEGRATION: apps/juno-staging/overlays/staging-sepolia-integration/config.yaml
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token ${{ secrets.ACCESS_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/NethermindEth/argo/dispatches \
-d '{"event_type": "${{ env.EVENT_NAME }}", "client_payload":{"name": "${{ env.EVENT_NAME }}", "goerli_config": "${{ env.GOERLI }}", "integration_config": "${{ env.INTEGRATION }}", "mainnet_config": "${{ env.MAINNET }}", "tag": "${{ env.IMAGE_TAG }}"}}'
-d '{"event_type": "${{ env.EVENT_NAME }}", "client_payload":{"name": "${{ env.EVENT_NAME }}", "goerli_config": "${{ env.GOERLI }}", "integration_config": "${{ env.INTEGRATION }}", "mainnet_config": "${{ env.MAINNET }}", "sepolia_config": "${{ env.SEPOLIA }}", "sepolia_integration_config": "${{ env.SEPOLIA-INTEGRATION}}", "tag": "${{ env.IMAGE_TAG }}"}}'
staging-starknet-rs-tests:
needs: [deploy_to_staging]
uses: ./.github/workflows/starknet-rs-tests.yml
secrets:
STARKNET_RPC: ${{ secrets.STAGING_GOERLI_URL }}/v0_4
STARKNET_RPC: ${{ secrets.STAGING_GOERLI_URL }}/v0_6

staging-starknet-js-tests:
needs: [deploy_to_staging]
uses: ./.github/workflows/starknet-js-tests.yml
secrets:
TEST_RPC_URL: ${{ secrets.STAGING_GOERLI_URL }}/v0_4
TEST_RPC_URL: ${{ secrets.STAGING_GOERLI_URL }}/v0_5
TEST_ACCOUNT_ADDRESS: ${{ secrets.GOERLI_TEST_ACCOUNT_ADDRESS }}
TEST_ACCOUNT_PRIVATE_KEY: ${{ secrets.GOERLI_TEST_ACCOUNT_PRIVATE_KEY }}

Expand All @@ -129,28 +130,30 @@ jobs:
env:
EVENT_NAME: juno-prod
IMAGE_TAG: ${{ needs.docker_build_and_publish.outputs.IMAGE_TAG }}
GOERLI: apps/juno-prod/overlays/prod_goerli-1/config.yaml
INTEGRATION: apps/juno-prod/overlays/prod_integration/config.yaml
MAINNET: apps/juno-prod/overlays/prod_mainnet/config.yaml
GOERLI: apps/juno-prod/overlays/prod-goerli-1/config.yaml
INTEGRATION: apps/juno-prod/overlays/prod-integration/config.yaml
MAINNET: apps/juno-prod/overlays/prod-mainnet/config.yaml
SEPOLIA: apps/juno-prod/overlays/prod-sepolia/config.yaml
SEPOLIA-INTEGRATION: apps/juno-prod/overlays/prod-sepolia-integration/config.yaml
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token ${{ secrets.ACCESS_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/NethermindEth/argo/dispatches \
-d '{"event_type": "${{ env.EVENT_NAME }}", "client_payload":{"name": "${{ env.EVENT_NAME }}", "goerli_config": "${{ env.GOERLI }}", "integration_config": "${{ env.INTEGRATION }}", "mainnet_config": "${{ env.MAINNET }}", "tag": "${{ env.IMAGE_TAG }}"}}'
-d '{"event_type": "${{ env.EVENT_NAME }}", "client_payload":{"name": "${{ env.EVENT_NAME }}", "goerli_config": "${{ env.GOERLI }}", "integration_config": "${{ env.INTEGRATION }}", "mainnet_config": "${{ env.MAINNET }}", "sepolia_config": "${{ env.SEPOLIA }}", "sepolia_integration_config": "${{ env.SEPOLIA-INTEGRATION }}", "tag": "${{ env.IMAGE_TAG }}"}}'
prod-starknet-rs-tests:
needs: [deploy_to_production]
uses: ./.github/workflows/starknet-rs-tests.yml
secrets:
STARKNET_RPC: ${{ secrets.PROD_GOERLI_URL }}/v0_4
STARKNET_RPC: ${{ secrets.PROD_GOERLI_URL }}/v0_6

prod-starknet-js-tests:
needs: [deploy_to_production]
uses: ./.github/workflows/starknet-js-tests.yml
secrets:
TEST_RPC_URL: ${{ secrets.PROD_GOERLI_URL }}/v0_4
TEST_RPC_URL: ${{ secrets.PROD_GOERLI_URL }}/v0_5
TEST_ACCOUNT_ADDRESS: ${{ secrets.GOERLI_TEST_ACCOUNT_ADDRESS }}
TEST_ACCOUNT_PRIVATE_KEY: ${{ secrets.GOERLI_TEST_ACCOUNT_PRIVATE_KEY }}
6 changes: 4 additions & 2 deletions .github/workflows/juno-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
fail-fast: false
matrix:
go: [ '1.21' ]
os: [ ubuntu-latest, macOS-latest, self-hosted-linux-arm64]
os: [ ubuntu-latest, macos-latest, self-hosted-linux-arm64]
runs-on: ${{ matrix.os }}
env:
VM_DEBUG: true
Expand All @@ -28,7 +28,9 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: vm/rust
workspaces: |
vm/rust
core/rust
- name: Install deps
run: make install-deps
- name: Tests
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/starknet-js-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
required: false
TEST_ACCOUNT_PRIVATE_KEY:
required: false

jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -18,7 +18,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: starknet-io/starknet.js
ref: v5.19.5
ref: v5.24.3

- name: Setup Node.js
uses: actions/setup-node@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/starknet-rs-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: xJonathanLEI/starknet-rs
ref: starknet/v0.6.0
ref: 0df9ad3417a5f10d486348737fe75659ca4bcfdc

- name: Setup Rust
uses: actions-rs/toolchain@v1
Expand All @@ -26,6 +26,6 @@ jobs:
- name: Run jsonrpc tests
run: |
cd starknet-providers && cargo test jsonrpc
cd ../starknet-accounts && cargo test jsonrpc -- --skip can_declare_cairo0_contract_with_jsonrpc
cd ../starknet-accounts && cargo test jsonrpc
env:
STARKNET_RPC: ${{ secrets.STARKNET_RPC }}
22 changes: 15 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,40 @@ else
VM_TARGET = all
endif

juno: vm ## compile
ifeq ($(shell uname -s),Darwin)
export CGO_LDFLAGS=-framework Foundation -framework SystemConfiguration
endif

juno: vm core-rust ## compile
@mkdir -p build
@go build $(GO_TAGS) -a -ldflags="-X main.Version=$(shell git describe --tags)" -o build/juno ./cmd/juno/

vm:
$(MAKE) -C vm/rust $(VM_TARGET)

core-rust:
$(MAKE) -C core/rust $(VM_TARGET)

generate: ## generate
mkdir -p mocks
go generate ./...

clean-testcache:
go clean -testcache

test: clean-testcache vm ## tests
test: clean-testcache vm core-rust ## tests
go test $(GO_TAGS) ./...

test-cached: vm ## tests with existing cache
test-cached: vm core-rust ## tests with existing cache
go test $(GO_TAGS) ./...

test-race: clean-testcache vm
test-race: clean-testcache vm core-rust
go test $(GO_TAGS) ./... -race

benchmarks: vm ## benchmarking
benchmarks: vm core-rust ## benchmarking
go test $(GO_TAGS) ./... -run=^# -bench=. -benchmem

test-cover: vm ## tests with coverage
test-cover: vm core-rust ## tests with coverage
mkdir -p coverage
go test $(GO_TAGS) -coverpkg=./... -coverprofile=coverage/coverage.out -covermode=atomic ./...
go tool cover -html=coverage/coverage.out -o coverage/coverage.html
Expand Down Expand Up @@ -64,7 +71,8 @@ format: ## run go formatter

clean: ## clean project builds
$(MAKE) -C vm/rust clean
$(MAKE) -C core/rust clean
@rm -rf ./build

help: ## show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
56 changes: 40 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

> **πŸ“Œ Looking for a Starknet RPC Provider?**
>
> If you are searching for a Starknet RPC provider, Nethermind is introducing a Starknet RPC service ahead of the upcoming feeder gateway deprecation. You can register your interest on [this Google Form](https://docs.google.com/forms/d/e/1FAIpQLSf2Bl4fc9-38E-fpWf0tnMWc3jSeOFkpjSPMN_j1en1WmEgKg/viewform?usp=sf_link).
> Access Nethermind's Starknet RPC service for free at https://data.voyager.online.
## βš™οΈ Installation

Expand Down Expand Up @@ -94,19 +94,13 @@ Use the provided snapshots to quickly sync your Juno node with the current state

| Version | Size | Block | Download Link |
| ------- | ---- | ----- | ------------- |
| **>=v0.6.0** | **92 GB** | **313975** | [**juno_mainnet_313975.tar**](https://juno-snapshots.nethermind.dev/mainnet/juno_mainnet_v0.6.5_313975.tar) |
| **>=v0.6.0** | **121 GB** | **449406** | [**juno_mainnet.tar**](https://juno-snapshots.nethermind.dev/mainnet/juno_mainnet_v0.7.5_449406.tar) |

#### Goerli

| Version | Size | Block | Download Link |
| ------- | ---- | ----- | ------------- |
| **>=v0.6.0** | **36 GB** | **850192** | [**juno_goerli_850192.tar**](https://juno-snapshots.nethermind.dev/goerli/juno_goerli_v0.6.0_850192.tar) |

#### Goerli2

| Version | Size | Block | Download Link |
| ------- | ---- | ----- | ------------- |
| **>=v0.6.0** | **4.6 GB** | **139043** | [**juno_goerli2_135973.tar**](https://juno-snapshots.nethermind.dev/goerli2/juno_goerli2_v0.6.0_139043.tar) |
| **>=v0.6.0** | **41.4 GB** | **911580** | [**juno_goerli.tar**](https://juno-snapshots.nethermind.dev/goerli/juno_goerli_v0.7.5_911580.tar) |

### Run Juno Using Snapshot

Expand All @@ -115,7 +109,7 @@ Use the provided snapshots to quickly sync your Juno node with the current state
Fetch the snapshot from the provided URL:

```bash
wget -O juno_mainnet_313975.tar https://juno-snapshots.nethermind.dev/mainnet/juno_mainnet_v0.6.5_313975.tar
wget -O juno_mainnet.tar https://juno-snapshots.nethermind.dev/mainnet/juno_mainnet_v0.7.5_449406.tar
```

2. **Prepare Directory**
Expand All @@ -131,7 +125,7 @@ Use the provided snapshots to quickly sync your Juno node with the current state
Extract the contents of the `.tar` file:

```bash
tar -xvf juno_mainnet_313975.tar -C $HOME/snapshots
tar -xvf juno_mainnet.tar -C $HOME/snapshots
```

4. **Run Juno**
Expand All @@ -146,6 +140,7 @@ Use the provided snapshots to quickly sync your Juno node with the current state
nethermind/juno \
--http \
--http-port 6060 \
--http-host 0.0.0.0 \
--db-path /var/lib/juno \
--eth-node <YOUR-ETH-NODE>
```
Expand All @@ -154,8 +149,8 @@ After following these steps, Juno should be up and running on your machine, util

## βœ” Supported Features

- Starknet [v0.12.2](https://docs.starknet.io/documentation/starknet_versions/version_notes/) support.
- JSON-RPC [v0.5.0](https://github.com/starkware-libs/starknet-specs/releases/tag/v0.5.0)(Available under `/v0_5` endpoint)
- Starknet [v0.13.0](https://docs.starknet.io/documentation/starknet_versions/version_notes/) support.
- JSON-RPC [v0.6.0](https://github.com/starkware-libs/starknet-specs/releases/tag/v0.6.0) (Available under `/v0_6` endpoint)
- `starknet_chainId`
- `starknet_blockNumber`
- `starknet_blockHashAndNumber`
Expand Down Expand Up @@ -187,7 +182,7 @@ After following these steps, Juno should be up and running on your machine, util

- Juno's JSON-RPC:
- `juno_version`
- JSON-RPC [v0.4.0](https://github.com/starkware-libs/starknet-specs/releases/tag/v0.4.0) (Available under `/v0_4` endpoint)
- JSON-RPC [v0.5.1](https://github.com/starkware-libs/starknet-specs/releases/tag/v0.5.1) (Available under `/v0_5` endpoint)
- Integration of CairoVM.
- Verification of State from L1.
- Handle L1 and L2 Reorgs.
Expand All @@ -197,7 +192,7 @@ After following these steps, Juno should be up and running on your machine, util

## πŸ›£ Roadmap

### Phase 1
### Phase 1: Permissionless access to Starknet βœ…

<details>
<summary></summary>
Expand Down Expand Up @@ -231,7 +226,7 @@ After following these steps, Juno should be up and running on your machine, util

</details>

### Phase 2
### Phase 2: Full JSON RPC Support βœ…

<details>
<summary></summary>
Expand Down Expand Up @@ -261,6 +256,35 @@ The focus of Phase 2 will be to Verify the state from layer 1 and implement the

</details>

### Phase 3: Starknet decentralization begins 🚧

<details>
<summary></summary>

Juno can synchronize Starknet state from other full nodes with the aim of decentralizing Starknet by removing the dependency from the centralized sequencer.


Snap sync is implemented, significantly reducing sync times.

</details>

### Phase 4: Juno becomes a Starknet Sequencer πŸ”œ

<details>
<summary></summary>

The decentralization of Starknet is complete! Juno becomes a sequencer and participates in L2 consensus to secure the network. Juno has multiple modes of operation:
‍

β€’ Light client: provides fast permissionless access to Starknet with minimal verification.

β€’ Full Node: complete verification of Starknet state along with transaction execution.

β€’ Sequencer: secure the network by taking part in the L2 consensus mechanism.

</details>


## πŸ‘ Contribute

We welcome PRs from external contributors and would love to help you get up to speed.
Expand Down
Loading

0 comments on commit 3a41f24

Please sign in to comment.