Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/zkevm' into zkevm-2.60
Browse files Browse the repository at this point in the history
  • Loading branch information
cffls committed Jul 8, 2024
2 parents 668307e + f65b121 commit bcea43d
Show file tree
Hide file tree
Showing 87 changed files with 2,578 additions and 807 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci_zkevm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ jobs:
/usr/local/bin/yq -i '.args.data_availability_mode = "rollup"' cdk-erigon-sequencer-params.yml
/usr/local/bin/yq -i '.args.cdk_erigon_node_image = "cdk-erigon:local"' cdk-erigon-sequencer-params.yml
/usr/local/bin/yq -i '.args.zkevm_bridge_service_image = "hermeznetwork/zkevm-bridge-service:v0.5.0-RC8"' cdk-erigon-sequencer-params.yml
sed -i '/zkevm\.sequencer-initial-fork-id/d' ./templates/cdk-erigon/config-sequencer.yaml
- name: Deploy Kurtosis CDK package
working-directory: ./kurtosis-cdk
Expand Down Expand Up @@ -161,6 +162,9 @@ jobs:
cd ci_logs
kurtosis service logs cdk-v1 cdk-erigon-node-001 --all > cdk-erigon-node-001.log
kurtosis service logs cdk-v1 cdk-erigon-sequencer-001 --all > cdk-erigon-sequencer-001.log
kurtosis service logs cdk-v1 zkevm-agglayer-001 --all > zkevm-agglayer-001.log
kurtosis service logs cdk-v1 zkevm-prover-001 --all > zkevm-prover-001.log
kurtosis service logs cdk-v1 zkevm-executor-pless-001 --all > zkevm-executor-pless-001.log
- name: Upload logs
if: failure()
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/hourly-env-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Hourly - Envs Checker

on:
schedule:
- cron: '0 * * * *' # hourly
workflow_dispatch:

jobs:
test-node:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
include:
- name: "Integration 5 - Legacy"
network: "integration-5"
rpc: "http://34.175.214.161:8505"
- name: "Integration 5 - Erigon RPC"
network: "integration-5"
rpc: "http://34.175.214.161:8500"
- name: "Integration 5 - Erigon Sequencer"
network: "integration-5"
rpc: "http://34.175.214.161:8005"
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.20'

- name: Build Go application
run: go build -o check_node

- name: Run tests
run: ./check_node -rpcURL=${{ matrix.rpc }} -nodeName=${{ matrix.name }}
27 changes: 11 additions & 16 deletions .github/workflows/nightly-ansible.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ on:
jobs:
build:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
include:
- name: "Integration 5"
rpc_url: "http://34.175.214.161:8500"
eth_address: "0x41BB6960a5156aC29d6e9E04273837AD19d6691A"
secret_name: "NETWORK5_PRIVATE_KEY"
log_file: "/tmp/rpc-tests.d/evm-rpc-tests.log"
work_dir: "/tmp/rpc-tests.d"
max_block_size: "25000000"
legacy_flag: "--legacy"
block_interval: "12"
include:
- name: "integration-5"
rpc_url: "http://34.175.214.161:8500"
eth_address: "0x41BB6960a5156aC29d6e9E04273837AD19d6691A"
secret_name: "NETWORK5_PRIVATE_KEY"
- name: "cdk-1"
rpc_url: "http://34.175.214.161:8020"
eth_address: "0x673df8221611aD1f714053b82c4F9E2b0867CcC6"
secret_name: "CDK_1_PRIVATE_KEY"

steps:
- name: Checkout repository
Expand All @@ -33,13 +33,8 @@ jobs:
RPC_URL: ${{ matrix.rpc_url }}
PRIVATE_KEY: ${{ secrets[matrix.secret_name] }}
ETH_ADDRESS: ${{ matrix.eth_address }}
LOG_FILE: ${{ matrix.log_file }}
WORK_DIR: ${{ matrix.work_dir }}
MAX_BLOCK_SIZE: ${{ matrix.max_block_size }}
LEGACY_FLAG: ${{ matrix.legacy_flag }}
BLOCK_INTERVAL: ${{ matrix.block_interval }}
run: |
cd zk/tests/ansible/evm-rpc-tests && docker-compose up --build
cd zk/tests/ansible/evm-rpc-tests && docker compose build --quiet && docker compose up --exit-code-from ansible
- name: Upload logs
uses: actions/upload-artifact@v3
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/nightly-bridge-erc20.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

