-
-
Notifications
You must be signed in to change notification settings - Fork 291
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
Remove SSZ from params #3651
Remove SSZ from params #3651
Conversation
Code Climate has analyzed commit 7180c6f and detected 1 issue on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
Codecov Report
@@ Coverage Diff @@
## master #3651 +/- ##
==========================================
- Coverage 37.16% 37.16% -0.01%
==========================================
Files 321 321
Lines 8696 8689 -7
Branches 1348 1346 -2
==========================================
- Hits 3232 3229 -3
+ Misses 5319 5317 -2
+ Partials 145 143 -2 |
Performance Report✔️ no performance regression detected Full benchmark results
|
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.
Structure lgtm
/** | ||
* Run-time chain configuration | ||
*/ | ||
export interface IChainConfig { | ||
export type IChainConfig = { |
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.
why change to type?
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.
Otherwise Typescript doesnt allow this to be used as a Record<string,unknown> argument in functions
}; | ||
|
||
export const chainConfigTypes: SpecTypes<IChainConfig> = { | ||
PRESET_BASE: "string", |
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.
should these values be enum? or overkill?
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.
Overkill? This whole approach will be review soon anyway to make parsing im the validator client and cli more resilient
@@ -23,7 +25,7 @@ presetStatus.frozen = true; | |||
* | |||
* The active preset can be manually overridden with `setActivePreset` | |||
*/ | |||
export const ACTIVE_PRESET: PresetName = | |||
export const ACTIVE_PRESET = |
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.
is this type now inferred to be PresetName
?
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.
Apparently it's not needed, I can't think of a reason why it would be necessary. Not sure if it's a legacy forgotten though or an old uncommented reason
@@ -16,7 +15,7 @@ export interface IPhase0Preset { | |||
SAFE_SLOTS_TO_UPDATE_JUSTIFIED: number; | |||
|
|||
// Gwei Values | |||
MIN_DEPOSIT_AMOUNT: bigint; | |||
MIN_DEPOSIT_AMOUNT: number; |
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.
This isn't used anywhere?! I guess its hard to argue against changing it to a number
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.
Yeah, not used anywhere 🤷
|
||
export const bellatrix: IBellatrixPreset = { | ||
/* eslint-disable @typescript-eslint/naming-convention */ |
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.
? is this needed 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.
Yes to allow having all caps
import {PresetName} from "@chainsafe/lodestar-params"; | ||
|
||
/* eslint-disable @typescript-eslint/naming-convention */ |
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.
Is this needed 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.
Yes to allow having all caps
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 ❤️ , as discussed on discord, can/will do a followup PR to fill config for beacon <> validator interop and to match preset more deeply 👍
172ef15
to
7180c6f
Compare
Motivation
Currently config and params use SSZ to define the type of its values. This approach is sub-optimal because:
Description