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

Use Global_slot_since_genesis for stop slots #15513

Open
wants to merge 2 commits into
base: berkeley
Choose a base branch
from

Conversation

mrmr1993
Copy link
Member

This PR is the correct fix for the consistency issue 'fixed' in #15503. The global slot since hard fork was incorrectly used in the original PR #14516; we fix the issue by using the global slot since genesis instead, so that an emergency hard-fork post-berkeley will not force us to use an unrepresentative stop slot.

@mrmr1993 mrmr1993 requested a review from a team as a code owner April 11, 2024 18:08
@mrmr1993
Copy link
Member Author

!ci-build-me

@mrmr1993
Copy link
Member Author

!ci-nightly-me

Comment on lines +1099 to +1118
let open Mina_numbers in
let global_slots_since_hard_fork =
let global_slot_since_hard_fork =
Consensus.Data.Consensus_time.(
to_global_slot
(of_time_exn ~constants:consensus_constants
(Block_time.now time_controller) ))
in
Option.value_exn
@@ Global_slot_since_hard_fork.(
diff global_slot_since_hard_fork zero)
in
let open Mina_numbers in
Global_slot_since_genesis.add
( match constraint_constants.fork with
| None ->
Global_slot_since_genesis.zero
| Some { global_slot_since_genesis; _ } ->
global_slot_since_genesis )
global_slots_since_hard_fork
Copy link
Member

Choose a reason for hiding this comment

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

We seem to be doing this sort of computation in mutliple places in this PR. Can we turn this into a utility function at the global slot module layer? I don't want us getting this conversion wrong in some contexts.

Base automatically changed from georgeee/use-slot_tx_end_or_default-in-fork_config to berkeley April 11, 2024 22:52
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