don't allow slashing with old blocks
This commit is contained in:
parent
611dd77442
commit
055b215bc7
@ -5,7 +5,7 @@ import "fmt"
|
|||||||
var CurrentCommit string
|
var CurrentCommit string
|
||||||
|
|
||||||
// BuildVersion is the local build version, set by build system
|
// BuildVersion is the local build version, set by build system
|
||||||
const BuildVersion = "0.2.2"
|
const BuildVersion = "0.2.3"
|
||||||
|
|
||||||
var UserVersion = BuildVersion + CurrentCommit
|
var UserVersion = BuildVersion + CurrentCommit
|
||||||
|
|
||||||
|
@ -140,6 +140,14 @@ func (spa StoragePowerActor) ArbitrateConsensusFault(act *types.Actor, vmctx typ
|
|||||||
|
|
||||||
// FORK
|
// FORK
|
||||||
if vmctx.BlockHeight() > build.ForkBlizzardHeight {
|
if vmctx.BlockHeight() > build.ForkBlizzardHeight {
|
||||||
|
if params.Block1.Height <= build.ForkBlizzardHeight {
|
||||||
|
return nil, aerrors.New(10, "cannot slash miners with blocks from before blizzard")
|
||||||
|
}
|
||||||
|
|
||||||
|
if params.Block2.Height <= build.ForkBlizzardHeight {
|
||||||
|
return nil, aerrors.New(11, "cannot slash miners with blocks from before blizzard")
|
||||||
|
}
|
||||||
|
|
||||||
if params.Block1.Cid() == params.Block2.Cid() {
|
if params.Block1.Cid() == params.Block2.Cid() {
|
||||||
return nil, aerrors.New(3, "blocks must be different")
|
return nil, aerrors.New(3, "blocks must be different")
|
||||||
}
|
}
|
||||||
|
@ -341,7 +341,7 @@ func ComputeState(ctx context.Context, sm *StateManager, height uint64, msgs []*
|
|||||||
return cid.Undef, xerrors.Errorf("applying message %s: %w", msg.Cid(), err)
|
return cid.Undef, xerrors.Errorf("applying message %s: %w", msg.Cid(), err)
|
||||||
}
|
}
|
||||||
if ret.ExitCode != 0 {
|
if ret.ExitCode != 0 {
|
||||||
log.Info("compute state apply message %d failed (exit: %d): %s", i, ret.ExitCode, ret.ActorErr)
|
log.Infof("compute state apply message %d failed (exit: %d): %s", i, ret.ExitCode, ret.ActorErr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user