Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:0xPolygon/polygon-docs into SPEC-170…
Browse files Browse the repository at this point in the history
…-dev-deployment-update-for-review
  • Loading branch information
sshrihar committed Sep 23, 2024
2 parents a0842b0 + 555f973 commit e21119c
Show file tree
Hide file tree
Showing 45 changed files with 485 additions and 123 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ node_modules/
*.iml
temp_dir/
package-lock.json
package.json
package.json
meaningless.change
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
FROM python:3.9-alpine
FROM python:3.12-alpine

RUN apk update
RUN apk add rsync
RUN apk add git
RUN apk add nodejs npm
RUN apk add --no-cache bash
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt --no-cache-dir

Expand Down
1 change: 1 addition & 0 deletions docs/_site_essentials/js/ethers-5.2.umd.min.js

Large diffs are not rendered by default.

121 changes: 121 additions & 0 deletions docs/_site_essentials/js/wallet-signin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
const brokenLinkSVG = `<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24" fill="currentColor"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M17 7h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1 0 1.43-.98 2.63-2.31 2.98l1.46 1.46C20.88 15.61 22 13.95 22 12c0-2.76-2.24-5-5-5zm-1 4h-2.19l2 2H16zM2 4.27l3.11 3.11C3.29 8.12 2 9.91 2 12c0 2.76 2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1 0-1.59 1.21-2.9 2.76-3.07L8.73 11H8v2h2.73L13 15.27V17h1.73l4.01 4L20 19.74 3.27 3 2 4.27z"/></svg>`;
const linkSVG = `<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24" fill="currentColor"><path d="M0 0h24v24H0z" fill="none"/><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg>`;

function isAllowedEnvironment() {
const currentUrl = window.location.href;
return currentUrl.includes('127.0.0.1') || (currentUrl.startsWith('https://docs-dev') && currentUrl.includes("/learn/"))
}

document.addEventListener('DOMContentLoaded', function() {
if (!isAllowedEnvironment()) {
return; // Exit early if not in allowed environment
}
const headerEllipsis = document.querySelector('.md-header__ellipsis');

if (headerEllipsis) {
const walletButton = document.createElement('button');
walletButton.className = 'md-button md-button--primary md-header__button wallet-button';
walletButton.style.float = 'right';
walletButton.style.fontSize = 'small';
walletButton.style.lineHeight = "24px";
walletButton.addEventListener('click', handleWalletAction);

const buttonText = document.createElement('span');
buttonText.className = 'wallet-button-text';
buttonText.textContent = 'Connect Wallet';
walletButton.appendChild(buttonText);

const buttonIcon = document.createElement('span');
buttonIcon.className = 'wallet-button-icon';
buttonIcon.innerHTML = linkSVG
buttonIcon.style.display = 'none';
walletButton.appendChild(buttonIcon);

headerEllipsis.appendChild(walletButton);

const style = document.createElement('style');
style.textContent = `
@media screen and (max-width: 465px) {
.wallet-button-text { display: none; }
.wallet-button-icon { display: inline !important; }
}
`;
document.head.appendChild(style);

const savedAddress = localStorage.getItem('walletAddress');
if (savedAddress) {
updateButtonState(true, savedAddress);
}
}
// const learnTab = Array.from(document.querySelectorAll('.md-tabs__link')).find(el => el.textContent.includes('Learn'));
// if (learnTab) {
// learnTab.textContent = learnTab.textContent.replace('Learn', 'Learn (beta)');
// }
});

async function handleWalletAction() {
const button = document.querySelector('.wallet-button');
const buttonText = button.querySelector('.wallet-button-text');
if (buttonText.textContent.startsWith('Connect')) {
await connectWallet();
} else {
await disconnectWallet();
}
}

async function connectWallet() {
if (typeof window.ethereum !== 'undefined') {
try {
const accounts = await window.ethereum.request({ method: 'eth_requestAccounts' });
console.log('Wallet connected successfully');
localStorage.setItem('walletAddress', accounts[0]);
updateButtonState(true, accounts[0]);
} catch (error) {
console.error('Failed to connect wallet:', error);
updateButtonState(false);
}
} else {
console.log('Please install MetaMask or another Ethereum wallet');
alert('Please install MetaMask or another Ethereum wallet');
}
}

async function disconnectWallet() {
console.log('Wallet disconnected');
localStorage.removeItem('walletAddress');
updateButtonState(false);
}

