diff --git a/cmd/geth/config.go b/cmd/geth/config.go index a3b69113f..ca7e7810a 100644 --- a/cmd/geth/config.go +++ b/cmd/geth/config.go @@ -203,6 +203,9 @@ func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) { if ctx.IsSet(utils.OverrideDefaultExtraReserveForBlobRequests.Name) { params.DefaultExtraReserveForBlobRequests = ctx.Uint64(utils.OverrideDefaultExtraReserveForBlobRequests.Name) } + if ctx.IsSet(utils.OverrideBreatheBlockInterval.Name) { + params.BreatheBlockInterval = ctx.Uint64(utils.OverrideBreatheBlockInterval.Name) + } backend, eth := utils.RegisterEthService(stack, &cfg.Eth) diff --git a/cmd/geth/main.go b/cmd/geth/main.go index f2c7a9ab4..d4be86c01 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -77,6 +77,7 @@ var ( utils.OverrideFullImmutabilityThreshold, utils.OverrideMinBlocksForBlobRequests, utils.OverrideDefaultExtraReserveForBlobRequests, + utils.OverrideBreatheBlockInterval, utils.EnablePersonal, utils.TxPoolLocalsFlag, utils.TxPoolNoLocalsFlag, diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index c7a01e5e2..c2653dd66 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -333,6 +333,12 @@ var ( Value: params.DefaultExtraReserveForBlobRequests, Category: flags.EthCategory, } + OverrideBreatheBlockInterval = &cli.Uint64Flag{ + Name: "override.breatheblockinterval", + Usage: "It changes the interval between breathe blocks, only for testing purpose", + Value: params.BreatheBlockInterval, + Category: flags.EthCategory, + } SyncModeFlag = &flags.TextMarshalerFlag{ Name: "syncmode", Usage: `Blockchain sync mode ("snap" or "full")`, diff --git a/consensus/parlia/feynmanfork.go b/consensus/parlia/feynmanfork.go index 32f9951d8..88d2ae17c 100644 --- a/consensus/parlia/feynmanfork.go +++ b/consensus/parlia/feynmanfork.go @@ -15,14 +15,13 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/internal/ethapi" "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rpc" ) -const SecondsPerDay uint64 = 86400 - // the params should be two blocks' time(timestamp) func sameDayInUTC(first, second uint64) bool { - return first/SecondsPerDay == second/SecondsPerDay + return first/params.BreatheBlockInterval == second/params.BreatheBlockInterval } func isBreatheBlock(lastBlockTime, blockTime uint64) bool { diff --git a/params/protocol_params.go b/params/protocol_params.go index 0ab8b6a39..c750405e0 100644 --- a/params/protocol_params.go +++ b/params/protocol_params.go @@ -189,6 +189,7 @@ const ( var ( MinBlocksForBlobRequests uint64 = 524288 // it keeps blob data available for ~18.2 days in local, ref: https://github.com/bnb-chain/BEPs/blob/master/BEPs/BEP-336.md#51-parameters. DefaultExtraReserveForBlobRequests uint64 = 1 * (24 * 3600) / 3 // it adds more time for expired blobs for some request cases, like expiry blob when remote peer is syncing, default 1 day. + BreatheBlockInterval uint64 = 86400 // Controls the interval for updateValidatorSetV2 ) // Gas discount table for BLS12-381 G1 and G2 multi exponentiation operations