Skip to content

Commit b05c052

Browse files
authored
Merge pull request #1787 from 0xPolygon/v2.3.0-candidate
Merge V2.3.0 candidate
2 parents ab92718 + 9143871 commit b05c052

File tree

243 files changed

+17639
-1709
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

243 files changed

+17639
-1709
lines changed

.github/workflows/go.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

.github/workflows/kurtosis-e2e.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
uses: actions/checkout@v5
5353
with:
5454
repository: 0xPolygon/kurtosis-pos
55-
ref: v1.1.4
55+
ref: v1.1.11
5656
path: kurtosis-pos
5757

5858
- name: Pre kurtosis run
@@ -83,7 +83,16 @@ jobs:
8383
run: kurtosis enclave inspect ${{ env.ENCLAVE_NAME }}
8484

8585
- name: Test state syncs
86-
run: kurtosis service exec ${{ env.ENCLAVE_NAME }} test-runner "bats --filter-tags pos,bridge,l1,l2 --recursive tests/"
86+
run: kurtosis service exec ${{ env.ENCLAVE_NAME }} test-runner "bats --filter 'bridge MATIC/POL, ERC20, and ERC721 from L1 to L2 and confirm L2 balances increased' tests/pos/bridge.bats"
87+
88+
- name: Run RPC tests
89+
run: |
90+
export RPC_URL=$(kurtosis port print ${{ env.ENCLAVE_NAME }} l2-el-1-bor-heimdall-v2-validator rpc)
91+
export PRIV_KEY="0xd40311b5a5ca5eaeb48dfba5403bde4993ece8eccf4190e98e19fcd4754260ea"
92+
93+
cd pos-workflows/tests/rpc_tests
94+
go mod tidy
95+
go run . --priv-key "$PRIV_KEY" --rpc-url "$RPC_URL" --log-req-res true
8796
8897
- name: Run smoke tests (Checkpoints and Milestones)
8998
run: bash ./pos-workflows/tests/kurtosis_smoke_test.sh
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Stateless Sync Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
- 'develop'
8+
pull_request:
9+
branches:
10+
- 'master'
11+
- 'develop'
12+
types: [opened, synchronize]
13+
14+
concurrency:
15+
group: stateless-sync-${{ github.event.pull_request.number || github.ref }}
16+
cancel-in-progress: true
17+
18+
env:
19+
ENCLAVE_NAME: kurtosis-stateless-e2e
20+
21+
jobs:
22+
e2e-tests:
23+
name: E2E Tests
24+
runs-on: ubuntu-latest
25+
timeout-minutes: 45
26+
27+
steps:
28+
# This is needed because the job fails with "System.IO.IOException: No space left on device".
29+
- name: Free disk space
30+
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # 2023/10/19
31+
with:
32+
tool-cache: true
33+
34+
- name: Install dependencies on Linux
35+
if: runner.os == 'Linux'
36+
run: sudo apt update && sudo apt install build-essential
37+
38+
- name: Checkout bor
39+
uses: actions/checkout@v5
40+
with:
41+
path: bor
42+
43+
- name: Checkout heimdall-v2
44+
uses: actions/checkout@v5
45+
with:
46+
repository: 0xPolygon/heimdall-v2
47+
ref: develop
48+
path: heimdall-v2
49+
50+
- name: Checkout pos-workflows
51+
uses: actions/checkout@v5
52+
with:
53+
repository: 0xPolygon/pos-workflows
54+
ref: main
55+
path: pos-workflows
56+
57+
- name: Checkout kurtosis-pos
58+
uses: actions/checkout@v5
59+
with:
60+
repository: 0xPolygon/kurtosis-pos
61+
ref: stateless
62+
path: kurtosis-pos
63+
64+
- name: Pre kurtosis run
65+
uses: ./pos-workflows/.github/actions/kurtosis-pre-run
66+
with:
67+
docker_username: ${{ secrets.DOCKERHUB }}
68+
docker_token: ${{ secrets.DOCKERHUB_KEY }}
69+
70+
- name: Build bor docker image
71+
run: |
72+
cd bor
73+
docker build -t bor:local --file Dockerfile .
74+
75+
- name: Build heimdall-v2 docker image
76+
run: |
77+
cd heimdall-v2
78+
docker build -t heimdall-v2:local --file Dockerfile .
79+
80+
- name: Copy kurtosis config
81+
run: cp ./pos-workflows/.github/configs/kurtosis-stateless-e2e.yml ./kurtosis-pos/kurtosis-stateless-e2e.yml
82+
83+
- name: Kurtosis run
84+
run: |
85+
cd kurtosis-pos
86+
kurtosis run --args-file=kurtosis-stateless-e2e.yml --enclave ${{ env.ENCLAVE_NAME }} .
87+
88+
- name: Inspect enclave
89+
run: kurtosis enclave inspect ${{ env.ENCLAVE_NAME }}
90+
91+
- name: Run stateless sync tests
92+
run: |
93+
cd pos-workflows
94+
bash tests/stateless_tests/kurtosis_stateless_test.sh
95+
96+
- name: Test state syncs (post VeBlop HF)
97+
run: kurtosis service exec ${{ env.ENCLAVE_NAME }} test-runner "bats --filter 'bridge MATIC/POL, ERC20, and ERC721 from L1 to L2 and confirm L2 balances increased' tests/pos/bridge.bats"
98+
99+
- name: Post kurtosis run
100+
if: always()
101+
uses: ./pos-workflows/.github/actions/kurtosis-post-run
102+
with:
103+
enclave_name: ${{ env.ENCLAVE_NAME }}

