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

Fixes to PoS #22

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
74 changes: 74 additions & 0 deletions .github/workflows/dev_deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Docs Dev Deployment
on:
push:
branches: ['dev']
workflow_dispatch:

jobs:
deploy_staging:
name: Dev Deployment
permissions:
id-token: write
contents: write
environment: dev
runs-on: ubuntu-latest
env:
AWS_REGION: eu-west-1
ECR_REPOSITORY: docs-dev-ecr
ECS_SERVICE: docs-dev-ecs-service
ECS_CLUSTER: frontend-dev-ecs-cluster
ECS_TASK_DEFINITION: dev-taskdef.json
CONTAINER_NAME: docs-dev
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-region: ${{ env.AWS_REGION }}
role-to-assume: arn:aws:iam::605436358845:role/docs-dev-GithubActionsRole
role-session-name: GithubActionsSession

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Use Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: pip Install
run: pip install -r requirements.txt --no-cache-dir

- name: Build mkdocs
run: mkdocs build

- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f Dockerfile.nginx .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT

- name: Fill in the new image ID in the Amazon ECS task definition
id: task-def
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: ${{ env.ECS_TASK_DEFINITION }}
container-name: ${{ env.CONTAINER_NAME }}
image: ${{ steps.build-image.outputs.image }}

- name: Deploy Amazon ECS task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: ${{ steps.task-def.outputs.task-definition }}
service: ${{ env.ECS_SERVICE }}
cluster: ${{ env.ECS_CLUSTER }}
wait-for-service-stability: true
21 changes: 21 additions & 0 deletions .github/workflows/main_to_dev_merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Merge Main to Dev

on:
schedule:
- cron: '0 0 * * *' # Run daily at midnight UTC

jobs:
merge:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Merge Main to Dev
run: |
git checkout dev
git pull origin dev
git fetch origin main
git merge origin/main --no-edit
git push origin dev
81 changes: 81 additions & 0 deletions .github/workflows/prod_deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Prod Deployment

on:
workflow_dispatch:
inputs:
stage:
description: 'Stage to deploy (production)'
required: true
run_production:
description: 'Staging deployment completed (yes, no)'
required: true

jobs:
deploy_prod:
name: Prod Deployment
permissions:
id-token: write
contents: write
environment: prod
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch' && github.event.inputs.stage == 'production' && github.event.inputs.run_production == 'yes'
env:
AWS_REGION: eu-west-1
ECR_REPOSITORY: docs-ecr
ECS_SERVICE: docs-ecs-service
ECS_CLUSTER: frontend-prod-ecs-cluster
ECS_TASK_DEFINITION: prod-taskdef.json
CONTAINER_NAME: docs
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-region: ${{ env.AWS_REGION }}
role-to-assume: arn:aws:iam::042947190491:role/docs-GithubActionsRole
role-session-name: GithubActionsSession

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Use Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: pip Install
run: pip install -r requirements.txt --no-cache-dir

- name: Build mkdocs
run: mkdocs build

- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f Dockerfile.nginx .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT

- name: Fill in the new image ID in the Amazon ECS task definition
id: task-def
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: ${{ env.ECS_TASK_DEFINITION }}
container-name: ${{ env.CONTAINER_NAME }}
image: ${{ steps.build-image.outputs.image }}

- name: Deploy Amazon ECS task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: ${{ steps.task-def.outputs.task-definition }}
service: ${{ env.ECS_SERVICE }}
cluster: ${{ env.ECS_CLUSTER }}
wait-for-service-stability: true
74 changes: 74 additions & 0 deletions .github/workflows/staging_deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Staging Deployment
on:
push:
branches: ['main']
workflow_dispatch:

jobs:
deploy_staging:
name: Staging Deployment
permissions:
id-token: write
contents: write
environment: staging
runs-on: ubuntu-latest
env:
AWS_REGION: eu-west-1
ECR_REPOSITORY: docs-staging-ecr
ECS_SERVICE: docs-staging-ecs-service
ECS_CLUSTER: frontend-staging-ecs-cluster
ECS_TASK_DEFINITION: staging-taskdef.json
CONTAINER_NAME: docs-staging
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-region: ${{ env.AWS_REGION }}
role-to-assume: arn:aws:iam::070528468658:role/docs-staging-GithubActionsRole
role-session-name: GithubActionsSession

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Use Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: pip Install
run: pip install -r requirements.txt --no-cache-dir

- name: Build mkdocs
run: mkdocs build

- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f Dockerfile.nginx .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT

- name: Fill in the new image ID in the Amazon ECS task definition
id: task-def
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: ${{ env.ECS_TASK_DEFINITION }}
container-name: ${{ env.CONTAINER_NAME }}
image: ${{ steps.build-image.outputs.image }}

- name: Deploy Amazon ECS task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: ${{ steps.task-def.outputs.task-definition }}
service: ${{ env.ECS_SERVICE }}
cluster: ${{ env.ECS_CLUSTER }}
wait-for-service-stability: true
14 changes: 14 additions & 0 deletions Dockerfile.nginx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#Serve the app with NGINX
FROM nginx:alpine

