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

consortium-v2: make the period definition consistent with contract #638

Merged
merged 2 commits into from
Dec 10, 2024

Conversation

minh-bq
Copy link
Collaborator

@minh-bq minh-bq commented Dec 2, 2024

Currently, Ronin detects the start of new period is the first block of an epoch
where that block's timestamp is on the different date from first block of
previous epoch. However, in contract, the start of new period is the first block
of epoch where the parent of it (the last block of previous epoch)'s timestamp
is on the different date from the last block of "previous previous" epoch. In
this commit, we change the Ronin logic to be consistent with contract after
Venoki hardfork.

Currently, Ronin detects the start of new period is the first block of an epoch
where that block's timestamp is on the different date from first block of
previous epoch. However, in contract, the start of new period is the first block
of epoch where the parent of it (the last block of previous epoch)'s timestamp
is on the different date from the last block of "previous previous" epoch. In
this commit, we change the Ronin logic to be consistent with contract after
Venoki hardfork.
IsPeriodBlock is only called when passing Tripp hardfork already so we don't
need to check it further inside the function.
t.Errorf("wrong period block")
}
}

func generateChain(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we add some description/purpose for this method with flag bumpTimeStampLastBlockOfEpoch usage for setting the timestamp of lastBlock

@minh-bq minh-bq merged commit 18f0e5b into axieinfinity:master Dec 10, 2024
1 check passed
@minh-bq minh-bq deleted the fix/period-definition branch December 10, 2024 08:01
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.

3 participants