From 684caecbd6cb73f7f1d1ad559ea30f124433838a Mon Sep 17 00:00:00 2001 From: Naohiro Yoshida Date: Tue, 13 May 2025 11:49:09 +0900 Subject: [PATCH 1/5] support maxwell Signed-off-by: Naohiro Yoshida --- e2e/chains/bsc/genesis/genesis-template.template | 1 + module/fork_spec.go | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) 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/module/fork_spec.go b/module/fork_spec.go index 5826581d..6bd46aac 100644 --- a/module/fork_spec.go +++ b/module/fork_spec.go @@ -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,20 @@ 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} + //TODO Maxwell 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 From a2e729f8535d6c7d32732e0a4161922c92265a77 Mon Sep 17 00:00:00 2001 From: Naohiro Yoshida Date: Tue, 20 May 2025 12:18:48 +0900 Subject: [PATCH 2/5] increment for maxwell Signed-off-by: Naohiro Yoshida --- module/fork_spec.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/fork_spec.go b/module/fork_spec.go index 6bd46aac..e809a850 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") From da5df49a6a2fa1e0469bbca40b51a128eb65a239 Mon Sep 17 00:00:00 2001 From: Naohiro Yoshida Date: Wed, 21 May 2025 11:41:55 +0900 Subject: [PATCH 3/5] add maxwell timestamp Signed-off-by: Naohiro Yoshida --- module/fork_spec.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/fork_spec.go b/module/fork_spec.go index e809a850..1dfa114c 100644 --- a/module/fork_spec.go +++ b/module/fork_spec.go @@ -77,7 +77,8 @@ func GetForkParameters(network Network) []*ForkSpec { case Testnet: hardForks[indexPascalHF].HeightOrTimestamp = &ForkSpec_Height{Height: 48576786} hardForks[indexLorentzHF].HeightOrTimestamp = &ForkSpec_Height{Height: 49791365} - //TODO Maxwell + // https://github.com/bnb-chain/bsc/blob/256d8811f441c29cb0812943dc660ac13192829c/params/config.go#L239 + hardForks[indexLorentzHF].HeightOrTimestamp = &ForkSpec_Timestamp{Timestamp: 1748243100 * 1000} return hardForks case Mainnet: hardForks[indexPascalHF].HeightOrTimestamp = &ForkSpec_Height{Height: 47618307} From a6ed1c715fa1f7180e5fac9b1af720aab032a42d Mon Sep 17 00:00:00 2001 From: Naohiro Yoshida Date: Wed, 21 May 2025 17:17:55 +0900 Subject: [PATCH 4/5] use v1.5.13 Signed-off-by: Naohiro Yoshida --- e2e/chains/bsc/docker-compose.bsc.yml | 2 +- module/fork_spec.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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/module/fork_spec.go b/module/fork_spec.go index 1dfa114c..fd84c0ad 100644 --- a/module/fork_spec.go +++ b/module/fork_spec.go @@ -77,7 +77,7 @@ func GetForkParameters(network Network) []*ForkSpec { 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 + // https: //github.com/bnb-chain/bsc/blob/256d8811f441c29cb0812943dc660ac13192829c/params/config.go#L239 hardForks[indexLorentzHF].HeightOrTimestamp = &ForkSpec_Timestamp{Timestamp: 1748243100 * 1000} return hardForks case Mainnet: From 9cd6c5516f9c8625f40c2007d4bedde7b32f76e6 Mon Sep 17 00:00:00 2001 From: Naohiro Yoshida Date: Fri, 23 May 2025 12:23:29 +0900 Subject: [PATCH 5/5] fix Signed-off-by: Naohiro Yoshida --- .github/workflows/ci.yml | 2 +- e2e/chains/bsc/Dockerfile.bootstrap | 2 +- e2e/chains/bsc/scripts/bootstrap.sh | 2 ++ module/fork_spec.go | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) 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/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 fd84c0ad..5089d2bc 100644 --- a/module/fork_spec.go +++ b/module/fork_spec.go @@ -77,8 +77,8 @@ func GetForkParameters(network Network) []*ForkSpec { 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[indexLorentzHF].HeightOrTimestamp = &ForkSpec_Timestamp{Timestamp: 1748243100 * 1000} + // 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}