function updateButtonState(connected, address = '') {
const button = document.querySelector('.wallet-button');
const buttonText = button.querySelector('.wallet-button-text');
const buttonIcon = button.querySelector('.wallet-button-icon');
if (button) {
if (connected) {
const abbreviatedAddress = `${address.slice(0, 4)}..${address.slice(-4)}`;
buttonText.textContent = `Disconnect ${abbreviatedAddress}`;
buttonIcon.innerHTML = brokenLinkSVG;
button.classList.remove('md-button--primary');
button.classList.add('md-button--accent');
} else {
buttonText.textContent = 'Connect Wallet';
buttonIcon.innerHTML = linkSVG;
button.classList.add('md-button--primary');
button.classList.remove('md-button--accent');
}
}
}

// Listen for account changes
if (typeof window.ethereum !== 'undefined') {
window.ethereum.on('accountsChanged', function (accounts) {
if (accounts.length === 0) {
// User disconnected their wallet
disconnectWallet();
} else {
// User switched to a different account
localStorage.setItem('walletAddress', accounts[0]);
updateButtonState(true, accounts[0]);
}
});
}
4 changes: 2 additions & 2 deletions docs/agglayer/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ The AggLayer connects chains built with Polygon CDK, which use ZK proofs to gene
The unified bridge is a single bridge contract for all AggLayer-connected chains, allowing for the cross-chain transfer of fungible (non-wrapped) tokens. It is the source of unified liquidity for the AggLayer.

!!! tip "More information"
See the [unified bridge documentation](unified-bridge.md) for details.
See the [unified bridge documentation](./unified-bridge.md) for details.

### AggLayer service

The AggLayer service is designed to receive ZK proofs from various CDK and non-CDK chains, and verify their validity before sending them to the L1 Ethereum for final settlement. Currently, the AggLayer service has two implementations: [agglayer-go](agglayer-go.md) and [agglayer-rs](agglayer-rs.md).
The AggLayer service is designed to receive ZK proofs from various CDK and non-CDK chains, and verify their validity before sending them to the L1 Ethereum for final settlement. Currently, the AggLayer service has two implementations: [agglayer-go](./agglayer-go.md) and [agglayer-rs](./agglayer-rs.md).
27 changes: 0 additions & 27 deletions docs/cdk/getting-started/local-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,33 +38,6 @@ git clone https://github.com/0xPolygon/kurtosis-cdk.git
cd kurtosis-cdk
```

### Check your environment

Run the `tool_check.sh` script to confirm you have all the prerequisite software.

!!! tip
You may need to make the script executable: `chmod +x scripts/tool_check.sh`

```sh
./scripts/tool_check.sh
```

If everything is installed correctly, you should see the following output:

```bash
Checking that you have the necessary tools to deploy the Kurtosis CDK package...
✅ kurtosis is installed, meets the requirement (=0.89).
✅ docker is installed, meets the requirement (>=24.7).

You might as well need the following tools to interact with the environment...
✅ jq is installed.
✅ yq is installed, meets the requirement (>=3.2).
✅ cast is installed.
✅ polycli is installed.

