Skip to content

Commit

Permalink
Merge pull request #10534 from filecoin-project/raulk/fix-parse-block…
Browse files Browse the repository at this point in the history
…-param-error

fix: Eth RPC: do not occlude block param errors.
  • Loading branch information
ZenGround0 authored May 8, 2023
2 parents 5697645 + 0f8a4b7 commit ed7d1ef
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions node/impl/full/eth.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ func (a *EthModule) EthGetTransactionCount(ctx context.Context, sender ethtypes.

ts, err := a.parseBlkParam(ctx, blkParam, false)
if err != nil {
return ethtypes.EthUint64(0), xerrors.Errorf("cannot parse block param: %s", blkParam)
return ethtypes.EthUint64(0), xerrors.Errorf("failed to process block param: %s; %w", blkParam, err)
}

// First, handle the case where the "sender" is an EVM actor.
Expand Down Expand Up @@ -475,7 +475,7 @@ func (a *EthModule) EthGetCode(ctx context.Context, ethAddr ethtypes.EthAddress,

ts, err := a.parseBlkParam(ctx, blkParam, false)
if err != nil {
return nil, xerrors.Errorf("cannot parse block param: %s", blkParam)
return nil, xerrors.Errorf("failed to process block param: %s; %w", blkParam, err)
}

// StateManager.Call will panic if there is no parent
Expand Down Expand Up @@ -554,7 +554,7 @@ func (a *EthModule) EthGetCode(ctx context.Context, ethAddr ethtypes.EthAddress,
func (a *EthModule) EthGetStorageAt(ctx context.Context, ethAddr ethtypes.EthAddress, position ethtypes.EthBytes, blkParam string) (ethtypes.EthBytes, error) {
ts, err := a.parseBlkParam(ctx, blkParam, false)
if err != nil {
return nil, xerrors.Errorf("cannot parse block param: %s", blkParam)
return nil, xerrors.Errorf("failed to process block param: %s; %w", blkParam, err)
}

l := len(position)
Expand Down Expand Up @@ -650,7 +650,7 @@ func (a *EthModule) EthGetBalance(ctx context.Context, address ethtypes.EthAddre

ts, err := a.parseBlkParam(ctx, blkParam, false)
if err != nil {
return ethtypes.EthBigInt{}, xerrors.Errorf("cannot parse block param: %s", blkParam)
return ethtypes.EthBigInt{}, xerrors.Errorf("failed to process block param: %s; %w", blkParam, err)
}

st, _, err := a.StateManager.TipSetState(ctx, ts)
Expand Down Expand Up @@ -1081,7 +1081,7 @@ func (a *EthModule) EthCall(ctx context.Context, tx ethtypes.EthCall, blkParam s

ts, err := a.parseBlkParam(ctx, blkParam, false)
if err != nil {
return nil, xerrors.Errorf("cannot parse block param: %s", blkParam)
return nil, xerrors.Errorf("failed to process block param: %s; %w", blkParam, err)
}

invokeResult, err := a.applyMessage(ctx, msg, ts.Key())
Expand Down

0 comments on commit ed7d1ef

Please sign in to comment.