mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 04:47:18 +00:00
parent
763d0d6bdc
commit
b8036fcb0f
@ -44,7 +44,7 @@ var defaultConfig = &Config{
|
||||
}
|
||||
|
||||
var demoConfig = &Config{
|
||||
GenesisTime: time.Now().Add(-8 * time.Second),
|
||||
GenesisTime: time.Now(),
|
||||
CycleLength: uint64(5),
|
||||
ShardCount: 3,
|
||||
DefaultBalance: new(big.Int).Div(big.NewInt(32), big.NewInt(int64(1e18))),
|
||||
|
@ -181,8 +181,16 @@ func (sim *Simulator) run(delayChan <-chan time.Time, done <-chan struct{}) {
|
||||
powChainRef = []byte{byte(sim.slotNum)}
|
||||
}
|
||||
|
||||
var blockSlot uint64
|
||||
if sim.chainService.CurrentBeaconSlot() == 0 {
|
||||
// cannot process a genesis block, so we start from 1
|
||||
blockSlot = 1
|
||||
} else {
|
||||
blockSlot = sim.chainService.CurrentBeaconSlot()
|
||||
}
|
||||
|
||||
block := types.NewBlock(&pb.BeaconBlock{
|
||||
SlotNumber: sim.chainService.CurrentBeaconSlot(),
|
||||
SlotNumber: blockSlot,
|
||||
Timestamp: ptypes.TimestampNow(),
|
||||
PowChainRef: powChainRef,
|
||||
ActiveStateHash: activeStateHash[:],
|
||||
|
@ -210,7 +210,10 @@ func (c *CrystallizedState) Validators() []*pb.ValidatorRecord {
|
||||
// IsCycleTransition checks if a new cycle has been reached. At that point,
|
||||
// a new crystallized state and active state transition will occur.
|
||||
func (c *CrystallizedState) IsCycleTransition(slotNumber uint64) bool {
|
||||
return slotNumber >= c.LastStateRecalc()+params.GetConfig().CycleLength
|
||||
if c.LastStateRecalc() == 0 && slotNumber == params.GetConfig().CycleLength-1 {
|
||||
return true
|
||||
}
|
||||
return slotNumber >= c.LastStateRecalc()+params.GetConfig().CycleLength-1
|
||||
}
|
||||
|
||||
// isDynastyTransition checks if a dynasty transition can be processed. At that point,
|
||||
|
Loading…
Reference in New Issue
Block a user