From bef04dcfdd1264780967994dcc801fc43bc18d96 Mon Sep 17 00:00:00 2001 From: MadelineMurray <43356962+MadelineMurray@users.noreply.github.com> Date: Fri, 17 Nov 2023 08:09:18 +1000 Subject: [PATCH] Added option to skip empty blocks (#1444) * Added option to skip empty blocks Signed-off-by: madelinemurray * Apply suggestions from code review Co-authored-by: Sally MacFarlane Signed-off-by: Alexandra Tran Carrillo <12214231+alexandratran@users.noreply.github.com> * Update docs/private-networks/how-to/configure/consensus/clique.md Signed-off-by: Alexandra Tran Carrillo <12214231+alexandratran@users.noreply.github.com> --------- Signed-off-by: madelinemurray Signed-off-by: Alexandra Tran Carrillo <12214231+alexandratran@users.noreply.github.com> Co-authored-by: Alexandra Tran Carrillo <12214231+alexandratran@users.noreply.github.com> Co-authored-by: Sally MacFarlane --- .../how-to/configure/consensus/clique.md | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/docs/private-networks/how-to/configure/consensus/clique.md b/docs/private-networks/how-to/configure/consensus/clique.md index 6bf2aecf81f..64bd8b00c35 100644 --- a/docs/private-networks/how-to/configure/consensus/clique.md +++ b/docs/private-networks/how-to/configure/consensus/clique.md @@ -56,8 +56,31 @@ The properties specific to Clique are: - `blockperiodseconds` - The block time, in seconds. - `epochlength` - The number of blocks after which to reset all votes. +- `createemptyblocks` - Set to false to [skip creating empty blocks](#skip-empty-blocks). - `extraData` - [Extra data](#extra-data) including the initial signers. +### Skip empty blocks + +By default, Clique creates empty blocks. For large private networks using Clique, skipping empty blocks can reduce the storage needed. + +To skip creating empty blocks, set `createemptyblocks` to `false` in the genesis file: + +```bash +{ + "config": { + "londonBlock": 0, + "clique": { + "blockperiodseconds": 10, + "epochlength": 30000, + "createemptyblocks": false + } + }, +... +} +``` + +All validators must have the same value for `createemptyblocks`. + ### Extra data The `extraData` property consists of: @@ -152,7 +175,3 @@ However, when the out-of-turn delay is shorter than the block propagation delay, We recommend using a more updated consensus protocol such as [IBFT 2.0](ibft.md) or [QBFT](qbft.md). ::: - - - -\*[vanity data]: Signers can include anything they like as vanity data.