.golangci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ linters:
5757
- std-error-handling
5858
rules:
5959
- linters:
60-
- deadcode
6160
- staticcheck
6261
path: crypto/bn256/cloudflare/optate.go
6362
- linters:

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ COPY --from=builder ${BOR_DIR}/build/bin/bor /usr/bin/
3636

3737
EXPOSE 8545 8546 8547 30303 30303/udp
3838

39-
ENTRYPOINT ["bor"]
39+
ENTRYPOINT ["bor"]

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ protoc:
3434
protoc --go_out=. --go-grpc_out=. ./internal/cli/server/proto/*.proto
3535

3636
generate-mocks:
37+
go generate ./internal/ethapi
3738
go generate ./consensus/bor
3839
go generate ./eth/filters
3940
go generate ./ethdb

accounts/abi/bind/backends/simulated.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ func (b *SimulatedBackend) Commit() common.Hash {
130130
b.mu.Lock()
131131
defer b.mu.Unlock()
132132

133-
if _, err := b.blockchain.InsertChain([]*types.Block{b.pendingBlock}); err != nil {
133+
if _, err := b.blockchain.InsertChain([]*types.Block{b.pendingBlock}, false); err != nil {
134134
panic(err) // This cannot happen unless the simulator is wrong, fail in that case
135135
}
136136
blockHash := b.pendingBlock.Hash()

accounts/abi/bind/backends/simulated_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func TestSimulatedBackend(t *testing.T) {
4848
)...)
4949
var gasLimit uint64 = 8000029
5050

51-
key, _ := crypto.GenerateKey() // nolint: gosec
51+
key, _ := crypto.GenerateKey() // nolint:gosec
5252
auth, _ := bind.NewKeyedTransactorWithChainID(key, big.NewInt(1337))
5353
genAlloc := make(types.GenesisAlloc)
5454
genAlloc[auth.From] = types.Account{Balance: big.NewInt(9223372036854775807)}

accounts/keystore/passphrase_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func TestKeyEncryptDecrypt(t *testing.T) {
5555
t.Errorf("test %d: key address mismatch: have %x, want %x", i, key.Address, address)
5656
}
5757
// Recrypt with a new password and start over
58-
password += "new data appended" // nolint: gosec
58+
password += "new data appended" // nolint:gosec
5959
if keyjson, err = EncryptKey(key, password, veryLightScryptN, veryLightScryptP); err != nil {
6060
t.Errorf("test %d: failed to re-encrypt key %v", i, err)
6161
}

builder/files/config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ syncmode = "full"
1717
# snapshot = true
1818
# "bor.logs" = false
1919
# ethstats = ""
20+
# witnessprotocol = false
2021
# devfakeauthor = false
2122
# ["eth.requiredblocks"]
2223

0 commit comments

Comments
 (0)