Skip to content

Commit c527268

Browse files
authored
Bump up relayer version to 0.5.3 (#28)
Update relayer Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
1 parent 7ee0517 commit c527268

Some content is hidden

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

46 files changed

+819
-1083
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,19 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: checkout
16-
uses: actions/checkout@v3
16+
uses: actions/checkout@v4
1717
with:
1818
fetch-depth: 0
1919
- name: setup
20-
uses: actions/setup-go@v4
20+
uses: actions/setup-go@v5
2121
with:
22-
go-version: '1.20'
22+
go-version: '1.21'
2323
- name: lint
24-
uses: golangci/golangci-lint-action@v3
24+
uses: golangci/golangci-lint-action@v6
2525
with:
26-
version: v1.53
27-
args: --timeout=5m0s
26+
version: v1.58
27+
# still using the deprecated types in ibc-go v8
28+
args: --timeout=5m0s --disable staticcheck
2829
- name: test
2930
run: go test -v ./...
3031
e2e:
@@ -33,13 +34,13 @@ jobs:
3334
runs-on: ubuntu-latest
3435
steps:
3536
- name: checkout
36-
uses: actions/checkout@v3
37+
uses: actions/checkout@v4
3738
with:
3839
fetch-depth: 0
3940
- name: setup
40-
uses: actions/setup-go@v4
41+
uses: actions/setup-go@v5
4142
with:
42-
go-version: '1.20'
43+
go-version: '1.21'
4344
- name: test
4445
working-directory: e2e
4546
run: |

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ BSC_IBC_PROTO ?= ../parlia-elc/proto/definitions
33

44
DOCKER := $(shell which docker)
55

6-
protoVer=0.13.1
6+
protoVer=0.14.0
77
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
88
protoImage=$(DOCKER) run --user 0 --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)
99

e2e/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
.PHONY:chain
22
chain:
3-
make -C chains build
4-
make -C chains network
3+
# For Apple Silicon explicit declaration 'linux/amd64' is required
4+
DOCKER_DEFAULT_PLATFORM=linux/amd64 make -C chains build
5+
DOCKER_DEFAULT_PLATFORM=linux/amd64 make -C chains network
56
# Wait for one epoch to use BEP-126 validator
67
sleep 60
78

e2e/chains/bsc/Dockerfile.bsc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
FROM golang:1.19-alpine
1+
FROM golang:1.21-alpine
22

33
ARG GIT_SOURCE
44
ARG GIT_CHECKOUT_BRANCH
55

6-
RUN apk add --no-cache make cmake gcc musl-dev linux-headers git bash build-base libc-dev
6+
RUN apk add --no-cache make cmake gcc musl-dev linux-headers git bash build-base libc-dev jq
77

88
ENV CGO_CFLAGS="-O -D__BLST_PORTABLE__"
99
ENV CGO_CFLAGS_ALLOW="-O -D__BLST_PORTABLE__"

e2e/chains/bsc/config/config-bsc-rpc.toml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,15 @@ EnablePreimageRecording = false
77
[Eth.Miner]
88
GasFloor = 30000000
99
GasCeil = 40000000
10-
GasPrice = 5000000000
10+
GasPrice = 3000000000
1111
Recommit = 10000000000
12-
Noverify = false
13-
14-
[Eth.Ethash]
15-
CacheDir = ""
16-
CachesInMem = 0
17-
CachesOnDisk = 0
18-
CachesLockMmap = false
19-
DatasetDir = ""
20-
DatasetsInMem = 0
21-
DatasetsOnDisk = 0
22-
DatasetsLockMmap = false
23-
PowMode = 0
2412

2513
[Eth.TxPool]
2614
Locals = []
2715
NoLocals = true
2816
Journal = "transactions.rlp"
2917
Rejournal = 3600000000000
30-
PriceLimit = 5000000000
18+
PriceLimit = 3000000000
3119
PriceBump = 10
3220
AccountSlots = 128
3321
GlobalSlots = 10000
@@ -64,4 +52,4 @@ EnableMsgEvents = false
6452
[Node.HTTPTimeouts]
6553
ReadTimeout = 30000000000
6654
WriteTimeout = 30000000000
67-
IdleTimeout = 120000000000
55+
IdleTimeout = 120000000000

e2e/chains/bsc/config/config-validator.toml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,8 @@ EVMInterpreter = ""
1616
[Eth.Miner]
1717
GasFloor = 30000000
1818
GasCeil = 40000000
19-
GasPrice = 5000000000
19+
GasPrice = 3000000000
2020
Recommit = 10000000000
21-
Noverify = false
22-
23-
[Eth.Ethash]
24-
CacheDir = ""
25-
CachesInMem = 0
26-
CachesOnDisk = 0
27-
CachesLockMmap = false
28-
DatasetDir = ""
29-
DatasetsInMem = 0
30-
DatasetsOnDisk = 0
31-
DatasetsLockMmap = false
32-
PowMode = 0
3321

