Skip to content

API v2 request to Filecoin.GetChainTipset tipset with safe selector results in negative height. #13167

Open
@parthshah1

Description

@parthshah1

Checklist

  • This is not a security-related bug/issue. If it is, please follow please follow the security policy.
  • I have searched on the issue tracker and the lotus forum, and there is no existing related issue or discussion.
  • I am running the Latest release, the most recent RC(release canadiate) for the upcoming release or the dev branch(master), or have an issue updating to any of these.
  • I did not make any code changes to lotus.

Lotus component

  • lotus daemon - chain sync
  • lotus fvm/fevm - Lotus FVM and FEVM interactions
  • lotus miner/worker - sealing
  • lotus miner - proving(WindowPoSt/WinningPoSt)
  • lotus JSON-RPC API
  • lotus message management (mpool)
  • Other

Lotus Version

Daemon: lotus version 1.33.1-dev+2k+git.fb24904a9.dirty (The patch is for local drand nodes).

Repro Steps

This behavior was seen while running Antithesis simulation, where we called Filecoin.ChainGetTipSet with selector safe, it returns these logs:
2025-06-09T00:39:17.328Z WARN rpc go-jsonrpc@v0.8.0/handler.go:425 error in RPC call to 'Filecoin.ChainGetTipSet': getting latest finalized tipset:
github.com/filecoin-project/lotus/node/impl/full.(*ChainModuleV2).getLatestSafeTipSet
node/impl/full/chain_v2.go:77

  • height -819 is negative:
    github.com/filecoin-project/lotus/chain/store.(*ChainStore).GetTipsetByHeight
    chain/store/store.go:1266

Because safeHeight is defined by height - policy.Chainfinality, which is I believe 900. So it returns height is negative.

Describe the Bug

JsonRPC request to v2 API returns negative if called before 900 epochs aka policy.ChainFinality.

Logging Information

2025-06-09T00:39:17.328Z	WARN	rpc	go-jsonrpc@v0.8.0/handler.go:425	error in RPC call to 'Filecoin.ChainGetTipSet': getting latest finalized tipset:
    github.com/filecoin-project/lotus/node/impl/full.(*ChainModuleV2).getLatestSafeTipSet
        node/impl/full/chain_v2.go:77
  - height -819 is negative:
    github.com/filecoin-project/lotus/chain/store.(*ChainStore).GetTipsetByHeight
        chain/store/store.go:1266

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

🔎 Awaiting Review

Status

In review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions