Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Eth RPC: do not occlude block param errors. #10534

Merged
merged 1 commit into from
May 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions node/impl/full/eth.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,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 @@ -474,7 +474,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 @@ -553,7 +553,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 @@ -649,7 +649,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 @@ -1070,7 +1070,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