Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
2e08b19
support milli timestamp
Mar 5, 2025
1ddc595
tweak tool
Mar 5, 2025
44bf3d4
fix conflict
Mar 17, 2025
01a284f
change epoch length
Mar 17, 2025
87a6c5d
change bootstrap
Mar 17, 2025
9e063d4
Merge branch 'feature/fork_state' into feature/rolentz_msec
Mar 18, 2025
fe2c43e
fix test
Mar 18, 2025
5f84fd1
fix test
Mar 18, 2025
5ecb517
add epoch length
Mar 20, 2025
ed20939
add Lorentz Fork Spec
Mar 20, 2025
c83c2c8
update
Mar 21, 2025
575183f
modify
Mar 21, 2025
65c004b
fix test
Mar 21, 2025
22061b2
add test
Mar 21, 2025
5a52263
change test
Mar 21, 2025
b75adf5
change
Mar 21, 2025
2b2a875
remove how to change epoch length
Mar 22, 2025
b9e0fac
change ts
Mar 22, 2025
b4dc6be
move env var into init
Mar 22, 2025
8f859c3
change submitting headers
Mar 22, 2025
219ad16
add test
Mar 22, 2025
f3b05b2
add test
Mar 22, 2025
5824ec7
add test
Mar 23, 2025
c9a4f43
change
Mar 23, 2025
bd5b4cf
refactor
Mar 23, 2025
f8e2d54
check strict
Mar 23, 2025
1b8d38e
check strict
Mar 23, 2025
0da2a4b
remove log
Mar 23, 2025
d1ab860
update
Mar 23, 2025
a9bbd78
change log
Mar 23, 2025
b7c1a28
change stack
Mar 24, 2025
38284e6
check
Mar 24, 2025
77bce51
check type
Mar 24, 2025
8188f7f
fix conflict
Mar 26, 2025
c39dccb
fix conflict
Mar 26, 2025
e341b90
change sleep time
Mar 26, 2025
f37a183
fix ut
Mar 26, 2025
7a54feb
add max_turn_length
Mar 26, 2025
e232ac1
fix testtool
Mar 27, 2025
7a25445
add lorentz ts
Apr 2, 2025
49dcb36
fix comment
Apr 7, 2025
b74c1ca
Merge pull request #57 from datachainlab/feature/lorentz_seemless
yoshidan Apr 7, 2025
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
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ jobs:
run: |
make chain
make contracts
sleep 20
# epoch is 200, 400, 500, 1000
# must wait for 400 block (1.5sec * 400)
sleep 600
make relayer
make test
- name: integration-test
Expand Down
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
![CI](https://github.com/datachainlab/ibc-parlia-relay/workflows/CI/badge.svg?branch=main)

## Supported Versions
- [yui-relayer v0.5.3](https://github.com/hyperledger-labs/yui-relayer/releases/tag/v0.5.3)
- [ethereum-ibc-relay-chain v0.3.4](https://github.com/datachainlab/ethereum-ibc-relay-chain/releases/tag/v0.3.4)
- [yui-relayer v0.5.11](https://github.com/hyperledger-labs/yui-relayer/releases/tag/v0.5.11)
- [ethereum-ibc-relay-chain v0.3.16](https://github.com/datachainlab/ethereum-ibc-relay-chain/releases/tag/v0.3.6)

## Setup Relayer

Expand All @@ -29,14 +29,6 @@ func main() {
}
```

## Change blocks per epoch

* You can change blocks per epoch by build arguments.
* This is only for local net.
```
go build -tags dev -ldflags="-X github.com/datachainlab/ibc-parlia-relay/module/constant.blocksPerEpoch=20" -o testrly .
```

## Development

Generate proto buf with protobuf definition of [parlia-elc](https://github.com/datachainlab/parlia-elc).
Expand All @@ -48,3 +40,12 @@ cd ibc-parlia-relay
make proto-import
make proto-gen
```

## About ForkSpec

1. Set HF height as soon as possible
As soon as the HF height is determined, please modify the timestamp in the ForkSpec to the height as soon as possible.
HF height is calculated from timestamp, but the further away from the HF, the longer it takes to calculate.

2. Limitation of the CreateClient
When the latest HF height is not set it is impossible to create client if the latest finalize header is after latest HF timestamp
3 changes: 1 addition & 2 deletions e2e/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ contracts:
.PHONY:relayer
relayer:
rm -rf .testrly
go build -tags dev -ldflags="-X github.com/datachainlab/ibc-parlia-relay/module/constant.blocksPerEpoch=20" -o testrly .
# go build -o testrly .
go build -o testrly .
./testrly config init --home .testrly
./testrly chains add-dir config/demo/ --home .testrly
./testrly paths add ibc0 ibc1 ibc01 --file=config/path.json --home .testrly
Expand Down
4 changes: 2 additions & 2 deletions e2e/chains/bsc/Dockerfile.bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ FROM ghcr.io/foundry-rs/foundry:nightly-462b2ac6c038dc24b8f38b0c59b664d0740604c2
RUN apk add --d --no-cache ca-certificates npm nodejs bash alpine-sdk expect jq curl bash python3
RUN curl -sSL https://install.python-poetry.org | python3 -

RUN git clone https://github.com/bnb-chain/bsc-genesis-contract -b v1.2.4 /root/genesis \
&& cd /root/genesis && npm ci
RUN git clone https://github.com/bnb-chain/bsc-genesis-contract -b develop /root/genesis \
&& cd /root/genesis && git checkout 44ebc6c17a00bd24db3240141a78091528dcebbb && npm ci

RUN cd /root/genesis && /root/.local/bin/poetry install
RUN cd /root/genesis && forge install --no-git --no-commit foundry-rs/forge-std@v1.7.3
Expand Down
2 changes: 1 addition & 1 deletion e2e/chains/bsc/docker-compose.bsc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ services:
dockerfile: Dockerfile.bsc
args:
GIT_SOURCE: https://github.com/bnb-chain/bsc
GIT_CHECKOUT_BRANCH: v1.5.5
GIT_CHECKOUT_BRANCH: v1.5.9
image: bsc-geth:docker-local
2 changes: 0 additions & 2 deletions e2e/chains/bsc/docker-compose.simple.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ services:
dockerfile: Dockerfile.bootstrap
env_file: .env
environment:
BLOCKS_PER_EPOCH: 20
INIT_HOLDER_BALANCE: "500000000000000000000"
NUMS_OF_VALIDATOR: 5
INIT_NUM_OF_CABINETS: 4
Expand All @@ -42,7 +41,6 @@ services:
dockerfile: Dockerfile.bootstrap
env_file: .env2
environment:
BLOCKS_PER_EPOCH: 20
INIT_HOLDER_BALANCE: "500000000000000000000"
NUMS_OF_VALIDATOR: 3
INIT_NUM_OF_CABINETS: 2
Expand Down
436 changes: 52 additions & 384 deletions e2e/chains/bsc/genesis/contracts/BSCValidatorSet.sol

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions e2e/chains/bsc/genesis/genesis-template.template
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"bohrTime": 0,
"pascalTime": 0,
"pragueTime": 0,
"lorentzTime": 0,
"blobSchedule": {
"cancun": {
"target": 3,
Expand All @@ -48,8 +49,6 @@
}
},
"parlia": {
"period": 3,
"epoch": {{BLOCKS_PER_EPOCH}}
}
},
"nonce": "0x0",
Expand Down
2 changes: 1 addition & 1 deletion e2e/chains/bsc/genesis/scripts/init_holders.template
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const web3 = require("web3")

const addresses = "{{INIT_HOLDER_ADDRESSES}}"
const balance = web3.utils.toBN("{{INIT_HOLDER_BALANCE}}").toString("hex")
const balance = BigInt("{{INIT_HOLDER_BALANCE}}").toString(16)
const init_holders = addresses.split(",").map(address => ({ address, balance }));

exports = module.exports = init_holders
5 changes: 2 additions & 3 deletions e2e/chains/bsc/scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ function init_validator() {
function generate_genesis() {
INIT_HOLDER_ADDRESSES=$(ls ${workspace}/init-holders | tr '\n' ',')
INIT_HOLDER_ADDRESSES=${INIT_HOLDER_ADDRESSES/%,/}
echo "blocks per epoch = ${BLOCKS_PER_EPOCH}"

echo "replace genesis-template.template"
sed "s/{{BLOCKS_PER_EPOCH}}/${BLOCKS_PER_EPOCH}/g" genesis-template.template >genesis-template.json
cp genesis-template.template genesis-template.json

echo "replace init_holders.template"
sed "s/{{INIT_HOLDER_ADDRESSES}}/${INIT_HOLDER_ADDRESSES}/g" scripts/init_holders.template | sed "s/{{INIT_HOLDER_BALANCE}}/${INIT_HOLDER_BALANCE}/g" >scripts/init_holders.js
Expand All @@ -49,7 +48,7 @@ function generate_genesis() {

echo "replace generate.py"
sed "s/dev_chain_id: int = 714/dev_chain_id: int = ${BSC_CHAIN_ID}/g" scripts/generate.py > scripts/generate.py.out
sed "s/epoch: str = \"200\"/epoch: str = \"${BLOCKS_PER_EPOCH}\"/g" scripts/generate.py.out > scripts/generate.py
cp scripts/generate.py.out scripts/generate.py

echo "start generate validators"
node scripts/generate-validator.js
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require (
github.com/datachainlab/ethereum-ibc-relay-chain v0.3.17
github.com/datachainlab/ibc-hd-signer v0.1.2
github.com/ethereum/go-ethereum v1.15.0
github.com/holiman/uint256 v1.3.2
github.com/hyperledger-labs/yui-relayer v0.5.11
github.com/spf13/cobra v1.8.1
github.com/stretchr/testify v1.10.0
Expand Down Expand Up @@ -132,7 +133,6 @@ require (
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/hdevalence/ed25519consensus v0.1.0 // indirect
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
github.com/holiman/uint256 v1.3.2 // indirect
github.com/huandu/skiplist v1.2.0 // indirect
github.com/iancoleman/strcase v0.3.0 // indirect
github.com/improbable-eng/grpc-web v0.15.0 // indirect
Expand Down
24 changes: 0 additions & 24 deletions module/constant/development.go

This file was deleted.

5 changes: 0 additions & 5 deletions module/constant/production.go

This file was deleted.

9 changes: 0 additions & 9 deletions module/facade.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,6 @@ import (
)

// Facade for tool modules

func GetPreviousEpoch(v uint64) uint64 {
return getPreviousEpoch(v)
}

func GetCurrentEpoch(v uint64) uint64 {
return getCurrentEpoch(v)
}

func QueryFinalizedHeader(ctx context.Context, fn getHeaderFn, height uint64, limitHeight uint64) ([]*ETHHeader, error) {
return queryFinalizedHeader(ctx, fn, height, limitHeight)
}
Expand Down
Loading
Loading