-
Notifications
You must be signed in to change notification settings - Fork 1
feat(sim): Set appropiate spec id depending on chain. #189
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
base: main
Are you sure you want to change the base?
Conversation
Closes ENG-1506. Appropiately sets the `SpecId` for each chain, depending on which fork is active. This only discriminates between the "expected to activate" hard fork, and the current hard fork.
|
converting to draft pending work discussed on slack |
|
What work? Can we document that somewhere? |
|
@dylanlott just conforming to the ticket w/ genesis |
|
|
||
| /// PecorinoCfg holds network-level configuration values. | ||
| /// The RU Pecorino [`ChainSpec`]. | ||
| static PECORINO_SPEC: LazyLock<ChainSpec> = |
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.
when running the builder, we have a static config, so only 1 of pecorino or mainnet will ever be used. therefore we only need one lazylock here
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.
we do need 1 for RU and 1 for host tho, no?
| } | ||
|
|
||
| fn spec_id(&self) -> SpecId { | ||
| match self.chain_id { |
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.
the chain id pair will not change during program operation, so the flow should initialize the lazylocked specs and then always read from those static specs, rather than matching on chain id each time the fn is invoked
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.
basically, the first time we enter this, it should set the host and ru specs, and then it should only check the chainid for which of those to read

Closes ENG-1506.
Appropiately sets the
SpecIdfor each chain, depending on which fork is active. This only discriminates between the "expected to activate" hard fork, and the current hard fork.