steps:
- name: Clone bridge repository
run: git clone --recurse-submodules -j8 https://github.com/0xPolygonHermez/zkevm-bridge-service.git -b develop bridge
run: git clone --recurse-submodules -j8 https://github.com/0xPolygonHermez/zkevm-bridge-service.git -b feature/test_bridge_messages_real_netowrk bridge

- name: Build docker image
run: |
Expand All @@ -35,6 +35,8 @@ jobs:
mkdir tmp
cat <<EOF > ./tmp/test.toml
TestAddrPrivate= "${{ secrets[matrix.l1_pk_secret_name] }}"
TestL1AddrPrivate="${{ secrets[matrix.l1_pk_secret_name] }}"
TestL2AddrPrivate="${{ secrets[matrix.l1_pk_secret_name] }}"
[ConnectionConfig]
L1NodeURL="${{ matrix.l1_ep }}"
L2NodeURL="${{ matrix.l2_ep }}"
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/nightly-bridge-msg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Nightly - BridgeMessage

on:
schedule:
- cron: '0 1 * * *' # run at 1am
workflow_dispatch:

jobs:
build-and-run:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- profile_name: "network5"
l1_ep: "https://rpc.eu-central-1.gateway.fm/v4/ethereum/non-archival/sepolia"
l2_ep: "http://34.175.214.161:8500"
bridge_ep: "http://34.175.214.161:8085"
l1_pk_secret_name: "L1_SEPOLIA_FUNDED_PRIVATE_KEY"
l2_pk_secret_name: "NETWORK5_PRIVATE_KEY"
bridge_addr: "0xb566BE17B22404BD46F389030ec5592F8ffAde12"

steps:
- name: Clone bridge repository
run: git clone --recurse-submodules -j8 https://github.com/0xPolygonHermez/zkevm-bridge-service.git -b feature/test_bridge_messages_real_netowrk bridge

- name: Build docker image
run: |
cd bridge
make build-docker-e2e-real_network
- name: Run test ERC20 Bridge
run: |
#!/bin/bash
cd bridge
mkdir tmp
cat <<EOF > ./tmp/test.toml
TestAddrPrivate= "${{ secrets[matrix.l1_pk_secret_name] }}"
TestL1AddrPrivate="${{ secrets[matrix.l1_pk_secret_name] }}"
TestL2AddrPrivate="${{ secrets[matrix.l1_pk_secret_name] }}"
[ConnectionConfig]
L1NodeURL="${{ matrix.l1_ep }}"
L2NodeURL="${{ matrix.l2_ep }}"
BridgeURL="${{ matrix.bridge_ep }}"
L1BridgeAddr="${{ matrix.bridge_addr }}"
L2BridgeAddr="${{ matrix.bridge_addr }}"
EOF
docker run --volume "./tmp/:/config/" --env BRIDGE_TEST_CONFIG_FILE=/config/test.toml bridge-e2e-realnetwork-msg
2 changes: 1 addition & 1 deletion .github/workflows/nightly-l1-recovery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:

- name: Run Docker Compose
working-directory: ./zk/tests/nightly-l1-recovery
run: docker compose -f docker-compose-nightly.yml up --build --exit-code-from=block-checker
run: docker compose build --quiet && docker compose up --exit-code-from=block-checker
2 changes: 1 addition & 1 deletion .github/workflows/nightly-node-compare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
compare-blocks:
runs-on: ubuntu-latest

continue-on-error: true
strategy:
matrix:
nodes:
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/nightly-rpc-batch-compare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Nightly - RPC Batch Compare

on:
schedule:
- cron: '0 23 * * *'
workflow_dispatch:


jobs:
run-rpc-batch-compare:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
include:
- name: bali
legacy: "https://rpc.zkevm-internal.com"
erigon: "https://rpc.internal.zkevm-rpc.com"
- name: integration5
legacy: "http://34.175.214.161:8505"
erigon: "http://34.175.214.161:8500"

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.20'

