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

Architecture Diagram #9

Closed
wants to merge 36 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
6e0ef08
chore: move cdk code to its own package
leovct Mar 15, 2024
1c377f5
ci: update jobs
leovct Mar 15, 2024
a07acae
feat: add dbs to pless node
leovct Mar 15, 2024
a0f3d7f
feat: add remaining components like prover, synchronizer and rpc
leovct Mar 15, 2024
fb6b4f6
fix: typo
leovct Mar 15, 2024
426460a
early draft pless node
leovct Mar 15, 2024
2eaf9db
chore: clean up
leovct Mar 15, 2024
79e97ae
feat: add genesis file arg
leovct Mar 15, 2024
44d75fe
chore: typos
leovct Mar 15, 2024
4b3d066
fix: more typos
leovct Mar 15, 2024
87fa139
docs: adding initial diagram
praetoriansentry Mar 15, 2024
b1e77ad
ops: sonarcloud setup
praetoriansentry Mar 16, 2024
7d9ec82
fix: db names
leovct Mar 18, 2024
46e9cbd
chore: update default parameters
leovct Mar 18, 2024
36e8ec6
chore: remove permissionless node deployment from cdk package
leovct Mar 18, 2024
4f93b9c
chore: lint
leovct Mar 18, 2024
da0878f
ci: only deploy cdk package for the moment
leovct Mar 18, 2024
dc102c6
chore: nit
leovct Mar 18, 2024
2830127
chore: nit
leovct Mar 18, 2024
e6c7dcd
chore: remove debug wait
leovct Mar 18, 2024
9e36546
refactor: service names
leovct Mar 18, 2024
0ca3661
chore: same
leovct Mar 18, 2024
61cd53c
chore: lint
leovct Mar 18, 2024
d5d71cc
chore: nit
leovct Mar 18, 2024
fe067d4
chore: nit
leovct Mar 18, 2024
ca54891
ops: removing unecessary debug service
praetoriansentry Mar 18, 2024
dbc106f
Merge branch 'refactor/permissionless-node-package' into jhilliard/ar…
praetoriansentry Mar 18, 2024
275422a
refactor: dropping trusted
praetoriansentry Mar 18, 2024
ad86a9b
refactor: naming for pless
praetoriansentry Mar 18, 2024
ba0d59d
refactor: deployment_idx
praetoriansentry Mar 18, 2024
271e467
docs: adding note for running pless
praetoriansentry Mar 18, 2024
fcc9428
ops: security
praetoriansentry Mar 18, 2024
223659e
ops: updating for fid8
praetoriansentry Mar 18, 2024
c35f749
docs: minor changes for fid8 testing
praetoriansentry Mar 18, 2024
2be123d
ops: kurtosis lint
praetoriansentry Mar 18, 2024
291d2a8
fix: shellcheck
praetoriansentry Mar 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These owners will be the default owners for everything in the repo.
* @0xPolygon/dev-tools
* @praetoriansentry
10 changes: 6 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ concurrency:
cancel-in-progress: true

jobs:
deploy:
cdk_package:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Deploy devnet

- name: Deploy kurtosis package
uses: kurtosis-tech/kurtosis-github-action@v1
with:
path: .
args: cdk-params.yml
path: cdk
args: cdk/params.yml
41 changes: 22 additions & 19 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,44 +11,47 @@ concurrency:
cancel-in-progress: true

jobs:
starklark:
package:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
package: ["cdk", "permissionless-node"]
steps:
- uses: actions/checkout@v4

# Install linters
- name: Install kurtosis
run: |
echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list
sudo apt update
sudo apt install kurtosis-cli
kurtosis analytics disable
- name: Run kurtosis linter
run: kurtosis lint ${{ github.workspace }}

yaml:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install yamllint
run: pip install yamllint
- name: Run yamllint
run: yamllint --config-file .yamllint.yml .

hadolint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install hadolint
run: |
sudo wget -O /usr/local/bin/hadolint https://github.com/hadolint/hadolint/releases/latest/download/hadolint-Linux-x86_64
sudo chmod +x /usr/local/bin/hadolint
- name: Run hadolint
run: find . -type f -name 'Dockerfile*' | sort | xargs -I {} hadolint --config .hadolint.yml {}

shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install shellcheck
run: sudo apt install shellcheck

