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

Suggest var:Genesis reading from environment variables to support custom chains. #56

Open
ohko4711 opened this issue Nov 26, 2024 · 0 comments · May be fixed by #57
Open

Suggest var:Genesis reading from environment variables to support custom chains. #56

ohko4711 opened this issue Nov 26, 2024 · 0 comments · May be fixed by #57

Comments

@ohko4711
Copy link

ohko4711 commented Nov 26, 2024

Genesis = 1_606_824_023

func TimeToSlot(t time.Time) uint64 {
	return uint64((t.Unix() - int64(vars.Genesis)) / 12)
}

The slot calculation relies on the genesis timestamp. Our custom chain's genesis doesn't match the hardcoded one in the current code, which will leads to calculation errors.

a simple implementation:
main...OpenFusionist:relayscan:feat/read-genesis-from-env

@ohko4711 ohko4711 linked a pull request Nov 26, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant