94
94
MinStakeAmount * big.Int
95
95
BootstrapCandidates []genesis.BootstrapCandidate
96
96
PersistStakingPatchBlock uint64
97
+ FixAliasForNonStopHeight uint64
97
98
EndorsementWithdrawWaitingBlocks uint64
98
99
MigrateContractAddress string
99
100
}
@@ -167,6 +168,7 @@ func NewProtocol(
167
168
MinStakeAmount : minStakeAmount ,
168
169
BootstrapCandidates : cfg .Staking .BootstrapCandidates ,
169
170
PersistStakingPatchBlock : cfg .PersistStakingPatchBlock ,
171
+ FixAliasForNonStopHeight : cfg .FixAliasForNonStopHeight ,
170
172
EndorsementWithdrawWaitingBlocks : cfg .Staking .EndorsementWithdrawWaitingBlocks ,
171
173
MigrateContractAddress : migrateContractAddress ,
172
174
},
@@ -277,10 +279,12 @@ func (p *Protocol) CreateGenesisStates(
277
279
278
280
// CreatePreStates updates state manager
279
281
func (p * Protocol ) CreatePreStates (ctx context.Context , sm protocol.StateManager ) error {
280
- g := genesis .MustExtractGenesisContext (ctx )
281
- blkCtx := protocol .MustGetBlockCtx (ctx )
282
- featureCtx := protocol .MustGetFeatureCtx (ctx )
283
- featureWithHeightCtx := protocol .MustGetFeatureWithHeightCtx (ctx )
282
+ var (
283
+ g = genesis .MustExtractGenesisContext (ctx )
284
+ blkCtx = protocol .MustGetBlockCtx (ctx )
285
+ featureCtx = protocol .MustGetFeatureCtx (ctx )
286
+ featureWithHeightCtx = protocol .MustGetFeatureWithHeightCtx (ctx )
287
+ )
284
288
if blkCtx .BlockHeight == g .GreenlandBlockHeight {
285
289
csr , err := ConstructBaseView (sm )
286
290
if err != nil {
@@ -290,7 +294,17 @@ func (p *Protocol) CreatePreStates(ctx context.Context, sm protocol.StateManager
290
294
return err
291
295
}
292
296
}
293
-
297
+ if blkCtx .BlockHeight == p .config .FixAliasForNonStopHeight {
298
+ csm , err := NewCandidateStateManager (sm , featureWithHeightCtx .ReadStateFromDB (blkCtx .BlockHeight ))
299
+ if err != nil {
300
+ return err
301
+ }
302
+ base := csm .DirtyView ().candCenter .base
303
+ owners := base .all ()
304
+ if err := base .loadNameOperatorMapOwnerList (owners , owners , nil ); err != nil {
305
+ return err
306
+ }
307
+ }
294
308
if p .voteReviser .NeedRevise (blkCtx .BlockHeight ) {
295
309
csm , err := NewCandidateStateManager (sm , featureWithHeightCtx .ReadStateFromDB (blkCtx .BlockHeight ))
296
310
if err != nil {
0 commit comments