-
Notifications
You must be signed in to change notification settings - Fork 17
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
fix: Epoch initial height #93
Conversation
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.
lgtm
x/epoching/keeper/epochs.go
Outdated
firstEpoch := types.NewEpoch(1, epochInterval, 1, &header.Time) | ||
k.setEpochInfo(ctx, 1, &firstEpoch) |
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.
What's the problem that this tries to address? Upon BeginBlock of block 1 the epoch 1 metadata will be generated, so it seems not necessary to initialise it upon InitGenesis (block 0)
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 also found it might not be necessary. So maybe the point of this pr is to fix the interval of epoch 0?
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.
Sounds good, so how about we keep L40-41 and remove L42-44?
x/epoching/keeper/epochs.go
Outdated
firstEpoch := types.NewEpoch(1, epochInterval, 1, &header.Time) | ||
k.setEpochInfo(ctx, 1, &firstEpoch) |
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.
Sounds good, so how about we keep L40-41 and remove L42-44?
ee47f8f
to
0c39fe2
Compare
When we initialize epoch, we should also initialize epoch 1. Otherwise, epoch 0 will be accessed
When we initialize epoch, we should also initialize epoch 1. Otherwise, epoch 0 will be accessed