- name: Run RPC Batch Compare
run: go run ./zk/debug_tools/rpc-batch-compare -erigon="${{ matrix.erigon }}" -legacy="${{ matrix.legacy }}" -skip=100 -offset=1
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DOCKER := $(shell command -v docker 2> /dev/null)

GIT_COMMIT ?= $(shell git rev-list -1 HEAD)
GIT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
GIT_TAG ?= $(shell git describe --tags '--match=v*' --dirty 2>/dev/null || echo "untagged")
GIT_TAG ?= $(shell git describe --all)
ERIGON_USER ?= erigon
# if using volume-mounting data dir, then must exist on host OS
DOCKER_UID ?= $(shell id -u)
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ Sequencer specific config:
- `zkevm.executor-urls`: A csv list of the executor URLs. These will be used in a round robbin fashion by the sequencer
- `zkevm.executor-strict`: Defaulted to true, but can be set to false when running the sequencer without verifications (use with extreme caution)
- `zkevm.witness-full`: Defaulted to true. Controls whether the full or partial witness is used with the executor.
- `zkevm.sequencer-initial-fork-id`: The fork id to start the network with.

Resource Utilisation config:
- `zkevm.smt-regenerate-in-memory`: As documented above, allows SMT regeneration in memory if machine has enough RAM, for a speedup in initial sync.
Expand Down
1 change: 1 addition & 0 deletions cmd/integration/commands/stages_zkevm.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ func newSyncZk(ctx context.Context, db kv.RwDB) (consensus.Engine, *vm.Config, *
nil,
nil,
nil,
nil,
)
} else {
stages = stages2.NewDefaultZkStages(
Expand Down
5 changes: 0 additions & 5 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -501,11 +501,6 @@ var (
Usage: "Regenerate the SMT in memory (requires a lot of RAM for most chains)",
Value: false,
}
SequencerInitialForkId = cli.Uint64Flag{
Name: "zkevm.sequencer-initial-fork-id",
Usage: "The initial fork id to launch the sequencer with",
Value: 8,
}
SequencerBlockSealTime = cli.StringFlag{
Name: "zkevm.sequencer-block-seal-time",
Usage: "Block seal time. Defaults to 6s",
Expand Down
4 changes: 4 additions & 0 deletions core/vm/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ func run(evm *EVM, contract *Contract, input []byte, readOnly bool) ([]byte, err
return evm.interpreter.Run(contract, input, readOnly)
}

func runZk(evm *EVM, contract *Contract, input []byte, readOnly bool) ([]byte, error) {
return evm.interpreter.RunZk(contract, input, readOnly)
}

// EVM is the Ethereum Virtual Machine base object and provides
// the necessary tools to run a contract on the given state with
// the provided context. It should be noted that any error
Expand Down
4 changes: 2 additions & 2 deletions core/vm/evm_zkevm.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func (evm *EVM) createZkEvm(caller ContractRef, codeAndHash *codeAndHash, gas ui
return nil, address, gas, nil
}

ret, err = run(evm, contract, nil, false)
ret, err = runZk(evm, contract, nil, false)

// EIP-170: Contract code size limit
if err == nil && evm.chainRules.IsSpuriousDragon && len(ret) > params.MaxCodeSize {
Expand Down Expand Up @@ -336,7 +336,7 @@ func (evm *EVM) call_zkevm(typ OpCode, caller ContractRef, addr libcommon.Addres
if typ == STATICCALL {
readOnly = true
}
ret, err = run(evm, contract, input, readOnly)
ret, err = runZk(evm, contract, input, readOnly)
gas = contract.Gas
}
// When an error was returned by the EVM or when setting the creation code
Expand Down
2 changes: 2 additions & 0 deletions core/vm/interpreter.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ type Interpreter interface {
// the return byte-slice and an error if one occurred.
Run(contract *Contract, input []byte, static bool) ([]byte, error)

RunZk(contract *Contract, input []byte, static bool) ([]byte, error)

// `Depth` returns the current call stack's depth.
Depth() int
}
Expand Down
Loading

0 comments on commit bcea43d

Please sign in to comment.