Skip to content

Commit

Permalink
Merge branch 'upstream/v0.0.11' into zjg/basedev-v0.0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
zjg555543 committed Dec 6, 2024
2 parents 9ea2463 + e451625 commit be50c23
Show file tree
Hide file tree
Showing 32 changed files with 697 additions and 1,296 deletions.
21 changes: 0 additions & 21 deletions .github/actions/monitor-cdk-verified-batches/action.yml

This file was deleted.

This file was deleted.

33 changes: 21 additions & 12 deletions .github/workflows/regression-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,19 @@ on:

jobs:
deploy_devnet:
strategy:
matrix:
go-version: [ 1.22.x ]
goarch: [ "amd64" ]
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
env:
GOARCH: ${{ matrix.goarch }}

- name: Checkout cdk-data-availability
uses: actions/checkout@v4
with:
Expand All @@ -19,7 +30,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: 0xPolygon/kurtosis-cdk
ref: main
ref: v0.2.24
path: kurtosis-cdk

- name: Install Kurtosis CDK tools
Expand All @@ -29,21 +40,19 @@ jobs:
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 .
run: >
kurtosis run --enclave cdk . '{"args": {"zkevm_da_image": "cdk-data-availability:local", "consensus_contract_type": "cdk-validium"}}'
- 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
working-directory: ./kurtosis-cdk
run: sudo chmod +x .github/scripts/monitor-verified-batches.sh

- name: Monitor verified batches
working-directory: ./cdk-data-availability
working-directory: ./kurtosis-cdk
shell: bash
run: .github/actions/monitor-cdk-verified-batches/batch_verification_monitor.sh 19 600
run: |
rpc_url="$(kurtosis port print cdk cdk-erigon-rpc-001 rpc)"
echo "Using RPC URL: $rpc_url"
.github/scripts/monitor-verified-batches.sh --enclave cdk --rpc-url "$rpc_url" --target 19 --timeout 600
14 changes: 7 additions & 7 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
---
run:
timeout: 5m
skip-dirs:
- state/runtime/fakevm
- state/runtime/instrumentation
- test
- ci
- mocks


linters:
enable:
- whitespace # Tool for detection of leading and trailing whitespace
Expand Down Expand Up @@ -50,6 +44,12 @@ issues:
linters:
- gosec
- lll
exclude-dirs:
- state/runtime/fakevm
- state/runtime/instrumentation
- test
- ci
- mocks
include:
- EXC0012 # EXC0012 revive: Annoying issue about not having a comment. The rare codebase has such comments
- EXC0014 # EXC0014 revive: Annoying issue about not having a comment. The rare codebase has such comments
6 changes: 0 additions & 6 deletions .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,3 @@ packages:
SequencerTracker:
config:
filename: sequencer_tracker.generated.go
github.com/0xPolygon/cdk-data-availability/services/status:
config:
interfaces:
GapsDetector:
config:
filename: gaps_detector.generated.go
21 changes: 21 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Run DAC",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceFolder}/cmd",
"args": [
"run",
"-cfg",
"test/config/test.local.toml",
],
"cwd": ".",
},
]
}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# CONTAINER FOR BUILDING BINARY
FROM golang:1.21 AS build
FROM golang:1.22 AS build

WORKDIR $GOPATH/src/github.com/0xPolygon/cdk-data-availability

Expand Down
2 changes: 1 addition & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (f *factory) New(url string) Client {
return New(url)
}

// Client wraps all the available endpoints of the data abailability committee node server
// Client wraps all the available endpoints of the data availability committee node server
type client struct {
url string
}
Expand Down
12 changes: 6 additions & 6 deletions client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ func TestClient_GetStatus(t *testing.T) {
}{
{
name: "successfully got status",
result: `{"result":{"version":"v1.0.0","uptime":"123","key_count":2,"backfill_progress":5}}`,
result: `{"result":{"version":"v1.0.0","uptime":"123","key_count":2,"last_synchronized_block":5}}`,
status: &types.DACStatus{
Uptime: "123",
Version: "v1.0.0",
KeyCount: 2,
BackfillProgress: 5,
Uptime: "123",
Version: "v1.0.0",
KeyCount: 2,
LastSynchronizedBlock: 5,
},
},
{
Expand Down Expand Up @@ -251,7 +251,7 @@ func TestClient_ListOffChainData(t *testing.T) {
err error
}{
{
name: "successfully got offhcain data",
name: "successfully got offchain data",
hashes: []common.Hash{common.BytesToHash([]byte("hash"))},
result: fmt.Sprintf(`{"result":{"%s":"%s"}}`,
common.BytesToHash([]byte("hash")).Hex(), hex.EncodeToString([]byte("offchaindata"))),
Expand Down
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func start(cliCtx *cli.Context) error {
[]rpc.Service{
{
Name: status.APISTATUS,
Service: status.NewEndpoints(storage, batchSynchronizer),
Service: status.NewEndpoints(storage),
},
{
Name: sync.APISYNC,
Expand Down
Loading

0 comments on commit be50c23

Please sign in to comment.