mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-24 23:35:19 +00:00
chore: add logs, fix EpochBlocks
This commit is contained in:
parent
645729fa89
commit
8e433c1557
@ -2,6 +2,7 @@ package keeper
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"fmt"
|
||||||
"math/big"
|
"math/big"
|
||||||
"sort"
|
"sort"
|
||||||
|
|
||||||
@ -33,6 +34,7 @@ func (k Keeper) generateOneEpoch(ctx sdk.Context) bool {
|
|||||||
}
|
}
|
||||||
expectedEpoch = epochNumber + 1
|
expectedEpoch = epochNumber + 1
|
||||||
// new epoch
|
// new epoch
|
||||||
|
k.Logger(ctx).Info(fmt.Sprintf("[BeginBlock] generating epoch %v", expectedEpoch))
|
||||||
registrations := []Ballot{}
|
registrations := []Ballot{}
|
||||||
k.IterateRegistrations(ctx, expectedEpoch, func(account string, signature []byte) (stop bool) {
|
k.IterateRegistrations(ctx, expectedEpoch, func(account string, signature []byte) (stop bool) {
|
||||||
registrations = append(registrations, Ballot{
|
registrations = append(registrations, Ballot{
|
||||||
@ -108,6 +110,7 @@ func (k Keeper) generateOneEpoch(ctx sdk.Context) bool {
|
|||||||
// save to store
|
// save to store
|
||||||
k.SetEpochQuorums(ctx, expectedEpoch, quorums)
|
k.SetEpochQuorums(ctx, expectedEpoch, quorums)
|
||||||
k.SetEpochNumber(ctx, expectedEpoch)
|
k.SetEpochNumber(ctx, expectedEpoch)
|
||||||
|
k.Logger(ctx).Info(fmt.Sprintf("[BeginBlock] epoch %v generated, with %v quorums", expectedEpoch, len(quorums.Quorums)))
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ func DefaultGenesisState() *GenesisState {
|
|||||||
TokensPerVote: 10,
|
TokensPerVote: 10,
|
||||||
MaxVotesPerSigner: 1024,
|
MaxVotesPerSigner: 1024,
|
||||||
MaxQuorums: 10,
|
MaxQuorums: 10,
|
||||||
EpochBlocks: 2,
|
EpochBlocks: 5760,
|
||||||
EncodedSlices: 3072,
|
EncodedSlices: 3072,
|
||||||
}, 0, make([]*Signer, 0), []*Quorums{{
|
}, 0, make([]*Signer, 0), []*Quorums{{
|
||||||
Quorums: make([]*Quorum, 0),
|
Quorums: make([]*Quorum, 0),
|
||||||
|
Loading…
Reference in New Issue
Block a user