# Copy the build files from the build folder to /usr/share/nginx/html
COPY site /usr/share/nginx/html

#Replace default nginx.conf with custom configuration
COPY nginx.conf /etc/nginx/conf.d/default.conf

# Expose the desired port (default is 80 for NGINX)
EXPOSE 80

# Start NGINX
CMD ["nginx", "-g", "daemon off;"]
95 changes: 95 additions & 0 deletions dev-taskdef.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
"requiresCompatibilities": [
"FARGATE"
],
"inferenceAccelerators": [],
"containerDefinitions": [{
"dnsSearchDomains": null,
"environmentFiles": [],
"entryPoint": null,
"portMappings": [{
"hostPort": 80,
"protocol": "tcp",
"containerPort": 80
}],
"command": null,
"linuxParameters": null,
"cpu": 0,
"environment": null,
"resourceRequirements": null,
"ulimits": null,
"dnsServers": null,
"mountPoints": null,
"workingDirectory": null,
"secrets": null,
"dockerSecurityOptions": null,
"memory": null,
"memoryReservation": null,
"volumesFrom": null,
"stopTimeout": null,
"image": "test",
"startTimeout": null,
"firelensConfiguration": null,
"dependsOn": null,
"disableNetworking": null,
"interactive": null,
"healthCheck": null,
"essential": true,
"links": null,
"hostname": null,
"extraHosts": null,
"pseudoTerminal": null,
"user": null,
"readonlyRootFilesystem": null,
"dockerLabels": null,
"systemControls": null,
"privileged": null,
"name": "docs-dev",
"repositoryCredentials": {
"credentialsParameter": ""
}
}],
"volumes": [],
"networkMode": "awsvpc",
"memory": "1024",
"cpu": "512",
"executionRoleArn": "arn:aws:iam::605436358845:role/docs-dev-TaskRole",
"family": "docs-dev-taskdefinition",
"taskRoleArn": "arn:aws:iam::605436358845:role/docs-dev-TaskRole",
"runtimePlatform": {
"operatingSystemFamily": "LINUX"
},
"tags": [{
"key": "Role",
"value": "frontend-application"
},
{
"key": "ParentService",
"value": "docs-dev"
},
{
"key": "Environment",
"value": "dev"
},
{
"key": "Service",
"value": "docs-dev.polygon.technology"
},
{
"key": "Host",
"value": "AWS"
},
{
"key": "IAC",
"value": "terraform-workspace-aws-dev-applications-eu-west-1-apps-docs-dev-polygon-technology"
},
{
"key": "Team",
"value": "documentation"
},
{
"key": "Name",
"value": "docs-dev-taskdefinition"
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/zkvm/01circom-witness-zkprover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/zkvm/01msm-evm-components.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/zkvm/01prf-rec-pil-stark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/zkvm/01pzb-polygon-zkevm-schema.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/zkvm/02circom-overall-context.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/zkvm/02l2-l2-state-timeline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/zkvm/02msm-prover-structure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/zkvm/02prf-rec-simple-composition.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/zkvm/02pzb-global-exit-tree.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/zkvm/03circom-simple-arith-circuit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/zkvm/03l2-sequencing-batches.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/zkvm/03prf-rec-setup-phase-rec.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/zkvm/03pzb-exit-leaf-add-L1-L2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/zkvm/04circom-batch-prover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/zkvm/04msm-simple-state-transition.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/zkvm/04prf-rec-proving-phase-rec.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/zkvm/05circom-forming-batch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/zkvm/05l2-off-chain-on-chain-trans.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/zkvm/05msm-addr-reg-contexts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/zkvm/05prf-rec-binary-aggreg-eg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/zkvm/05pzb-l2-related-scs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/zkvm/06l2-actor-income-outcomes.png
Binary file added docs/img/zkvm/06msm-eth-state-trie.png
Binary file added docs/img/zkvm/06prf-rec-setup-s2c-detail.png
Binary file added docs/img/zkvm/07l2-batch-fee-var.png
Binary file added docs/img/zkvm/07msm-zkevm-state-trie.png
Binary file added docs/img/zkvm/08l2-batches-below-time-target.png
Binary file added docs/img/zkvm/08msm-zkevm-memory-regions.png
Binary file added docs/img/zkvm/08prf-rec-setup-step-c2s.png
Binary file added docs/img/zkvm/09l2-forced-batch-seq-flow.png
Binary file added docs/img/zkvm/09msm-evm-zkevm-mem-align.png
Binary file added docs/img/zkvm/09prf-rec-stark-prf-rec-step.png
Binary file added docs/img/zkvm/10l2-diff-trustd-virtual-state.png
Binary file added docs/img/zkvm/10msm-zkevm-stack-slots.png
Binary file added docs/img/zkvm/10prf-rec-proving-arch-outline.png
Binary file added docs/img/zkvm/11l2-stages-timeline-pending.png
Binary file added docs/img/zkvm/11prf-rec-build-zkevm-stark.png
Binary file added docs/img/zkvm/16prf-rec-recursive2-circuit.png
Binary file added docs/img/zkvm/fib10-pil-eg-mfibonacci.png
Binary file added docs/img/zkvm/fib11-pilcom-res-mfibon.png
Binary file added docs/img/zkvm/fib12-inside-parsed-pil.png
Binary file added docs/img/zkvm/fib13-pil-stark-setup.png
Binary file added docs/img/zkvm/fib14-pil-stark-in-prover.png
Binary file added docs/img/zkvm/fib15-pil-stark-in-verifier.png
Binary file added docs/img/zkvm/fib17-mfib-pil-w-pubs.png
Binary file added docs/img/zkvm/fib18-non-empt-pubs-field.png
Binary file added docs/img/zkvm/fib19-init-node-project.png
Binary file added docs/img/zkvm/fib20-dependncs-install-mfib.png
Binary file added docs/img/zkvm/fib4-deterministic-compt.png
Binary file added docs/img/zkvm/fib5-design-approach-outline.png
Binary file added docs/img/zkvm/fib6-mfibon-sm-2-regs.png
Binary file added docs/img/zkvm/fib7-mfibon-sm-3-regs.png
Binary file added docs/img/zkvm/fib8-code-eg-exec-trace.png
Binary file added docs/img/zkvm/fib9-stark-prf-sizes-times.png
Binary file added docs/img/zkvm/fig-micro-pro-pic.png
Binary file added docs/img/zkvm/fig1-zkprv-and-node.png
Binary file added docs/img/zkvm/fig2-actions-sec-sm.png
Binary file added docs/img/zkvm/fig3-zkNode-arch.png
Binary file added docs/img/zkvm/fig5-main-prts-zkpr.png
Binary file added docs/img/zkvm/gen1-typical-gen-sm.png
Binary file added docs/img/zkvm/gen3-gen-sm-w-input-instrctn.png
Binary file added docs/img/zkvm/gen4-sm-alg-processor.png
Binary file added docs/img/zkvm/gen5-sm-exec-broader-contxt.png
Binary file added docs/img/zkvm/gen6-pil-4instrct-prog.png
Binary file added docs/img/zkvm/gen7-state-machine-w-zkpc.png
Binary file added docs/img/zkvm/gen8-end-prog-w-loop.png
Binary file added docs/img/zkvm/governance-tree.png
Binary file added docs/img/zkvm/lxly-1-v1-asset-transfer.png
Binary file added docs/img/zkvm/lxly-2-new-bridge-design.png
Binary file added docs/img/zkvm/lxly-3-flow-rollupmanager.png
Binary file added docs/img/zkvm/plook-ops-mainSM-copy.png
Binary file added docs/img/zkvm/plookup-generic-sm-pil.png
Binary file added docs/img/zkvm/security-council-overview.png
Binary file added docs/img/zkvm/tup-pattern.png
Binary file added docs/img/zkvm/upgrade-overview.png
13 changes: 6 additions & 7 deletions docs/zkEVM/architecture/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ The strategic implementation of the contract-based consensus promises to ensure
- Is **protected from malicious attacks**, especially by validators
- Maintains a fair balance between overall validation effort and network value

:::tip Good to Know
!!!tip
Good to Know

Possibilities of coupling the Consensus Contract (previously called Proof of Efficiency or PoE) with a PoS (Proof of Stake) are currently being explored. A detailed description is published on the [<ins>Ethereum Research</ins>](https://ethresear.ch/t/proof-of-efficiency-a-new-consensus-mechanism-for-zk-rollups/11988) website.

Possibilities of coupling the Consensus Contract (previously called Proof of Efficiency or PoE) with a PoS (Proof of Stake) are currently being explored. A detailed description is published on the [<ins>Ethereum Research</ins>](https://ethresear.ch/t/proof-of-efficiency-a-new-consensus-mechanism-for-zk-rollups/11988) website.

:::

### On-chain data availability
Expand All @@ -57,11 +58,9 @@ Unless, among other things, the proving module can be highly accelerated to miti
The underlying protocol in zkEVM ensures that the state transitions are correct by employing a validity proof. To ensure that a set of pre-determined rules have been followed for allowing state transitions, the **Consensus Contract** (`PolygonZkEVM.sol`, deployed on L1) is utilized.
:::info
The **Consensus Contract** is currently deployed on both [<ins>Ethereum Mainnet</ins>](https://etherscan.io/address/0x5132A183E9F3CB7C848b0AAC5Ae0c4f0491B7aB2) and [<ins>Goerli Testnet</ins>](https://goerli.etherscan.io/address/0xa997cfD539E703921fD1e3Cf25b4c241a27a4c7A).
!!!info
The **Consensus Contract** is currently deployed on both [<ins>Ethereum Mainnet</ins>](https://etherscan.io/address/0x5132A183E9F3CB7C848b0AAC5Ae0c4f0491B7aB2) and [<ins>Goerli Testnet</ins>](https://goerli.etherscan.io/address/0xa997cfD539E703921fD1e3Cf25b4c241a27a4c7A).
:::
A smart contract verifies the validity proofs to ensure that each transition is completed correctly. This is accomplished by employing zk-SNARK circuits. A system of this type requires two processes: **transaction batching** and **transaction validation**.

Expand Down
Loading
Loading