Skip to content

Commit

Permalink
Introducing the Empty Block Period (#171)
Browse files Browse the repository at this point in the history
* Introducing the Empty Block Period

* fix
  • Loading branch information
purplesmoke05 authored Aug 27, 2024
1 parent 1984a51 commit 1379e4e
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 1 deletion.
6 changes: 6 additions & 0 deletions ibet-for-fin-network/validator/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
"policy": 0,
"testQBFTBlock": 77792450
},
"transitions": [
{
"block": 999999999,
"emptyBlockPeriodSeconds": 10
}
],
"isQuorum": true
},
"nonce": "0x0",
Expand Down
6 changes: 6 additions & 0 deletions ibet-network/validator/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
"policy": 0,
"testQBFTBlock": 100000000
},
"transitions": [
{
"block": 999999999,
"emptyBlockPeriodSeconds": 10
}
],
"isQuorum": true
},
"nonce": "0x0",
Expand Down
6 changes: 6 additions & 0 deletions ibet-network/validator/genesis.json_init
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
"policy": 0,
"testQBFTBlock": 100000000
},
"transitions": [
{
"block": 999999999,
"emptyBlockPeriodSeconds": 10
}
],
"isQuorum": true
},
"nonce": "0x0",
Expand Down
8 changes: 8 additions & 0 deletions local-network/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,11 @@ You can migrate an existing network to a Berlin hardfork network with the follow
2. Update the docker-compose file with a non-zero `berlinBlock`.
Set a future block number rather than the current block number.
3. Restart the network.

## Introducing Empty Block Period Seconds
You can introduce empty block period to an existing network with the following steps:

1. Stop the network.
2. Update the docker-compose file with a non-zero `emptyBlockPeriodIntroduceBlock`.
Set a future block number rather than the current block number.
3. Restart the network.
4 changes: 4 additions & 0 deletions local-network/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ services:
- identity='validator-0'
- testQBFTBlock=4
- berlinBlock=4
- emptyBlockPeriodIntroduceBlock=5
- cache=1024
ports:
- '30303:30303'
Expand All @@ -36,6 +37,7 @@ services:
- identity='validator-1'
- testQBFTBlock=4
- berlinBlock=4
- emptyBlockPeriodIntroduceBlock=5
- cache=1024
ports:
- '30304:30303'
Expand All @@ -58,6 +60,7 @@ services:
- identity='validator-2'
- testQBFTBlock=4
- berlinBlock=4
- emptyBlockPeriodIntroduceBlock=5
- cache=1024
ports:
- '30305:30303'
Expand All @@ -80,6 +83,7 @@ services:
- identity='validator-3'
- testQBFTBlock=4
- berlinBlock=4
- emptyBlockPeriodIntroduceBlock=5
- cache=1024
ports:
- '30306:30303'
Expand Down
2 changes: 1 addition & 1 deletion local-network/validator/run.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/ash
mkdir -p /eth/geth

