Merge pull request #1032 from filecoin-project/feat/drop-most-fatal-errors
reduce most vm errors to non-fatal, explicitly mark disk issues as fatal
This commit is contained in:
commit
f198e81af1
@ -116,7 +116,7 @@ func (pca PaymentChannelActor) UpdateChannelState(act *types.Actor, vmctx types.
|
|||||||
|
|
||||||
vb, nerr := sv.SigningBytes()
|
vb, nerr := sv.SigningBytes()
|
||||||
if nerr != nil {
|
if nerr != nil {
|
||||||
return nil, aerrors.Escalate(nerr, "failed to serialize signedvoucher")
|
return nil, aerrors.Absorb(nerr, 1, "failed to serialize signedvoucher")
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := vmctx.VerifySignature(sv.Signature, self.From, vb); err != nil {
|
if err := vmctx.VerifySignature(sv.Signature, self.From, vb); err != nil {
|
||||||
|
@ -171,7 +171,8 @@ func HandleExternalError(err error, msg string) ActorError {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return &actorError{
|
return &actorError{
|
||||||
fatal: true,
|
fatal: false,
|
||||||
|
retCode: 219,
|
||||||
|
|
||||||
msg: msg,
|
msg: msg,
|
||||||
frame: xerrors.Caller(1),
|
frame: xerrors.Caller(1),
|
||||||
|
@ -259,7 +259,7 @@ func (bs *gasChargingBlocks) GetBlock(ctx context.Context, c cid.Cid) (block.Blo
|
|||||||
}
|
}
|
||||||
blk, err := bs.under.GetBlock(ctx, c)
|
blk, err := bs.under.GetBlock(ctx, c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, aerrors.Escalate(err, "failed to get block from blockstore")
|
||||||
}
|
}
|
||||||
if err := bs.chargeGas(uint64(len(blk.RawData())) * gasGetPerByte); err != nil {
|
if err := bs.chargeGas(uint64(len(blk.RawData())) * gasGetPerByte); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -272,7 +272,10 @@ func (bs *gasChargingBlocks) AddBlock(blk block.Block) error {
|
|||||||
if err := bs.chargeGas(gasPutObj + uint64(len(blk.RawData()))*gasPutPerByte); err != nil {
|
if err := bs.chargeGas(gasPutObj + uint64(len(blk.RawData()))*gasPutPerByte); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return bs.under.AddBlock(blk)
|
if err := bs.under.AddBlock(blk); err != nil {
|
||||||
|
return aerrors.Escalate(err, "failed to write data to disk")
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (vm *VM) makeVMContext(ctx context.Context, sroot cid.Cid, msg *types.Message, origin address.Address, usedGas types.BigInt) *VMContext {
|
func (vm *VM) makeVMContext(ctx context.Context, sroot cid.Cid, msg *types.Message, origin address.Address, usedGas types.BigInt) *VMContext {
|
||||||
|
Loading…
Reference in New Issue
Block a user