# Run linters
- name: Run kurtosis linter
working-directory: ${{ matrix.package }}
run: kurtosis lint .

- name: Run yamllint
working-directory: ${{ matrix.package }}
run: yamllint --config-file ${{ github.workspace }}/.yamllint.yml .

- name: Run hadolint
working-directory: ${{ matrix.package }}
run: find . -type f -name 'Dockerfile*' | sort | xargs -I {} hadolint --config ${{ github.workspace }}/.hadolint.yml {}

- name: Run shellcheck
working-directory: ${{ matrix.package }}
run: find . -type f -name '*.sh' | sort | xargs -I {} shellcheck {}
22 changes: 22 additions & 0 deletions .github/workflows/security-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Security Build
on:
push:
branches:
- main
workflow_dispatch: {}
pull_request:
types: [opened, synchronize, reopened]

jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
40 changes: 35 additions & 5 deletions README.org
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
* Polygon CDK Kurtosis Package

[[file:docs/architecture.png]]

To get started you'll want to get everything [[https://docs.kurtosis.com/install/][installed]]. Once that's
good and installed on your system, you can ~cd~ into this directory
and run:

#+begin_src bash
kurtosis run --enclave cdk-v1 --args-file cdk-params.yml .
kurtosis run --enclave cdk-v1 --args-file cdk/params.yml cdk
#+end_src

This command will take a few minutes but will basically run an entire
Expand All @@ -27,14 +29,14 @@ overwhelming. If we want to simply see the port mapping within the
~trusted-rpc~ port, we can run this command.

#+begin_src bash
kurtosis port print cdk-v1 zkevm-node-rpc-001 trusted-rpc
kurtosis port print cdk-v1 zkevm-node-rpc-001 http-rpc
#+end_src

For the sake of this document, I'm going to map that value to an
environment variable.

#+begin_src bash
export ETH_RPC_URL="$(kurtosis port print cdk-v1 zkevm-node-rpc-001 trusted-rpc)"
export ETH_RPC_URL="$(kurtosis port print cdk-v1 zkevm-node-rpc-001 http-rpc)"
#+end_src

That is the same environment variable that ~cast~ uses, so now I
Expand Down Expand Up @@ -82,13 +84,43 @@ container to be able to poke around.
kurtosis service shell cdk-v1 zkevm-node-sequencer-001
#+end_src

One of the most common ways to check the status of the system is to
make sure that batches are going through the normal progression of
trusted, virtual, and verified:

#+begin_src bash
cast rpc zkevm_batchNumber
cast rpc zkevm_virtualBatchNumber
cast rpc zkevm_verifiedBatchNumber
#+end_src

When everything is done, you might want to clean up with this command
which stopps everything and deletes it.

#+begin_src bash
kurtosis clean -a
#+end_src

** Permissionless Node

In addition to the core stack, you can also attach and synchronize a
permissionless node. Of course, you'll need the CDK stack running from
the previous commands. Assuming that has run and correctly created a
network, you'll need to pull the genesis file artifact out and add it
to your ~permissionless-node~ kurtosis package.

#+begin_src bash
kurtosis files download cdk-v1 zkevm /tmp
cp /tmp/zkevm/genesis.json permissionless-node/genesis.json
#+end_src

Now that we have the right genesis file, we can add a permissionless
node to the ~cdk-v1~ enclave:

#+begin_src bash
kurtosis run --enclave cdk-v1 --args-file permissionless-node/params.yml permissionless-node
#+end_src

** License

Copyright (c) 2024 PT Services DMCC
Expand All @@ -108,5 +140,3 @@ Unless you explicitly state otherwise, any contribution intentionally
submitted for inclusion in the work by you, as defined in the
Apache-2.0 license, shall be dual licensed as above, without any
additional terms or conditions.


17 changes: 17 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Polygon Technology Security Information

## Link to vulnerability disclosure details (Bug Bounty).
- Websites and Applications: https://hackerone.com/polygon-technology
- Smart Contracts: https://immunefi.com/bounty/polygon

## Languages that our team speaks and understands.
Preferred-Languages: en

## Security-related job openings at Polygon.
https://polygon.technology/careers

## Polygon security contact details.
[email protected]

## The URL for accessing the security.txt file.
Canonical: https://polygon.technology/security.txt
Loading
Loading