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

Add GenesisUnixTime and EpcohDurationInSeconds to StateGetNetworkParams #12872

Open
3 of 9 tasks
eshon opened this issue Feb 5, 2025 · 6 comments
Open
3 of 9 tasks

Add GenesisUnixTime and EpcohDurationInSeconds to StateGetNetworkParams #12872

eshon opened this issue Feb 5, 2025 · 6 comments
Assignees
Labels
good first issue Good for newcomers kind/feature Kind: Feature

Comments

@eshon
Copy link
Contributor

eshon commented Feb 5, 2025

Checklist

  • This is not brainstorming ideas. If you have an idea you'd like to discuss, please open a new discussion on the lotus forum and select the category as Ideas.
  • I have a specific, actionable, and well motivated feature request to propose.

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

What is the motivation behind this feature request? Is your feature request related to a problem? Please describe.

These would be useful to have in StateGetNetworkParams to help tie epochs to IRL dates (for UX/DX)

Reference:
https://filecoinproject.slack.com/archives/CP50PPW2X/p1718780294027079?thread_ts=1714814756.768149&cid=CP50PPW2X

Describe the solution you'd like

Re-filing #12114 because it was a good idea...

Add these 2 fields to StateGetNetworkParams:

  • GenesisUnixTime
  • EpcohDurationInSeconds

Describe alternatives you've considered

No response

Additional context

No response

@rvagg
Copy link
Member

rvagg commented Feb 11, 2025

This should be fairly straightforward and I think would be a nice usability improvement over what we to do now outside of lotus. Marking as good first issue.

GenesisUnixTime -> probably GenesisTimestamp would be more consistent. It's already available on ChainGetGenesis but a little tucked away:

curl -s https://api.node.glif.io/rpc/v1 -X POST -H "Content-Type": "application/json" --data '{"method":"Filecoin.ChainGetGenesis", "params":[], "id":1,"jsonrpc":"2.0"}' | jq '.result.Blocks[0].Timestamp'
1598306400

But it's also trivial to look up so could easily go in StateGetNetworkParams, GetGenesis from the ChainStore gives us that tipset, get the first block and read its Timestamp propery.

EpochDurationInSeconds should come off buildconstants.BlockDelaySecs. The only caveat with this one is that on testnets, particularly through itests, we often adjust it internally and it doesn't match that constant. We could consider making it a var for params_2k.go and adjusting it in the itest kid, but that's probably not strictly necessary, it just might be a good thing to try out so we have consistency.

@keval215
Copy link

I'd like to take this up!
Can you assign this to me

@rjan90
Copy link
Contributor

rjan90 commented Feb 11, 2025

Hey @keval215! Feel free to take this on, I have assigned you to the issue ticket

@rjan90 rjan90 moved this from 📌 Triage to 🐱 Todo in FilOz Feb 11, 2025
@rjan90
Copy link
Contributor

rjan90 commented Feb 18, 2025

Hey @keval215! What is the status on this ticket? Are you still up for taking this on?

@keval215
Copy link

Hey @rjan90 running a bit late, i am up for it , i'll get it done by this week

@rjan90
Copy link
Contributor

rjan90 commented Feb 26, 2025

@keval215 Were you able to take a look at this ticket? Was there anything unclear that we can clarify for you? No worries if you don't have the bandwidth to take it up; I just want to understand if I should still keep this ticket assigned to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers kind/feature Kind: Feature
Projects
Status: 🐱 Todo
Development

No branches or pull requests

4 participants