diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 33a54f14..3425e7b1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,7 +55,7 @@ jobs: make chain make contracts # epoch is 200, 400, 500, 1000 - # must wait for 400 block (1.5sec * 400) + # Since we want the previous epoch to be before HF we wait for 800 block (0.75sec * 800) sleep 600 make relayer make test diff --git a/e2e/chains/bsc/Dockerfile.bootstrap b/e2e/chains/bsc/Dockerfile.bootstrap index bb174fa8..1c0e31d1 100644 --- a/e2e/chains/bsc/Dockerfile.bootstrap +++ b/e2e/chains/bsc/Dockerfile.bootstrap @@ -4,7 +4,7 @@ RUN apk add --d --no-cache npm nodejs bash alpine-sdk expect jq curl bash python RUN curl -sSL https://install.python-poetry.org | python3 - RUN git clone https://github.com/bnb-chain/bsc-genesis-contract -b develop /root/genesis \ - && cd /root/genesis && git checkout 44ebc6c17a00bd24db3240141a78091528dcebbb && npm ci + && cd /root/genesis && git checkout bf3ac733f8aaf93ed88ca0ad2dcddd051166e4e1 && 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 diff --git a/e2e/chains/bsc/docker-compose.bsc.yml b/e2e/chains/bsc/docker-compose.bsc.yml index 376d06dc..b7717c57 100644 --- a/e2e/chains/bsc/docker-compose.bsc.yml +++ b/e2e/chains/bsc/docker-compose.bsc.yml @@ -5,5 +5,5 @@ services: dockerfile: Dockerfile.bsc args: GIT_SOURCE: https://github.com/bnb-chain/bsc - GIT_CHECKOUT_BRANCH: v1.5.10 + GIT_CHECKOUT_BRANCH: v1.5.13 image: bsc-geth:docker-local diff --git a/e2e/chains/bsc/genesis/genesis-template.template b/e2e/chains/bsc/genesis/genesis-template.template index 5a62f795..794f0137 100644 --- a/e2e/chains/bsc/genesis/genesis-template.template +++ b/e2e/chains/bsc/genesis/genesis-template.template @@ -36,6 +36,7 @@ "pascalTime": 0, "pragueTime": 0, "lorentzTime": 0, + "maxwellTime": 0, "blobSchedule": { "cancun": { "target": 3, diff --git a/e2e/chains/bsc/scripts/bootstrap.sh b/e2e/chains/bsc/scripts/bootstrap.sh index c1e6d985..78ad99af 100755 --- a/e2e/chains/bsc/scripts/bootstrap.sh +++ b/e2e/chains/bsc/scripts/bootstrap.sh @@ -56,6 +56,8 @@ function generate_genesis() { echo "start generate process" /root/.local/bin/poetry run python3 scripts/generate.py dev + echo "move generate-dev.json to genesis.json" + mv genesis-dev.json genesis.json } function init_genesis_data() { diff --git a/module/fork_spec.go b/module/fork_spec.go index 5826581d..5089d2bc 100644 --- a/module/fork_spec.go +++ b/module/fork_spec.go @@ -18,7 +18,7 @@ const ( Mainnet Network = "mainnet" ) -var localLatestHF isForkSpec_HeightOrTimestamp = &ForkSpec_Height{Height: 1} +var localLatestHF isForkSpec_HeightOrTimestamp = &ForkSpec_Height{Height: 2} func init() { localLatestHFTimestamp := os.Getenv("LOCAL_LATEST_HF_TIMESTAMP") @@ -34,6 +34,7 @@ func init() { const ( indexPascalHF = 0 indexLorentzHF = 1 + indexMaxwellHF = 2 ) func getForkSpecParams() []*ForkSpec { @@ -54,6 +55,14 @@ func getForkSpecParams() []*ForkSpec { GasLimitBoundDivider: 1024, EnableHeaderMsec: true, }, + // Maxwell HF + { + AdditionalHeaderItemCount: 1, + EpochLength: 1000, + MaxTurnLength: 64, + GasLimitBoundDivider: 1024, + EnableHeaderMsec: true, + }, } } @@ -62,17 +71,21 @@ func GetForkParameters(network Network) []*ForkSpec { switch network { case Localnet: hardForks[indexPascalHF].HeightOrTimestamp = &ForkSpec_Height{Height: 0} - hardForks[indexLorentzHF].HeightOrTimestamp = localLatestHF + hardForks[indexLorentzHF].HeightOrTimestamp = &ForkSpec_Height{Height: 1} + hardForks[indexMaxwellHF].HeightOrTimestamp = localLatestHF return hardForks case Testnet: hardForks[indexPascalHF].HeightOrTimestamp = &ForkSpec_Height{Height: 48576786} hardForks[indexLorentzHF].HeightOrTimestamp = &ForkSpec_Height{Height: 49791365} + // https://github.com/bnb-chain/bsc/blob/256d8811f441c29cb0812943dc660ac13192829c/params/config.go#L239 + hardForks[indexMaxwellHF].HeightOrTimestamp = &ForkSpec_Timestamp{Timestamp: 1748243100 * 1000} return hardForks case Mainnet: hardForks[indexPascalHF].HeightOrTimestamp = &ForkSpec_Height{Height: 47618307} // https://bscscan.com/block/48773576 // https://github.com/bnb-chain/bsc/releases/tag/v1.5.10 hardForks[indexLorentzHF].HeightOrTimestamp = &ForkSpec_Height{Height: 48773576} + //TODO Maxwell return hardForks } return nil