3422
[Eth.GPO]
3523
Blocks = 20
@@ -55,4 +43,4 @@ EnableMsgEvents = false
5543

5644
[Node.HTTPTimeouts]
5745
ReadTimeout = 30000000000
58-
WriteTimeout = 30000000000
46+
WriteTimeout = 30000000000
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
version: "3.8"
2-
31
services:
42
bsc-geth:
53
build:
64
context: .
75
dockerfile: Dockerfile.bsc
86
args:
97
GIT_SOURCE: https://github.com/binance-chain/bsc.git
10-
GIT_CHECKOUT_BRANCH: v1.2.10
8+
GIT_CHECKOUT_BRANCH: v1.4.5
119
image: bsc-geth:docker-local

e2e/chains/bsc/docker-compose.simple.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: "3.8"
2-
31
volumes:
42
bsc-rpc:
53
bsc-validator1-1:
@@ -34,7 +32,6 @@ services:
3432
- ./scripts:/root/scripts
3533
- ./config:/root/config
3634
- ./init-holders:/root/init-holders
37-
- ./validators/bls:/root/validators/bls
3835
- ./validators/keystore:/root/validators/keystore
3936
command: /root/scripts/bootstrap.sh
4037

@@ -57,7 +54,6 @@ services:
5754
- ./scripts:/root/scripts
5855
- ./config:/root/config
5956
- ./init-holders:/root/init-holders
60-
- ./validators/bls:/root/validators/bls
6157
- ./validators/keystore:/root/validators/keystore
6258
command: /root/scripts/bootstrap.sh
6359

Lines changed: 38 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,66 @@
11
#!/usr/bin/env bash
22

33
workspace=$(
4-
cd $(dirname $0)
5-
pwd
4+
cd $(dirname $0)
5+
pwd
66
)/..
77

88
function prepare() {
9-
if ! [[ -f /usr/local/bin/geth ]]; then
10-
echo "geth do not exist!"
11-
exit 1
12-
fi
13-
# run `make clean` to remove files
14-
cd ${workspace}/genesis
15-
rm -rf validators.conf
9+
if ! [[ -f /usr/local/bin/geth ]]; then
10+
echo "geth do not exist!"
11+
exit 1
12+
fi
13+
# run `make clean` to remove files
14+
cd ${workspace}/genesis
15+
rm -rf validators.conf
1616
}
1717

