Merge pull request #4595 from GFZRZK/GFZRZK/bugfix/fix_workerkey_error_in_wdpost_setsender
worker key should change when set sender found key not equal with the value on chain
This commit is contained in:
commit
1afd3a41cb
@ -759,6 +759,18 @@ func (s *WindowPoStScheduler) setSender(ctx context.Context, msg *types.Message,
|
|||||||
msg.From = s.worker
|
msg.From = s.worker
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
worker, err := s.api.StateAccountKey(ctx, mi.Worker, types.EmptyTSK)
|
||||||
|
if err != nil {
|
||||||
|
log.Errorw("error getting account key", "error", err)
|
||||||
|
|
||||||
|
msg.From = s.worker
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// worker should keep sync with state on chain, if not, will met error when estimate msg gas.
|
||||||
|
if s.worker != worker {
|
||||||
|
s.worker = worker
|
||||||
|
msg.From = s.worker
|
||||||
|
}
|
||||||
|
|
||||||
gm, err := s.api.GasEstimateMessageGas(ctx, msg, spec, types.EmptyTSK)
|
gm, err := s.api.GasEstimateMessageGas(ctx, msg, spec, types.EmptyTSK)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user