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 the correct values for the fork config #15094

Merged
merged 18 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
791100d
Update fork.mlh
emberian Feb 12, 2024
a267396
Use the correct values for the fork config
mrmr1993 Feb 13, 2024
ac375d4
Merge branch 'berkeley' into fix/state-dump-graphql
mrmr1993 Feb 13, 2024
62f7cc5
Remove merges-cleanly job for rampup, now that it is retired
mrmr1993 Feb 13, 2024
b29f82b
ignore rampup
emberian Feb 13, 2024
da28a8b
Use the correct values for the fork config
mrmr1993 Feb 13, 2024
a0c8e0c
Merge branch 'fix/fork-config-rename' into fix/state-dump-graphql-COM…
mrmr1993 Feb 13, 2024
ecbdcec
Merge branch 'fix/state-dump-graphql-COMPATIBLE' into fix/state-dump-…
mrmr1993 Feb 13, 2024
00f2712
Merge pull request #15107 from MinaProtocol/feature/remove-rampup-check
mrmr1993 Feb 13, 2024
6a44a94
Merge branch 'compatible' into fix/fork-config-rename
mrmr1993 Feb 14, 2024
524c0c6
Merge pull request #15077 from MinaProtocol/fix/fork-config-rename
mrmr1993 Feb 14, 2024
df48399
Merge branch 'compatible' into fix/state-dump-graphql-COMPATIBLE
mrmr1993 Feb 14, 2024
cb007ae
Merge branch 'berkeley' into fix/state-dump-graphql
mrmr1993 Feb 14, 2024
8d3fb98
Merge branch 'berkeley' into fix/state-dump-graphql
mrmr1993 Feb 14, 2024
32b8563
Do not include runtime config into fork export
georgeee Feb 14, 2024
31ce99d
Merge branch 'fix/state-dump-graphql-COMPATIBLE' into fix/state-dump-…
mrmr1993 Feb 14, 2024
7597193
Merge branch 'berkeley' into fix/state-dump-graphql
mrmr1993 Feb 14, 2024
7635f12
Merge branch 'fix/state-dump-graphql' into fix/state-dump-graphql
mrmr1993 Feb 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions buildkite/src/Jobs/Lint/Merge.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,6 @@ Pipeline.build
image = (../../Constants/ContainerImages.dhall).toolchainBase
}
}
, Command.build
Command.Config::{
commands = [ Cmd.run "buildkite/scripts/merges-cleanly.sh rampup"]
, label = "Check merges cleanly into rampup"
, key = "clean-merge-rampup"
, target = Size.Small
, docker = Some Docker::{
image = (../../Constants/ContainerImages.dhall).toolchainBase
}
}
, Command.build
Command.Config::{
commands = [ Cmd.run "true" ] : List Cmd.Type
Expand Down
5 changes: 3 additions & 2 deletions src/lib/mina_graphql/mina_graphql.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2318,6 +2318,7 @@ module Queries = struct
Transition_frontier.Breadcrumb.staged_ledger breadcrumb
|> Staged_ledger.ledger
in
let state_hash = Transition_frontier.Breadcrumb.state_hash breadcrumb in
let protocol_state =
Transition_frontier.Breadcrumb.protocol_state breadcrumb
in
Expand Down Expand Up @@ -2372,8 +2373,8 @@ module Queries = struct
next_epoch.ledger.hash ) ) ;
let%bind new_config =
Runtime_config.make_fork_config ~staged_ledger ~global_slot
~staking_ledger ~staking_epoch_seed ~next_epoch_ledger
~next_epoch_seed ~blockchain_length ~protocol_state runtime_config
~state_hash ~staking_ledger ~staking_epoch_seed ~next_epoch_ledger
~next_epoch_seed ~blockchain_length runtime_config
in
let%map () =
let open Async.Deferred.Infix in
Expand Down
67 changes: 17 additions & 50 deletions src/lib/runtime_config/runtime_config.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1456,9 +1456,9 @@ let ledger_of_accounts accounts =
; add_genesis_winner = Some false
}

let make_fork_config ~staged_ledger ~global_slot ~blockchain_length
~protocol_state ~staking_ledger ~staking_epoch_seed ~next_epoch_ledger
~next_epoch_seed (runtime_config : t) =
let make_fork_config ~staged_ledger ~global_slot ~state_hash ~blockchain_length
~staking_ledger ~staking_epoch_seed ~next_epoch_ledger ~next_epoch_seed
(runtime_config : t) =
let open Async.Deferred.Result.Let_syntax in
let global_slot_since_genesis =
Mina_numbers.Global_slot_since_hard_fork.to_int global_slot
Expand All @@ -1474,37 +1474,10 @@ let make_fork_config ~staged_ledger ~global_slot ~blockchain_length
|> ledger_accounts
in
let ledger = Option.value_exn runtime_config.ledger in
let fork_blockchain_length =
let open Option.Let_syntax in
let%bind proof = runtime_config.proof in
let%map fork = proof.fork in
fork.blockchain_length + blockchain_length
in
let protocol_constants = Mina_state.Protocol_state.constants protocol_state in
let genesis =
{ Genesis.k =
Some
(Unsigned.UInt32.to_int
protocol_constants.Genesis_constants.Protocol.Poly.k )
; delta = Some (Unsigned.UInt32.to_int protocol_constants.delta)
; slots_per_epoch =
Some (Unsigned.UInt32.to_int protocol_constants.slots_per_epoch)
; slots_per_sub_window =
Some (Unsigned.UInt32.to_int protocol_constants.slots_per_sub_window)
; genesis_state_timestamp =
Some
(Block_time.to_string_exn protocol_constants.genesis_state_timestamp)
; grace_period_slots =
Some (Unsigned.UInt32.to_int protocol_constants.grace_period_slots)
}
in
let fork =
Fork_config.
{ state_hash =
Mina_base.State_hash.to_base58_check
(Mina_state.Protocol_state.hashes protocol_state).state_hash
; blockchain_length =
Option.value ~default:blockchain_length fork_blockchain_length
{ state_hash = Mina_base.State_hash.to_base58_check state_hash
; blockchain_length
; global_slot_since_genesis
}
in
Expand All @@ -1530,24 +1503,18 @@ let make_fork_config ~staged_ledger ~global_slot ~blockchain_length
{ ledger = ledger_of_accounts accounts; seed = next_epoch_seed } )
}
in
let update =
make
(* add_genesis_winner must be set to false, because this
config effectively creates a continuation of the current
blockchain state and therefore the genesis ledger already
contains the winner of the previous block. No need to
artificially add it. In fact, it wouldn't work at all,
because the new node would try to create this account at
startup, even though it already exists, leading to an error.*)
~epoch_data ~genesis
~ledger:
{ ledger with
base = Accounts accounts
; add_genesis_winner = Some false
}
~proof:(Proof_keys.make ~fork ()) ()
in
combine runtime_config update
make
(* add_genesis_winner must be set to false, because this
config effectively creates a continuation of the current
blockchain state and therefore the genesis ledger already
contains the winner of the previous block. No need to
artificially add it. In fact, it wouldn't work at all,
because the new node would try to create this account at
startup, even though it already exists, leading to an error.*)
~epoch_data
~ledger:
{ ledger with base = Accounts accounts; add_genesis_winner = Some false }
~proof:(Proof_keys.make ~fork ()) ()

let slot_tx_end_or_default, slot_chain_end_or_default =
let f compile get_runtime t =
Expand Down