Skip to content

fix: slot length is a ratio #1046

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

Merged
merged 1 commit into from
Jun 14, 2025
Merged

fix: slot length is a ratio #1046

merged 1 commit into from
Jun 14, 2025

Conversation

wolf31o2
Copy link
Member

@wolf31o2 wolf31o2 commented Jun 13, 2025

The devnet config.json we ship in the container uses a slot length of 0.1

@wolf31o2 wolf31o2 requested a review from a team as a code owner June 13, 2025 22:51
@@ -140,7 +140,7 @@ func testQuery(f *globalFlags) {
fmt.Printf("era-history:\n")
for eraId, era := range eraHistory {
fmt.Printf(
"id = %d, begin slot/epoch = %d/%d, end slot/epoch = %d/%d, epoch length = %d, slot length (ms) = %d, slots per KES period = %d\n",
"id = %d, begin slot/epoch = %d/%d, end slot/epoch = %d/%d, epoch length = %d, slot length (ms) = %f, slots per KES period = %d\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this still needs to be %d because the value is in milliseconds

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to convert it, then.

@@ -35,7 +35,7 @@ type ShelleyGenesis struct {
EpochLength int `json:"epochLength"`
SlotsPerKESPeriod int `json:"slotsPerKESPeriod"`
MaxKESEvolutions int `json:"maxKESEvolutions"`
SlotLength int `json:"slotLength"`
SlotLength float32 `json:"slotLength"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use common.GenesisRat for this instead. It will properly maintain the ratio instead of being lossy like float32

@wolf31o2 wolf31o2 force-pushed the fix/slot-length-float branch from bbb799f to e8b0526 Compare June 14, 2025 13:07
Signed-off-by: Chris Gianelloni <[email protected]>
@wolf31o2 wolf31o2 force-pushed the fix/slot-length-float branch from e8b0526 to e36fc0f Compare June 14, 2025 13:09
@wolf31o2 wolf31o2 changed the title fix: slot length is a float fix: slot length is a ratio Jun 14, 2025
@wolf31o2 wolf31o2 merged commit c7d8267 into main Jun 14, 2025
9 checks passed
@wolf31o2 wolf31o2 deleted the fix/slot-length-float branch June 14, 2025 16:13
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 this pull request may close these issues.

2 participants