🎉 You are ready to go!
```

### Understanding the deployment steps

There are two configuration files which help you understand what happens during a deployment.
Expand Down
2 changes: 1 addition & 1 deletion docs/cdk/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ hide:
<p class="feature-paragraph">Join our developer Discord server to ask questions and get help.</p>
</a>
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion docs/cdk/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ Chains built with Polygon CDK will have access to an ecosystem of (forthcoming)

- Check out the [concepts documentation](./concepts/layer2s.md) to understand the CDK at a high level.

- Have a look at the [CDK architecture docs](https://docs.polygon.technology/cdk/architecture/cdk-zkevm/) to understand the CDK's components and how they interact with each other.
- Have a look at the [CDK architecture docs](https://docs.polygon.technology/cdk/architecture/cdk-zkevm/) to understand the CDK's components and how they interact with each other.
37 changes: 37 additions & 0 deletions docs/cdk/releases/stack-components.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
The latest CDK release has two modes:

1. The CDK rollup/validium mode with full execution proofs is the first mode for release.
2. The CDK sovereign chain mode with pessimistic proofs, and no full execution proofs, is coming shortly after.

This document details the full stack components for the first mode of release: CDK with full execution proofs.

## CDK stack with full execution proofs (FEP)

In the CDK with full execution proofs release, any zkEVM components can be considered as part of a CDK stack in rollup mode.

The following table lists the components and where you can find them for CDK rollup and validium stacks. You will notice only small differences in the component makeup of the two stacks; differences which are now mostly use case specific.

| Component | CDK rollup (FEP) | CDK validium (FEP) | Notes |
| --- | --- | --- | --- |
| Node = RPC and sequencer | <a href=https://github.com/0xPolygonHermez/cdk-erigon>cdk-erigon</a> | <a href=https://github.com/0xPolygonHermez/cdk-erigon>cdk-erigon</a> | Customizable but usually sequencer=1 node, multiple for RPC |
| Data availability | None | <a href=https://github.com/0xPolygon/cdk-data-availability>cdk-data-availability</a> | |
| Contracts | <a href=https://github.com/0xPolygonHermez/zkevm-contracts>zkevm-contracts</a> | <a href=https://github.com/0xPolygonHermez/zkevm-contracts>zkevm-contracts</a> | Same code for both: 8.0.0-rc.2-fork.12 |
| Data streamer | <a href=https://github.com/0xPolygon/zkevm-data-streamer>zkevm-data-streamer</a> | <a href=https://github.com/0xPolygon/zkevm-data-streamer>zkevm-data-streamer</a> | Same code for both |
| CLI | <a href=https://github.com/0xPolygon/cdk>CLI included</a> | <a href=https://github.com/0xPolygon/cdk>CLI included</a> | Same code for both |
| Sequence sender | <a href=https://github.com/0xPolygon/cdk>Sequence sender included</a> | <a href=https://github.com/0xPolygon/cdk>Sequence sender included</a> | Same code for both |
| Aggregator | <a href=https://github.com/0xPolygon/cdk>Aggregator included</a> | <a href=https://github.com/0xPolygon/cdk>Aggregator included</a> | Same code for both |
| Tx pool manager | <a href=https://github.com/0xPolygon/zkevm-pool-manager>zkevm-pool-manager | <a href=https://github.com/0xPolygon/zkevm-pool-manager>zkevm-pool-manager | Same code for both |
| Prover | <a href=https://github.com/0xPolygonHermez/zkevm-prover>zkevm-prover</a> | <a href=https://github.com/0xPolygonHermez/zkevm-prover>zkevm-prover</a> | Same code for both - wip |
| Bridge service | <a href=https://github.com/0xPolygonHermez/zkevm-bridge-service>zkevm-bridge-service</a> | <a href=https://portal.polygon.technology/>Polygon Portal</a> | tbc |
| Bridge UI | <a href=https://portal.polygon.technology/>Polygon Portal</a> | <a href=https://portal.polygon.technology/>Polygon Portal</a> | Same UI for both |
| Blockscout | <a href=https://github.com/0xPolygonHermez/blockscout>blockscout</a> | <a href=https://github.com/0xPolygonHermez/blockscout>blockscout</a> | Same code for both |

!!! important
For specific release tags, please reference the [version matrix document](version-matrix.md).

## CDK stack with pessimistic proofs

The CDK with pessimistic proofs release follows on shortly after the CDK FEP release.

!!! tip
Coming soon.
131 changes: 131 additions & 0 deletions docs/cdk/releases/version-matrix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
---
comments: true
hide:
- toc
---

## CDK component versions/releases

The table below shows the version compatibility for CDK releases and related components.

<table>
<thead>
<tr>
<th>CDK version</th>
<th>Fork ID</th>
<th>Equivalent zkEVM node</th>
<th>CDK validium node</th>
<th>CDK data<br>availability</th>
<th>zkEVM node</th>
<th>ZK-EVM prover</th>
<th>Contracts</th>
<th>Bridge</th>
</tr>
</thead>
<tbody>
<!--
<tr>
<td>Rollup</td>
<td colspan="7">Follow <a href="https://github.com/0xPolygonHermez#testnetmainnet-versions"> zkEVM </a></br><i>Disclaimer - These versions are intended for permissionless nodes</i> </td>
</tr>-->
<tr>
<td>CDK Elderberry 2 Release </td>
<td>9</td>
<td><a href="https://github.com/0xPolygonHermez/zkevm-node/releases/tag/v0.6.4">v0.6.4 Elderberry 2</a></td>
<td><a href="https://hub.docker.com/layers/0xpolygon/cdk-validium-node/0.6.7-cdk.1/images/sha256-dafb15f9355331b4b7174f47ac416b275915ff24a9ed89c211c7c15c8adfc6b8?context=explore">0.6.7+cdk.1</a> </td>
<td><a href="https://hub.docker.com/layers/0xpolygon/cdk-data-availability/0.0.7/images/sha256-17590789a831259d7a07d8a042ea87e381c5708dec3a7daef6f3f782f50b2c00?context=explore">v0.0.7</a></td>
<td><a href="https://github.com/0xPolygonHermez/zkevm-node/releases/tag/v0.6.4">v0.6.4 </a></td>
<td><a href="https://github.com/0xPolygonHermez/zkevm-prover/releases/tag/v6.0.0">v6.0.0</a></td>
<td> <a href="https://github.com/0xPolygonHermez/zkevm-contracts/releases/tag/v6.0.0-rc.1-fork.9">v6.0.0</a></td>
<td><a href="https://hub.docker.com/layers/hermeznetwork/zkevm-bridge-service/v0.4.2-cdk.1/images/sha256-f22ad8c9ad058c7a97a3d38f53cac5b1053858916523b96211d33ae40a9b45f8?context=explore">v0.4.2-cdk.1</a></td>
</tr>
<!-- <td>CDK Elderberry 1 Release </td>
<td>8</td>
<td><a href="https://github.com/0xPolygonHermez/zkevm-node/releases/tag/v0.6.2">v0.6.2 Elderberry</a></td>
<td><a href="https://github.com/0xPolygon/cdk-validium-node/releases/tag/v0.6.2%2Bcdk4">0.6.2+cdk.4</a> </td>
<td><a href="https://hub.docker.com/layers/0xpolygon/cdk-data-availability/0.0.6-hotfix1/images/sha256-e95ef2cd9110aff8acdd29065f407f04ea6179f71a7848d78eaf0dd73c858207?context=explore">v0.0.6-hotfix1</a></td>
<td><a href="https://github.com/0xPolygonHermez/zkevm-prover/releases/tag/v5.0.7">v5.0.7</a></td>
<td> <a href="https://github.com/0xPolygonHermez/zkevm-contracts/releases/tag/v5.0.1-rc.2-fork.8">v5.0.1</a></td>
<td><a href="https://github.com/0xPolygonHermez/zkevm-bridge-service/releases/tag/v0.4.2">v0.4.2</a></td>
</tr>
<tr>
<td><a href="https://polygontechnology.notion.site/Instructions-zkEVM-Mainnet-Beta-Node-v0-5-7-Prover-v4-0-4-8f5b9d8e2f6a4048b21c608b49a93376" target="_blank" rel="noopener noreferrer">CDK-Etrog Release</a>- <br>BETA TESTING</td>
<td>7</td>
<td><a href="https://github.com/0xPolygonHermez/zkevm-node/releases/tag/v0.5.13">v0.5.13 </a>(Etrog+uLxLy)</td>
<td><a href="https://github.com/0xPolygon/cdk-validium-node/releases/tag/v0.5.13%2Bcdk.10">v0.5.13+cdk.10</a> </td>
<td><a href="https://hub.docker.com/layers/0xpolygon/cdk-data-availability/0.0.6-hotfix1/images/sha256-e95ef2cd9110aff8acdd29065f407f04ea6179f71a7848d78eaf0dd73c858207?context=explore">v0.0.6-hotfix1</a></td>
<td><a href="https://github.com/0xPolygonHermez/zkevm-prover/releases/tag/v4.0.19">v4.0.19</a></td>
<td> <a href="https://github.com/0xPolygonHermez/zkevm-rom/tree/v4.0.0-fork.7">v4.0.0</a></td>
<td><a href="https://github.com/0xPolygonHermez/zkevm-bridge-service/releases/tag/v0.4.2">v0.4.2</a></td>
</tr>
<tr>
<td>Upgraded validium</td>
<td>6</td>
<td>0.4.2</td>
<td><a href="https://github.com/0xPolygon/cdk-validium-node/releases/tag/v0.0.3-hotfix6">v0.0.3-hotfix6</a></td>
<td>v0.0.3</td>
<td>zkevm-prover<br>@3.0.2<br>Config files version 3.0.0-RC3-fork.6</td>
<td><a href="https://github.com/0xPolygon/cdk-validium-contracts/releases/tag/v0.0.2">v0.0.2</a></td>
<td>v0.3.2-RC1</td>
</tr>-->
</tbody>
</table>

### Migrating

- Anyone on earlier versions, we recommend going straight to fork ID 9.

<!--
## zkEVM
The table below shows the version compatibility for Polygon zkEVM releases.
<table>
<thead>
<tr>
<th>Node </th>
<th>Bridge</th>
<th>Prover</th>
<th>Fork ID</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="https://github.com/0xPolygonHermez/zkevm-node/releases/tag/v0.6.4">v0.6.4 </a></td>
<td><a href="https://github.com/0xPolygonHermez/zkevm-bridge-service/releases/tag/v0.4.2">v0.4.2</a></td>
<td><a href="https://github.com/0xPolygonHermez/zkevm-prover/releases/tag/v6.0.0">v6.0.0</a></td>
<td>Mainnet &amp; Cardona: 4-9 <br>Testnet (Goerli): 1-6</td>
</tr>
<tr>
<td><a href="https://github.com/0xPolygonHermez/zkevm-node/releases/tag/v0.6.2">v0.6.2 </a></td>
<td><a href="https://github.com/0xPolygonHermez/zkevm-bridge-service/releases/tag/v0.4.2">v0.4.2</a></td>
<td><a href="https://github.com/0xPolygonHermez/zkevm-prover/releases/tag/v5.0.7">v5.0.7</a></td>
<td>Mainnet &amp; Cardona: 4-8. <br>Testnet (Goerli): 1-6</td>
</tr>
<tr>
<td><a href="https://github.com/0xPolygonHermez/zkevm-node/releases/tag/v0.5.13">v0.5.13</a></td>
<td><a href="https://github.com/0xPolygonHermez/zkevm-bridge-service/releases/tag/v0.4.2">v0.4.2</a></td>
<td><a href="https://github.com/0xPolygonHermez/zkevm-prover/releases/tag/v4.0.19">v4.0.19</a></td>
<td>Mainnet &amp; Cardona: 4-7. <br>Testnet (Goerli): 1-6</td>
</tr>
<tr>
<td><a href="https://github.com/0xPolygonHermez/zkevm-node/releases/v0.4.0">v0.4.0</a></td>
<td>v0.3.0</td>
<td>v3.0.2</td>
<td rowspan="2">Testnet: 1-6<br>Mainnet: 4-6</td>
</tr>
<tr>
<td><a href="https://github.com/0xPolygonHermez/zkevm-node/releases/v0.3.3">v0.3.3</a></td>
<td>v0.2.0</td>
<td>v3.0.0</td>
</tr>
<tr>
<td><a href="https://github.com/0xPolygonHermez/zkevm-node/releases/v0.3.1">v0.3.1</a> </td>
<td> v0.2.0</td>
<td>v2.2.2</td>
<td>Testnet: <br>1 - 5 Mainnet: 4-5 </td>
</tr>
</tbody>
</table>
-->

3 changes: 2 additions & 1 deletion docs/cdk/resources/cdk-repo-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ comments: true
| Component | Description |
| ----------------------------------------------------------------------------- | -------------------------------------------------------------------- |
| [CDK validium node](https://github.com/0xPolygon/cdk-validium-node) | Node implementation for the CDK networks in Validium mode |
| [CDK validium contracts](https://github.com/0xPolygon/cdk-validium-contracts) | Smart contracts implementation for the CDK networks in Validium mode |
| [CDK rollup contracts](https://github.com/0xPolygonHermez/zkevm-contracts) | Smart contract repo for CDK rollups |
| [CDK validium contracts](https://github.com/0xPolygon/cdk-validium-contracts) | Deprecating in favor of rollup contract repo |
| [CDK data availability layer](https://github.com/0xPolygon/cdk-data-availability) | Data availability nodes implementation for the CDK networks |
| [Prover/Executor](https://github.com/0xPolygonHermez/zkevm-prover) | zkEVM engine and prover implementation |
| [Bridge service](https://github.com/0xPolygonHermez/zkevm-bridge-service) | Bridge service implementation for CDK networks |
Expand Down
2 changes: 1 addition & 1 deletion docs/cdk/resources/third-party-guides.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This page links to full guides that some of [our solution providers](https://eco
<div class="product-list-item-header">
<div class="feature-card-heading">Gateway</div>
</div>
<p class="feature-paragraph">Build a custom CDK chain with Gateway.</p>
<p class="feature-paragraph">Build a custom CDK chain with Gateway. </p>
</a>
</div>
<div class="grid-item">
Expand Down
Loading

0 comments on commit e21119c

Please sign in to comment.