Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion e2e/chains/bsc/Dockerfile.bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -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
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.10
GIT_CHECKOUT_BRANCH: v1.5.13
image: bsc-geth:docker-local
1 change: 1 addition & 0 deletions e2e/chains/bsc/genesis/genesis-template.template
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"pascalTime": 0,
"pragueTime": 0,
"lorentzTime": 0,
"maxwellTime": 0,
"blobSchedule": {
"cancun": {
"target": 3,
Expand Down
2 changes: 2 additions & 0 deletions e2e/chains/bsc/scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
17 changes: 15 additions & 2 deletions module/fork_spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -34,6 +34,7 @@ func init() {
const (
indexPascalHF = 0
indexLorentzHF = 1
indexMaxwellHF = 2
)

func getForkSpecParams() []*ForkSpec {
Expand All @@ -54,6 +55,14 @@ func getForkSpecParams() []*ForkSpec {
GasLimitBoundDivider: 1024,
EnableHeaderMsec: true,
},
// Maxwell HF
{
AdditionalHeaderItemCount: 1,
EpochLength: 1000,
MaxTurnLength: 64,
GasLimitBoundDivider: 1024,
EnableHeaderMsec: true,
},
}
}

Expand All @@ -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
Expand Down