Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Commit

Permalink
Comments fix
Browse files Browse the repository at this point in the history
  • Loading branch information
goran-ethernal committed Sep 5, 2023
1 parent 54e2d42 commit 7a8b5e0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion command/genesis/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ func setFlags(cmd *cobra.Command) {
&params.checkpointInterval,
checkpointIntervalFlag,
defaultCheckpointInterval,
"number of blocks after which a new checkpoint is submitted",
"checkpoint submission interval in blocks",
)

cmd.Flags().Uint64Var(
Expand Down
6 changes: 4 additions & 2 deletions command/genesis/polybft_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ const (

ecdsaAddressLength = 40
blsKeyLength = 256

proposalQuorumMax = uint64(100)
)

var (
Expand Down Expand Up @@ -168,9 +170,9 @@ func (p *genesisParams) generatePolyBftChainConfig(o command.OutputFormatter) er
}

proposalQuorum := p.proposalQuorum
if proposalQuorum > 100 {
if proposalQuorum > proposalQuorumMax {
// proposal can be from 0 to 100, so we sanitize the value
proposalQuorum = 100
proposalQuorum = proposalQuorumMax
}

polyBftConfig := &polybft.PolyBFTConfig{
Expand Down
13 changes: 8 additions & 5 deletions consensus/polybft/governance_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,27 @@ import (
"math/big"
"time"

"github.com/hashicorp/go-hclog"
"github.com/umbracle/ethgo"
"github.com/umbracle/ethgo/abi"

"github.com/0xPolygon/polygon-edge/chain"
"github.com/0xPolygon/polygon-edge/consensus/polybft/contractsapi"
"github.com/0xPolygon/polygon-edge/crypto"
"github.com/0xPolygon/polygon-edge/forkmanager"
"github.com/0xPolygon/polygon-edge/helper/common"
"github.com/0xPolygon/polygon-edge/types"
"github.com/hashicorp/go-hclog"
"github.com/umbracle/ethgo"
"github.com/umbracle/ethgo/abi"
)

const (
oldRewardLookbackSize = uint64(2) // number of blocks to calculate commit epoch info from the previous epoch
newRewardLookbackSize = uint64(1)
)

var errUnknownGovernanceEvent = errors.New("unknown event from governance")
var (
errUnknownGovernanceEvent = errors.New("unknown event from governance")
stringABIType = abi.MustNewType("tuple(string)")
)

// isRewardDistributionBlock indicates if reward distribution transaction
// should happen in given block
Expand Down Expand Up @@ -106,7 +110,6 @@ func newGovernanceManager(genesisConfig *PolyBFTConfig,

// cache all fork name hashes that we have in code
allForkNameHashes := map[types.Hash]string{}
stringABIType := abi.MustNewType("tuple(string)")

for name := range *chain.AllForksEnabled {
encoded, err := stringABIType.Encode([]interface{}{name})
Expand Down

0 comments on commit 7a8b5e0

Please sign in to comment.