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

Merge upstream v0.0.10 #24

Merged
merged 92 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
c7db2a8
Defined response fields json tags (#54)
begmaroman Feb 6, 2024
c0c5a0d
upgrade dependencies to compatible with validium v0.5.6-cdk
christophercampbell Feb 12, 2024
aba7ed0
timeout for e2e test
christophercampbell Feb 12, 2024
2c58691
collect node log on setup timeout
christophercampbell Feb 12, 2024
5e757e2
report running containers on setup failure
christophercampbell Feb 12, 2024
d1d4374
report more container stuff
christophercampbell Feb 12, 2024
7b32fc9
type fix
christophercampbell Feb 12, 2024
457a45f
validium container change, until 0xpolygon repo publishes amd container
christophercampbell Feb 12, 2024
8b6e4fb
Introduce `release` github workflow (#57)
Stefan-Ethernal Feb 20, 2024
2a632d2
use published zkevm-node cdk
christophercampbell Feb 28, 2024
f615330
Merge branch 'main' into upgrade-to-validium-v0.5.6-cdk
christophercampbell Feb 28, 2024
7e37792
add version command
christophercampbell Feb 28, 2024
72b3982
docker release file adjustments
christophercampbell Feb 28, 2024
9d69ded
packr2 steps & version adjustment
christophercampbell Feb 28, 2024
918967d
ignore packr2
christophercampbell Feb 28, 2024
9969f75
match sub version releases
christophercampbell Feb 28, 2024
7f8b711
Merge pull request #56 from 0xPolygon/upgrade-to-validium-v0.5.6-cdk
christophercampbell Feb 28, 2024
02b8b66
Merge branch 'main' into gorelase-fixes
christophercampbell Feb 28, 2024
d5853ea
Merge pull request #60 from 0xPolygon/gorelase-fixes
christophercampbell Feb 29, 2024
23a64ed
Create CODEOWNERS
mt-polygon-technology Mar 1, 2024
4c493fc
Create security-build.yml
mt-polygon-technology Mar 1, 2024
159cb61
Create sonar-cloud.yml
mt-polygon-technology Mar 1, 2024
ac5ab5b
added genesis block config (#63)
rachit77 Mar 7, 2024
9ed8d9a
DAC batch resolver resilience improvement (#62)
begmaroman Mar 11, 2024
2dec1d5
Update security-build.yml
mt-polygon-technology Mar 13, 2024
f7ff8e3
Merge branch 'main' into security-update
mt-polygon-technology Mar 13, 2024
dfc268b
Delete .github/workflows/sonar-cloud.yml
mt-polygon-technology Mar 13, 2024
390c760
Make DAC ws config tracking optional (#64)
begmaroman Mar 14, 2024
4c805e4
Improve syncronizer tracker in DAC (#66)
begmaroman Mar 18, 2024
c03eb57
Use new go-ethereum release (#67)
goran-ethernal Mar 21, 2024
e503acc
Implemented a new endpoint
begmaroman Mar 23, 2024
76e236e
Merge pull request #69 from 0xPolygon/feature/CDK-123-new
christophercampbell Mar 25, 2024
fc6c4bf
Update the `PolygonValidiumEtrog` smart contract to be aligned with f…
Stefan-Ethernal Mar 26, 2024
3ab9d9a
Implemented GetStatus endpoint (#74)
begmaroman Mar 26, 2024
6800405
Merge branch 'main' into security-update
Stefan-Ethernal Mar 27, 2024
4e76ab1
Added max connection retries number to the sequencer tracker (#76)
begmaroman Apr 2, 2024
2fce604
Merge branch 'main' into security-update
mt-polygon-technology Apr 4, 2024
2002ac3
Added polling mechanism to sequencer tracker (#77)
begmaroman Apr 9, 2024
76e1aa7
use header rather than block to get latest number during init
christophercampbell Apr 10, 2024
60c2d24
fix test
christophercampbell Apr 10, 2024
5b956c5
fix mock expectations
christophercampbell Apr 10, 2024
5398230
Merge pull request #78 from 0xPolygon/CDK-189-dac-issue-65
christophercampbell Apr 11, 2024
2318d49
Merge branch 'main' into security-update
christophercampbell Apr 24, 2024
b255a2a
Merge pull request #61 from 0xPolygon/security-update
christophercampbell Apr 24, 2024
d2cf833
chore: fix some typos in comments (#86)
socialsister May 15, 2024
38433c7
Include version info in the logs at the app startup (#88)
Stefan-Ethernal May 15, 2024
a272e06
feature: regression tests
rebelArtists May 22, 2024
0b77d87
fix: change default branch
rebelArtists May 22, 2024
4c27e9a
Merge pull request #90 from 0xPolygon/dan/regression_tests
rebelArtists May 23, 2024
3133609
limit the amount of unprocessed batch keys at a time
christophercampbell Jun 19, 2024
0f850ac
Added the limit of the maximum number of hashes that can be requested…
begmaroman Jun 20, 2024
af59632
Merge branch 'main' into ccampbell/limit-unprocessed-query
christophercampbell Jun 21, 2024
d98a596
Fixed unhandled Errors in consumeEvents loop (#93)
begmaroman Jun 21, 2024
d11e731
Merge branch 'main' into ccampbell/limit-unprocessed-query
christophercampbell Jun 21, 2024
30f1bf2
Merge pull request #92 from 0xPolygon/ccampbell/limit-unprocessed-query
christophercampbell Jun 21, 2024
bce3046
[Audit remediation] Issue B: Race Condition Between FilterSequenceBat…
goran-ethernal Jun 24, 2024
c39b94b
Adding initial for packages
djpolygon Jun 25, 2024
73edec7
Cleaning up the packager, removing entry to recreate the DEBIAN direc…
djpolygon Jun 25, 2024
c2bbe1b
Adding sudo to fix issue with mkdir in postinst script
djpolygon Jun 25, 2024
be68a80
Introduce thread-safe committee map to the `synchronizer` (#96)
Stefan-Ethernal Jun 26, 2024
97f3683
Removed unnecessary DB transactions use (#99)
begmaroman Jun 27, 2024
48558e6
[Audit remediation] Suggestion 1: Adopt a Verifiable Database / Batch…
begmaroman Jul 3, 2024
2319d3c
Add Linters (#97)
rachit77 Jul 11, 2024
72ae676
Feature/banana (#95)
arnaubennassar Jul 12, 2024
7833b6e
Merge pull request #98 from 0xPolygon/djpolygon/deb_packages
djpolygon Jul 12, 2024
d1534fc
Reporting offchain data gap detection (#102)
begmaroman Jul 16, 2024
6b4ea8b
Added Preparex to the DB statements (#104)
begmaroman Jul 17, 2024
f3879f1
Upating R&D Discord link (#103)
johnsoncarl Jul 17, 2024
796e6c9
Execute single multi writing query instead of multiple single querie…
begmaroman Jul 18, 2024
90d2f61
add Set and Get for Signature of types SignedSequence
joanestebanr Jul 22, 2024
2812c9e
Merge pull request #108 from 0xPolygon/feature/107-abs_signedSeq
joanestebanr Jul 22, 2024
2e10263
Removed packr (#110)
begmaroman Jul 29, 2024
bd6eed4
Removed signature normalisation (#111)
begmaroman Jul 31, 2024
6bf0e40
Return validation error if there are duplicates in the offchain data …
begmaroman Aug 13, 2024
3cc6e74
Remove duplicates offchain data when storing in DB
begmaroman Aug 13, 2024
e42be03
Fixed linter
begmaroman Aug 13, 2024
bc9b293
Fixed tests
begmaroman Aug 14, 2024
4877a49
Fixed linter
begmaroman Aug 14, 2024
3007e02
Fixed nits
begmaroman Aug 14, 2024
bf1e2f9
wip
arnaubennassar Aug 15, 2024
d1436f1
wip
arnaubennassar Aug 15, 2024
230aa34
wip
arnaubennassar Aug 15, 2024
f3d73df
wip
arnaubennassar Aug 15, 2024
b48599a
Remove duplicates from offchain data (#112)
begmaroman Aug 19, 2024
872bb66
Merge branch 'main' into fix/hash-to-sign
arnaubennassar Aug 19, 2024
9b683fc
Merge pull request #113 from 0xPolygon/fix/hash-to-sign
arnaubennassar Aug 19, 2024
51f4b0b
More UTs and fix regression tests (#116)
goran-ethernal Aug 28, 2024
d7ed6fd
fix: uts (#117)
goran-ethernal Aug 28, 2024
bc61672
Add synchronization for banana sequences (#118)
joanestebanr Sep 13, 2024
ddf18d0
Merge branch 'upstream/v0.0.10' into zjg/merge-v0.0.10
zjg555543 Nov 8, 2024
8cb579d
Fix ut (#25)
zjg555543 Nov 8, 2024
1e45248
Fix dockerfile name (#26)
zjg555543 Nov 8, 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
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @0xPolygon/core-cdk
21 changes: 21 additions & 0 deletions .github/actions/monitor-cdk-verified-batches/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: monitor-cdk-verified-batches
description: Check that batches are being verified in a CDK environment

inputs:
verified_batches_target:
description: The minimum number of batches to be verified
required: false
default: '30'
timeout:
description: The script timeout in seconds
required: false
default: '600' # 10 minutes

runs:
using: "composite"
steps:
- name: Check that batches are being verified
working-directory: .github/actions/monitor-cdk-verified-batches
shell: bash
run: ./batch_verification_monitor.sh ${{ inputs.verified_batches_target }} ${{ inputs.timeout }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

# This script monitors the verification progress of zkEVM batches.
# Usage: ./batch_verification_monitor <verified_batches_target> <timeout>

# The number of batches to be verified.
verified_batches_target="$1"

# The script timeout (in seconds).
timeout="$2"

start_time=$(date +%s)
end_time=$((start_time + timeout))

rpc_url="$(kurtosis port print cdk-v1 cdk-erigon-node-001 http-rpc)"
while true; do
verified_batches="$(cast to-dec "$(cast rpc --rpc-url "$rpc_url" zkevm_verifiedBatchNumber | sed 's/"//g')")"
echo "[$(date '+%Y-%m-%d %H:%M:%S')] Verified Batches: $verified_batches"

current_time=$(date +%s)
if (( current_time > end_time )); then
echo "[$(date '+%Y-%m-%d %H:%M:%S')] ❌ Exiting... Timeout reached!"
exit 1
fi

if (( verified_batches > verified_batches_target )); then
echo "[$(date '+%Y-%m-%d %H:%M:%S')] ✅ Exiting... $verified_batches batches were verified!"
exit 0
fi

sleep 10
done
5 changes: 5 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install Go
uses: actions/setup-go@v3
with:
go-version: '1.21.x'

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
126 changes: 126 additions & 0 deletions .github/workflows/deb_packager.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: deb_packager

on:
push:
branches:
- 'main'
paths:
- '**'
tags:
- 'v*.*.*'
- 'v*.*.*-*'

jobs:
build:
permissions:
id-token: write
contents: write
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@master
with:
go-version: 1.22.x
# Variables
- name: Adding TAG to ENV
run: echo "GIT_TAG=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV
- name: adding version
run: |
NUMERIC_VERSION=$( echo ${{ env.GIT_TAG }} | sed 's/[^0-9.]//g' )
echo "VERSION=$NUMERIC_VERSION" >> $GITHUB_ENV

- name: make clean
run: make clean

- name: build for amd64/x86
run: make build

- name: Making directory structure
run: mkdir -p packaging/deb/cdk-data-availability/usr/bin/
- name: Copying necessary binary file
run: cp -rp dist/cdk-data-availability packaging/deb/cdk-data-availability/usr/bin/
- name: create directory structure for systemd
run: mkdir -p packaging/deb/cdk-data-availability/lib/systemd/system
- name: copy the service file
run: cp -rp packaging/package_scripts/systemd/cdk-data-availability.service packaging/deb/cdk-data-availability/lib/systemd/system/


# Control file creation
- name: create control file
run: |
echo "Package: cdk-data-availability" >> packaging/deb/cdk-data-availability/DEBIAN/control
echo "Version: ${{ env.VERSION }}" >> packaging/deb/cdk-data-availability/DEBIAN/control
echo "Section: base" >> packaging/deb/cdk-data-availability/DEBIAN/control
echo "Priority: optional" >> packaging/deb/cdk-data-availability/DEBIAN/control
echo "Architecture: amd64" >> packaging/deb/cdk-data-availability/DEBIAN/control
echo "Maintainer: [email protected]" >> packaging/deb/cdk-data-availability/DEBIAN/control
echo "Description: cdk-data-availability binary package" >> packaging/deb/cdk-data-availability/DEBIAN/control

- name: Creating package for binary for cdk-data-availability ${{ env.ARCH }}
run: cp -rp packaging/deb/cdk-data-availability packaging/deb/cdk-data-availability-${{ env.GIT_TAG }}-${{ env.ARCH }}
env:
ARCH: amd64

- name: Running package build
run: dpkg-deb --build --root-owner-group packaging/deb/cdk-data-availability-${{ env.GIT_TAG }}-${{ env.ARCH }}
env:
ARCH: amd64

### Arm64 setup
- name: prepping environment for arm64 build
run: make clean

- name: removing amd64 control file
run: rm -rf packaging/deb/cdk-data-availability/DEBIAN/control

- name: Adding requirements for cross compile
run: sudo apt-get install g++-aarch64-linux-gnu gcc-aarch64-linux-gnu

- name: build for arm64
run: GOARCH=arm64 GOOS=linux CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ CGO_ENABLED=1 go build -o dist/cdk-data-availability ./cmd/main.go

- name: copying necessary files
run: cp -rp dist/cdk-data-availability packaging/deb/cdk-data-availability/usr/bin/

- name: create control file
run: |
echo "Package: cdk-data-availability" >> packaging/deb/cdk-data-availability/DEBIAN/control
echo "Version: ${{ env.VERSION }}" >> packaging/deb/cdk-data-availability/DEBIAN/control
echo "Section: base" >> packaging/deb/cdk-data-availability/DEBIAN/control
echo "Priority: optional" >> packaging/deb/cdk-data-availability/DEBIAN/control
echo "Architecture: arm64" >> packaging/deb/cdk-data-availability/DEBIAN/control
echo "Maintainer: [email protected]" >> packaging/deb/cdk-data-availability/DEBIAN/control
echo "Description: cdk-data-availability binary package" >> packaging/deb/cdk-data-availability/DEBIAN/control

- name: Creating package for binary for cdk-data-availability ${{ env.ARCH }}
run: cp -rp packaging/deb/cdk-data-availability packaging/deb/cdk-data-availability-${{ env.GIT_TAG }}-${{ env.ARCH }}
env:
ARCH: arm64

- name: Running package build
run: dpkg-deb --build --root-owner-group packaging/deb/cdk-data-availability-${{ env.GIT_TAG }}-${{ env.ARCH }}
env:
ARCH: arm64

- name: create checksum for the amd64 package for cdk-data-availability
run: cd packaging/deb/ && sha256sum cdk-data-availability-${{ env.GIT_TAG }}-${{ env.ARCH }}.deb > cdk-data-availability-${{ env.GIT_TAG }}-${{ env.ARCH }}.deb.checksum
env:
ARCH: amd64

- name: create checksum for the arm64 package for cdk-data-availability
run: cd packaging/deb/ && sha256sum cdk-data-availability-${{ env.GIT_TAG }}-${{ env.ARCH }}.deb > cdk-data-availability-${{ env.GIT_TAG }}-${{ env.ARCH }}.deb.checksum
env:
ARCH: arm64

- name: Release cdk-data-availability Packages
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.GIT_TAG }}
prerelease: true
files: |
packaging/deb/cdk-data-availability**.deb
packaging/deb/cdk-data-availability**.deb.checksum
9 changes: 5 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.19.x
go-version: 1.21.x
cache: false
- name: Checkout code
uses: actions/checkout@v3
- name: Lint
run: |
make install-linter
make lint
uses: golangci/[email protected]
with:
args: --timeout 10m --verbose
49 changes: 49 additions & 0 deletions .github/workflows/regression-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Regression Tests

on:
pull_request:
types: [opened, synchronize] # Trigger on new PR and existing with new commits
branches:
- main

jobs:
deploy_devnet:
runs-on: ubuntu-latest
steps:
- name: Checkout cdk-data-availability
uses: actions/checkout@v4
with:
path: cdk-data-availability

- name: Checkout kurtosis-cdk
uses: actions/checkout@v4
with:
repository: 0xPolygon/kurtosis-cdk
ref: main
path: kurtosis-cdk

- name: Install Kurtosis CDK tools
uses: ./kurtosis-cdk/.github/actions/setup-kurtosis-cdk

- name: Build docker image
working-directory: ./cdk-data-availability
run: docker build -t cdk-data-availability:local --file Dockerfile .

- name: Configure Kurtosis CDK
working-directory: ./kurtosis-cdk
run: |
yq -Y --in-place '.args.data_availability_mode = "cdk-validium"' params.yml
yq -Y --in-place '.args.zkevm_da_image = "cdk-data-availability:local"' params.yml

- name: Deploy Kurtosis CDK package
working-directory: ./kurtosis-cdk
run: kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always .

- name: Set executable permissions for the script
working-directory: ./cdk-data-availability
run: sudo chmod +x .github/actions/monitor-cdk-verified-batches/batch_verification_monitor.sh

- name: Monitor verified batches
working-directory: ./cdk-data-availability
shell: bash
run: .github/actions/monitor-cdk-verified-batches/batch_verification_monitor.sh 19 600
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release

on:
push:
tags:
# run only against tags that follow semver (https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string)
- 'v[0-9]+.[0-9]+.[0-9]+*'
- 'v[0-9]+.[0-9]+.[0-9]+*.[0-9]+'

permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21.x

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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:
workflow_dispatch: {}

jobs:
govuln:
name: Run govuln check and Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Running govulncheck
uses: Templum/[email protected]
continue-on-error: true
env:
DEBUG: "true"
with:
go-version: 1.21.x
vulncheck-version: latest
package: ./...
github-token: ${{ secrets.GITHUB_TOKEN }}
fail-on-vuln: true
2 changes: 1 addition & 1 deletion .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
go-version: [ 1.19.x ]
go-version: [ 1.21.x ]
goarch: [ "amd64" ]
runs-on: ubuntu-latest
steps:
Expand Down
44 changes: 22 additions & 22 deletions .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
go-version: [ 1.19.x ]
go-version: [ 1.21.x ]
goarch: [ "amd64" ]
runs-on: ubuntu-latest
steps:
Expand All @@ -40,24 +40,24 @@ jobs:
name: code-coverage-report
path: test/coverage.out

# sonar-cloud:
# needs: test-unit
# name: SonarCloud
# runs-on: ubuntu-latest
# steps:
# - name: Checkout Code
# uses: actions/checkout@v3
# with:
# submodules: recursive
# fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

# - name: Download code coverage results
# uses: actions/download-artifact@v3
# with:
# name: code-coverage-report

# - name: Analyze with SonarCloud
# uses: sonarsource/sonarcloud-github-action@master
# env:
# GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN }}
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# sonar-cloud:
# needs: test-unit
# name: SonarCloud
# runs-on: ubuntu-latest
# steps:
# - name: Checkout Code
# uses: actions/checkout@v3
# with:
# submodules: recursive
# fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
#
# - name: Download code coverage results
# uses: actions/download-artifact@v3
# with:
# name: code-coverage-report
#
# - name: Analyze with SonarCloud
# uses: sonarsource/sonarcloud-github-action@master
# env:
# GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN }}
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ dist

test/gethData
test/coverage.out
coverage.out
Loading
Loading