echo '{"config":{"chainId":2017,"homesteadBlock":1,"eip150Block":2,"eip150Hash":"0x0000000000000000000000000000000000000000000000000000000000000000","eip155Block":3,"eip158Block":3,"byzantiumBlock":3,"constantinopleBlock":'${berlinBlock}',"petersburgBlock":'${berlinBlock}',"istanbulBlock":'${berlinBlock}',"berlinBlock":'${berlinBlock}',"istanbul":{"epoch":30000,"policy":0,"testQBFTBlock":'${testQBFTBlock}'}},"nonce":"0x0","timestamp":"0x5ad86387","extraData":"0x0000000000000000000000000000000000000000000000000000000000000000f89af8549447a847fbdf801154253593851ac9a2e7753235349403ee8c85944b16dfa517cb0ddefe123c7341a5349435d56a7515e824be4122f033d60063d035573a0c94c25d04978fd86ee604feb88f3c635d555eb6d42db8410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0","gasLimit":"0x2faf0800","difficulty":"0x1","mixHash":"0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365","coinbase":"0x0000000000000000000000000000000000000000","alloc":{"03ee8c85944b16dfa517cb0ddefe123c7341a534":{"balance":"0x446c3b15f9926687d2c40534fdb564000000000000"},"35d56a7515e824be4122f033d60063d035573a0c":{"balance":"0x446c3b15f9926687d2c40534fdb564000000000000"},"47a847fbdf801154253593851ac9a2e775323534":{"balance":"0x446c3b15f9926687d2c40534fdb564000000000000"},"c25d04978fd86ee604feb88f3c635d555eb6d42d":{"balance":"0x446c3b15f9926687d2c40534fdb564000000000000"}},"number":"0x0","gasUsed":"0x0","parentHash":"0x0000000000000000000000000000000000000000000000000000000000000000"}' > /eth/genesis.json
echo '{"config":{"chainId":2017,"homesteadBlock":1,"eip150Block":2,"eip150Hash":"0x0000000000000000000000000000000000000000000000000000000000000000","eip155Block":3,"eip158Block":3,"byzantiumBlock":3,"constantinopleBlock":'${berlinBlock}',"petersburgBlock":'${berlinBlock}',"istanbulBlock":'${berlinBlock}',"berlinBlock":'${berlinBlock}',"istanbul":{"epoch":30000,"policy":0,"testQBFTBlock":'${testQBFTBlock}'},"transitions":[{"block":'${emptyBlockPeriodIntroduceBlock}',"emptyBlockPeriodSeconds":10}]},"nonce":"0x0","timestamp":"0x5ad86387","extraData":"0x0000000000000000000000000000000000000000000000000000000000000000f89af8549447a847fbdf801154253593851ac9a2e7753235349403ee8c85944b16dfa517cb0ddefe123c7341a5349435d56a7515e824be4122f033d60063d035573a0c94c25d04978fd86ee604feb88f3c635d555eb6d42db8410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0","gasLimit":"0x2faf0800","difficulty":"0x1","mixHash":"0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365","coinbase":"0x0000000000000000000000000000000000000000","alloc":{"03ee8c85944b16dfa517cb0ddefe123c7341a534":{"balance":"0x446c3b15f9926687d2c40534fdb564000000000000"},"35d56a7515e824be4122f033d60063d035573a0c":{"balance":"0x446c3b15f9926687d2c40534fdb564000000000000"},"47a847fbdf801154253593851ac9a2e775323534":{"balance":"0x446c3b15f9926687d2c40534fdb564000000000000"},"c25d04978fd86ee604feb88f3c635d555eb6d42d":{"balance":"0x446c3b15f9926687d2c40534fdb564000000000000"}},"number":"0x0","gasUsed":"0x0","parentHash":"0x0000000000000000000000000000000000000000000000000000000000000000"}' > /eth/genesis.json
echo '["enode://6204d2b6d844adf9dd23f47027b29b1e39b08c70b8ec05f82a8037f1676c058fe80035b42f32c649cc47347889abfe7732139b9f3f243ea91f990d2d72bb87bd@172.16.239.10:30303?discport=0","enode://a573feff0859205b566385aaf85f4c858dfe4ebb07ec862a2d03e117b3e39d8220aaf1d58750440ad844ddcb623f6becc9ba07fc27db4d30cdf689f15a9b1462@172.16.239.11:30303?discport=0","enode://76b750a2a0c92d2411e4793c714a85cf01e527c7a77f70548e7f363feaf8320039cd0f2eb48235c022d39df44ec06c96060f5c25caeec8a1960a356ebd5473a1@172.16.239.12:30303?discport=0","enode://f53fff2c7ed693b627d4389b92b6d94a11b91f167193a5d31320a2b35fb752f79b3aed7dcc61961bc00b397fdf8729eb797a0b28d6c538d51232164432b67f80@172.16.239.13:30303?discport=0"]' > /eth/geth/static-nodes.json
geth --datadir "/eth" init "/eth/genesis.json"

Expand Down
6 changes: 6 additions & 0 deletions test-network/validator/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
"policy": 0,
"testQBFTBlock": 115848165
},
"transitions": [
{
"block": 999999999,
"emptyBlockPeriodSeconds": 10
}
],
"isQuorum": true
},
"nonce": "0x0",
Expand Down
6 changes: 6 additions & 0 deletions test-network/validator/genesis.json_init
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
"policy": 0,
"testQBFTBlock": 115848165
},
"transitions": [
{
"block": 999999999,
"emptyBlockPeriodSeconds": 10
}
],
"isQuorum": true
},
"nonce": "0x0",
Expand Down

0 comments on commit 1379e4e

Please sign in to comment.