-
Notifications
You must be signed in to change notification settings - Fork 193
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 Report
β Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## develop #540 +/- ##
===========================================
- Coverage 70.24% 69.59% -0.65%
===========================================
Files 6 7 +1
Lines 541 1115 +574
===========================================
+ Hits 380 776 +396
- Misses 132 294 +162
- Partials 29 45 +16
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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