From 9412753ba33c4bba7dd5df34a1cd5f9a34464e4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Kripalani?= Date: Sat, 11 Mar 2023 23:03:17 +0000 Subject: [PATCH] Eth API: drop support for 'pending' block parameter. After transitioning from using StateCompute to loading receipts, we can no longer handle the 'pending' block without forcing computation. Eth Core Devs are evaluating a proposal to remove support on their end too. --- node/impl/full/eth.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/node/impl/full/eth.go b/node/impl/full/eth.go index 12e761fa8..0528c2176 100644 --- a/node/impl/full/eth.go +++ b/node/impl/full/eth.go @@ -234,14 +234,13 @@ func (a *EthModule) EthGetBlockByHash(ctx context.Context, blkHash ethtypes.EthH } func (a *EthModule) parseBlkParam(ctx context.Context, blkParam string, strict bool) (tipset *types.TipSet, err error) { - if blkParam == "earliest" { - return nil, fmt.Errorf("block param \"earliest\" is not supported") + switch blkParam { + case "earliest", "pending": + return nil, fmt.Errorf("block param %q is not supported", blkParam) } head := a.Chain.GetHeaviestTipSet() switch blkParam { - case "pending": - return head, nil case "latest": parent, err := a.Chain.GetTipSetFromKey(ctx, head.Parents()) if err != nil {