1818
function init_validator() {
19-
node_id=$1
19+
node_id=$1
2020

2121
# set validator address
22-
mkdir -p ${workspace}/storage/${node_id}/keystore
23-
cp ${workspace}/validators/keystore/${node_id} ${workspace}/storage/${node_id}/keystore/${node_id}
22+
mkdir -p ${workspace}/storage/${node_id}/keystore
23+
cp ${workspace}/validators/keystore/${node_id} ${workspace}/storage/${node_id}/keystore/${node_id}
2424
validatorAddr=0x$(cat ${workspace}/storage/${node_id}/keystore/${node_id} | jq .address | sed 's/"//g')
25-
echo ${validatorAddr} >${workspace}/storage/${node_id}/address
25+
echo ${validatorAddr} >${workspace}/storage/${node_id}/address
2626

27-
# import BLS vote address
28-
echo password01 > ${workspace}/storage/${node_id}/blspassword.txt
29-
geth --datadir ${workspace}/storage/${node_id} bls account import ${workspace}/validators/bls/${node_id} --blspassword ${workspace}/storage/${node_id}/blspassword.txt --blsaccountpassword ${workspace}/storage/${node_id}/blspassword.txt
30-
geth --datadir ${workspace}/storage/${node_id} bls account list --blspassword ${workspace}/storage/${node_id}/blspassword.txt
31-
voteAddr=0x$(cat ${workspace}/validators/bls/${node_id} | jq .pubkey | sed 's/"//g')
27+
# create new BLS vote address
28+
expect ${workspace}/scripts/create_bls_key.sh ${workspace}/storage/${node_id}
29+
voteAddr=0x$(cat ${workspace}/storage/${node_id}/bls/keystore/*json| jq .pubkey | sed 's/"//g')
30+
echo $voteAddr
3231

33-
echo "${validatorAddr},${validatorAddr},${validatorAddr},0x0000000010000000,${voteAddr}" >>${workspace}/genesis/validators.conf
32+
echo "${validatorAddr},${validatorAddr},${validatorAddr},0x0000000010000000,${voteAddr}" >>${workspace}/genesis/validators.conf
3433
}
3534

3635
function generate_genesis() {
37-
INIT_HOLDER_ADDRESSES=$(ls ${workspace}/init-holders | tr '\n' ',')
38-
INIT_HOLDER_ADDRESSES=${INIT_HOLDER_ADDRESSES/%,/}
39-
echo "blocks per epoch = ${BLOCKS_PER_EPOCH}"
40-
sed "s/{{BLOCKS_PER_EPOCH}}/${BLOCKS_PER_EPOCH}/g" ${workspace}/genesis/genesis-template.template >${workspace}/genesis/genesis-template.json
41-
sed "s/{{INIT_HOLDER_ADDRESSES}}/${INIT_HOLDER_ADDRESSES}/g" ${workspace}/genesis/init_holders.template | sed "s/{{INIT_HOLDER_BALANCE}}/${INIT_HOLDER_BALANCE}/g" >${workspace}/genesis/init_holders.js
42-
node generate-validator.js
43-
chainIDHex=$(printf '%04x\n' ${BSC_CHAIN_ID})
44-
node generate-genesis.js --chainid ${BSC_CHAIN_ID} --bscChainId ${chainIDHex}
36+
INIT_HOLDER_ADDRESSES=$(ls ${workspace}/init-holders | tr '\n' ',')
37+
INIT_HOLDER_ADDRESSES=${INIT_HOLDER_ADDRESSES/%,/}
38+
echo "blocks per epoch = ${BLOCKS_PER_EPOCH}"
39+
sed "s/{{BLOCKS_PER_EPOCH}}/${BLOCKS_PER_EPOCH}/g" ${workspace}/genesis/genesis-template.template >${workspace}/genesis/genesis-template.json
40+
sed "s/{{INIT_HOLDER_ADDRESSES}}/${INIT_HOLDER_ADDRESSES}/g" ${workspace}/genesis/init_holders.template | sed "s/{{INIT_HOLDER_BALANCE}}/${INIT_HOLDER_BALANCE}/g" >${workspace}/genesis/init_holders.js
41+
node generate-validator.js
42+
chainIDHex=$(printf '%04x\n' ${BSC_CHAIN_ID})
43+
node generate-genesis.js --chainid ${BSC_CHAIN_ID} --bscChainId ${chainIDHex}
4544
}
4645

4746
function init_genesis_data() {
48-
node_type=$1
49-
node_id=$2
50-
geth --datadir ${workspace}/storage/${node_id} init ${workspace}/genesis/genesis.json
51-
cp ${workspace}/config/config-${node_type}.toml ${workspace}/storage/${node_id}/config.toml
52-
sed -i -e "s/{{NetworkId}}/${BSC_CHAIN_ID}/g" ${workspace}/storage/${node_id}/config.toml
53-
if [ "${node_id}" == "bsc-rpc" ]; then
54-
cp ${workspace}/init-holders/* ${workspace}/storage/${node_id}/keystore
55-
cp ${workspace}/genesis/genesis.json ${workspace}/storage/${node_id}
56-
cp ${workspace}/config/bootstrap.key ${workspace}/storage/${node_id}/geth/nodekey
57-
fi
47+
node_type=$1
48+
node_id=$2
49+
geth --datadir ${workspace}/storage/${node_id} init --state.scheme hash --db.engine=leveldb ${workspace}/genesis/genesis.json
50+
cp ${workspace}/config/config-${node_type}.toml ${workspace}/storage/${node_id}/config.toml
51+
sed -i -e "s/{{NetworkId}}/${BSC_CHAIN_ID}/g" ${workspace}/storage/${node_id}/config.toml
52+
if [ "${node_id}" == "bsc-rpc" ]; then
53+
cp ${workspace}/init-holders/* ${workspace}/storage/${node_id}/keystore
54+
cp ${workspace}/genesis/genesis.json ${workspace}/storage/${node_id}
55+
cp ${workspace}/config/bootstrap.key ${workspace}/storage/${node_id}/geth/nodekey
56+
fi
5857
}
5958

6059
prepare
6160

6261
# First, generate config for each validator
6362
for ((i = 1; i <= ${NUMS_OF_VALIDATOR}; i++)); do
64-
init_validator "bsc-validator${i}"
65-
generate_validator_conf "bsc-validator${i}"
63+
init_validator "bsc-validator${i}"
6664
done
6765

6866
# Then, use validator configs to generate genesis file
@@ -72,5 +70,5 @@ generate_genesis
7270
init_genesis_data bsc-rpc bsc-rpc
7371

7472
for ((i = 1; i <= ${NUMS_OF_VALIDATOR}; i++)); do
75-
init_genesis_data validator "bsc-validator${i}"
73+
init_genesis_data validator "bsc-validator${i}"
7674
done

e2e/chains/bsc/scripts/bsc-rpc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ done
1414

1515
ETHSTATS=""
1616
geth --config ${DATA_DIR}/config.toml --datadir ${DATA_DIR} --netrestrict ${CLUSTER_CIDR} \
17-
--verbosity ${VERBOSE} --nousb ${ETHSTATS} \
17+
--state.scheme=hash --db.engine=leveldb --verbosity ${VERBOSE} --nousb ${ETHSTATS} \
1818
--unlock ${unlock_sequences} --password /dev/null --ipcpath /gethipc

0 commit comments

Comments
 (0)