-
Notifications
You must be signed in to change notification settings - Fork 217
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 genesis time for testnets #540
Conversation
cli/main.go
Outdated
mainnet = flag.Bool("mainnet", true, "use Mainnet") | ||
sepolia = flag.Bool("sepolia", defaultUseSepolia, "use Sepolia") | ||
goerli = flag.Bool("goerli", defaultUseGoerli, "use Goerli") | ||
zhejiang = flag.Bool("zhejiang", defaultUseZhejiang, "use Zhejiang") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Zhejiang is deprecated, can be removed
server/service.go
Outdated
@@ -62,6 +62,7 @@ type BoostServiceOpts struct { | |||
Relays []RelayEntry | |||
RelayMonitors []*url.URL | |||
GenesisForkVersionHex string | |||
GenesisTime int64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be uint64
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I add a commit for that. However at the end, time.Now().UTC().UnixMilli()
is int64
not uint64
, so we still need a cast. IMO it would be better to consider all times as int64.
|
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## develop #540 +/- ##
===========================================
- Coverage 70.24% 70.16% -0.08%
===========================================
Files 6 7 +1
Lines 541 1106 +565
===========================================
+ Hits 380 776 +396
- Misses 132 285 +153
- Partials 29 45 +16
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
nice addition, btw -- thanks for the contribution 👍 |
btw, please fix the linter too |
|
cli/main.go
Outdated
} | ||
log.Infof("using genesis fork version: %s", genesisForkVersionHex) | ||
|
||
switch { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't add a second switch here, assign the time in the switch above, and then below just do a simple if *useCustomGenesisTime > -1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, thanks!
📝 Summary
Display
getHeader request start - %d milliseconds into slot %d
andsubmitBlindedBlock request start - %d milliseconds into slot %d
correctly only by setting the-<testnet-name>
CLI option.Example with
-sepolia
:Design note
I removed the ability to set the genesis time by setting
GENESIS_TIMESTAMP
environment variable.If requested, I can add a
-genesis-timestamp
CLI option, as done with-genesis-fork-version
CLI option.✅ I have run these commands
make lint
==>golangci-lint run
cannot run it ondevelop
branchmake test-race
go mod tidy