Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
minhd-vu committed Oct 25, 2024
1 parent 7b14837 commit b09f443
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 26 deletions.
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ The package is flexible and supports various configurations for deploying and te

> The team is actively working on enabling the use cases that are currently not possible.
| Stack | Sequencer | Sequence Sender / Aggregator | Supported by Kurtosis? |
| ----- | --------- | ---------------------------- | ---------------------- |
| New CDK stack | [cdk-erigon](https://github.com/0xPolygonHermez/cdk-erigon) | [cdk-node](https://github.com/0xPolygon/cdk) ||
| New sequencer with new zkevm stack | [cdk-erigon](https://github.com/0xPolygonHermez/cdk-erigon) | [zkevm-sequence-sender](https://github.com/0xPolygonHermez/zkevm-sequence-sender) + [zkevm-aggregator](https://github.com/0xPolygonHermez/zkevm-aggregator) | ❌ (WIP) - Check the [kurtosis-cdk-erigon](https://github.com/xavier-romero/kurtosis-cdk-erigon) package |
| New sequencer with legacy zkevm stack | [cdk-erigon](https://github.com/0xPolygonHermez/cdk-erigon) | [zkevm-node](https://github.com/0xPolygonHermez/zkevm-node) | ❌ (WIP) |
| Legacy sequencer with new cdk stack | [zkevm-node](https://github.com/0xPolygonHermez/zkevm-node) | [cdk-node](https://github.com/0xPolygon/cdk) | ❌ (WIP) |
| Legacy sequencer with new zkevm stack | [zkevm-node](https://github.com/0xPolygonHermez/zkevm-node) | [zkevm-sequence-sender](https://github.com/0xPolygonHermez/zkevm-sequence-sender) + [zkevm-aggregator](https://github.com/0xPolygonHermez/zkevm-aggregator) | ❌ (WIP) |
| Legacy zkevm stack | [zkevm-node](https://github.com/0xPolygonHermez/zkevm-node) | [zkevm-node](https://github.com/0xPolygonHermez/zkevm-node) ||
| Stack | Sequencer | Sequence Sender / Aggregator | Supported by Kurtosis? |
| ------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| New CDK stack | [cdk-erigon](https://github.com/0xPolygonHermez/cdk-erigon) | [cdk-node](https://github.com/0xPolygon/cdk) | |
| New sequencer with new zkevm stack | [cdk-erigon](https://github.com/0xPolygonHermez/cdk-erigon) | [zkevm-sequence-sender](https://github.com/0xPolygonHermez/zkevm-sequence-sender) + [zkevm-aggregator](https://github.com/0xPolygonHermez/zkevm-aggregator) | ❌ (WIP) - Check the [kurtosis-cdk-erigon](https://github.com/xavier-romero/kurtosis-cdk-erigon) package |
| New sequencer with legacy zkevm stack | [cdk-erigon](https://github.com/0xPolygonHermez/cdk-erigon) | [zkevm-node](https://github.com/0xPolygonHermez/zkevm-node) | ❌ (WIP) |
| Legacy sequencer with new cdk stack | [zkevm-node](https://github.com/0xPolygonHermez/zkevm-node) | [cdk-node](https://github.com/0xPolygon/cdk) | ❌ (WIP) |
| Legacy sequencer with new zkevm stack | [zkevm-node](https://github.com/0xPolygonHermez/zkevm-node) | [zkevm-sequence-sender](https://github.com/0xPolygonHermez/zkevm-sequence-sender) + [zkevm-aggregator](https://github.com/0xPolygonHermez/zkevm-aggregator) | ❌ (WIP) |
| Legacy zkevm stack | [zkevm-node](https://github.com/0xPolygonHermez/zkevm-node) | [zkevm-node](https://github.com/0xPolygonHermez/zkevm-node) | |

To understand how to configure Kurtosis for these use cases, refer to the [documentation](.github/tests/README.md) and review the test files located in the `.github/tests/` directory.

Expand All @@ -44,6 +44,8 @@ To understand how to configure Kurtosis for these use cases, refer to the [docum

To begin, you will need to install [Docker](https://docs.docker.com/get-docker/) (>= [v4.27.0](https://docs.docker.com/desktop/release-notes/#4270) for Mac users) and [Kurtosis](https://docs.kurtosis.com/install/).

- If you notice some services, such as the `zkevm-stateless-executor` or `zkevm-prover`, consistently having the status of `STOPPED`, try increasing the Docker memory allocation.

If you intend to interact with and debug the stack, you may also want to consider a few additional optional tools such as:

- [jq](https://github.com/jqlang/jq)
Expand All @@ -59,7 +61,7 @@ Once that is good and installed on your system, you can run the following comman
kurtosis run --enclave cdk github.com/0xPolygon/kurtosis-cdk
```

The default deployment includes [cdk-erigon](https://github.com/0xPolygonHermez/cdk-erigon) as the sequencer, and [cdk-node](https://github.com/0xPolygon/cdk) functioning as the sequence sender and aggregator. You can verify the default versions of these components and the default fork ID by reviewing input_parser.star. You can check the default versions of the deployed components and the default fork ID by looking at
The default deployment includes [cdk-erigon](https://github.com/0xPolygonHermez/cdk-erigon) as the sequencer, and [cdk-node](https://github.com/0xPolygon/cdk) functioning as the sequence sender and aggregator. You can verify the default versions of these components and the default fork ID by reviewing input_parser.star. You can check the default versions of the deployed components and the default fork ID by looking at
[input_parser.star](./input_parser.star).

To make customizations to the CDK environment, clone this repo, make any desired configuration changes, and then run:
Expand Down
2 changes: 1 addition & 1 deletion docker/toolbox.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ COPY --from=polycli-builder /opt/polygon-cli/bindings /opt/bindings
# WARNING (SC1091): (Sourced) file not included in mock.
# hadolint ignore=DL3008,DL3013,DL4006,SC1091
RUN apt-get update \
&& apt-get install --yes --no-install-recommends curl git jq nodejs npm pipx \
&& apt-get install --yes --no-install-recommends curl git jq pipx \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& pipx ensurepath \
Expand Down
2 changes: 1 addition & 1 deletion input_parser.star
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ DEFAULT_IMAGES = {
"cdk_erigon_node_image": "hermeznetwork/cdk-erigon:v2.1.0", # https://hub.docker.com/r/hermeznetwork/cdk-erigon/tags
"cdk_node_image": "ghcr.io/0xpolygon/cdk:0.3.0", # https://github.com/0xpolygon/cdk/pkgs/container/cdk
"cdk_validium_node_image": "0xpolygon/cdk-validium-node:0.7.0-cdk", # https://hub.docker.com/r/0xpolygon/cdk-validium-node/tags
"l2_contracts_image": "minhdvu/toolbox:0.0.7", # https://hub.docker.com/r/leovct/toolbox/tags
"l2_contracts_image": "leovct/toolbox:0.0.6", # https://hub.docker.com/r/leovct/toolbox/tags
"zkevm_bridge_proxy_image": "haproxy:3.0-bookworm", # https://hub.docker.com/_/haproxy/tags
"zkevm_bridge_service_image": "hermeznetwork/zkevm-bridge-service:v0.6.0-RC1", # https://hub.docker.com/r/hermeznetwork/zkevm-bridge-service/tags
"zkevm_bridge_ui_image": "leovct/zkevm-bridge-ui:multi-network-2", # https://hub.docker.com/r/leovct/zkevm-bridge-ui/tags
Expand Down
20 changes: 5 additions & 15 deletions templates/contract-deploy/run-l2-contract-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,10 @@ echo "$accounts" | jq -r ".Addresses[].ETHAddress" | while read -r address; do
fund_account_on_l2 "$address"
done

echo_ts "Building deterministic deployment proxy"
git clone https://github.com/Arachnid/deterministic-deployment-proxy.git \
/opt/deterministic-deployment-proxy \
--branch "{{.deterministic_deployment_proxy_branch}}"
cd /opt/deterministic-deployment-proxy || exit 1
npm ci
npm run build

signer_address="0x$(jq -r '.signerAddress' output/deployment.json)"
gas_price=$(jq -r '.gasPrice' output/deployment.json)
gas_limit=$(jq -r '.gasLimit' output/deployment.json)
gas_cost=$((gas_price * gas_limit))
transaction="0x$(jq -r '.transaction' output/deployment.json)"
deployer_address="0x$(jq -r '.address' output/deployment.json)"
signer_address="0x3fab184622dc19b6109349b94811493bf2a45362"
gas_cost="0.01ether"
transaction="0xf8a58085174876e800830186a08080b853604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf31ba02222222222222222222222222222222222222222222222222222222222222222a02222222222222222222222222222222222222222222222222222222222222222"
deployer_address="0x4e59b44847b379578588920ca78fbf26c0b4956c"
l1_private_key=$(
polycli wallet inspect \
--mnemonic "{{.l1_preallocated_mnemonic}}" \
Expand Down Expand Up @@ -132,7 +122,7 @@ cast send \
"$deployer_address" \
"$salt$bytecode"
l2_actual=$(cast call --rpc-url "{{.l2_rpc_url}}" "$contract_address" "$contract_method_signature")
if [ "$expected" != "$l2_actual" ]; then
if [[ "$expected" != "$l2_actual" ]]; then
echo_ts "Failed to deploy deterministic deployment proxy on l2 (expected: $expected, actual $l2_actual)"
exit 1
fi
Expand Down

0 comments on commit b09f443

Please sign in to comment.