chore: add logs, fix EpochBlocks

This commit is contained in:
MiniFrenchBread 2024-08-10 10:14:18 +08:00
parent 645729fa89
commit 8e433c1557
2 changed files with 4 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package keeper
import (
"bytes"
"fmt"
"math/big"
"sort"
@ -33,6 +34,7 @@ func (k Keeper) generateOneEpoch(ctx sdk.Context) bool {
}
expectedEpoch = epochNumber + 1
// new epoch
k.Logger(ctx).Info(fmt.Sprintf("[BeginBlock] generating epoch %v", expectedEpoch))
registrations := []Ballot{}
k.IterateRegistrations(ctx, expectedEpoch, func(account string, signature []byte) (stop bool) {
registrations = append(registrations, Ballot{
@ -108,6 +110,7 @@ func (k Keeper) generateOneEpoch(ctx sdk.Context) bool {
// save to store
k.SetEpochQuorums(ctx, expectedEpoch, quorums)
k.SetEpochNumber(ctx, expectedEpoch)
k.Logger(ctx).Info(fmt.Sprintf("[BeginBlock] epoch %v generated, with %v quorums", expectedEpoch, len(quorums.Quorums)))
return true
}

View File

@ -18,7 +18,7 @@ func DefaultGenesisState() *GenesisState {
TokensPerVote: 10,
MaxVotesPerSigner: 1024,
MaxQuorums: 10,
EpochBlocks: 2,
EpochBlocks: 5760,
EncodedSlices: 3072,
}, 0, make([]*Signer, 0), []*Quorums{{
Quorums: make([]*Quorum, 0),