Skip to content

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

Closed
Listed in
@parthshah1

Description

@parthshah1
Contributor

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

Activity

BigLep

BigLep commented on Jun 13, 2025

@BigLep
Member

Thanks for reporting. We'll look into this next week (week of 2025-06-16).

added a commit that references this issue on Jun 17, 2025
1bcba60
moved this from Todo to In review in F3on Jun 17, 2025
moved this from 📌 Triage to 🔎 Awaiting Review in FilOzon Jun 17, 2025
added a commit that references this issue on Jun 20, 2025
3b91482
moved this from 🔎 Awaiting Review to 🎉 Done in FilOzon Jun 20, 2025
moved this from In review to Done in F3on Jun 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

🎉 Done

Status

Done

Milestone

No milestone

Relationships

None yet

    Participants

    @BigLep@masih@parthshah1

    Issue actions

      API v2 request to Filecoin.GetChainTipset tipset with safe selector results in negative height. · Issue #13167 · filecoin-project/lotus