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
Reject many skipped blocks #4020
Conversation
Codecov Report
@@ Coverage Diff @@
## unstable #4020 +/- ##
================================
================================
|
Performance Report✔️ no performance regression detected Full benchmark results
|
@@ -66,6 +66,12 @@ Will double processing times. Use only for debugging purposes.", | |||
group: "chain", | |||
}, | |||
|
|||
"chain.maxSkipSlots": { |
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.
@dapplion should this option to be hidden? Also should it have a default value? I do not see a default value set in LH implementation though. If there is a need to set a default, what range of value will be advisable?
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.
Lighthouse doesn't have a default value because it's disabled by default. If the CLI value is not set the check does not apply
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. I was asking, should we also implement it that way (that is have it disabled by default, and hence do not have a default value)? Or do we consider the possibility of a DoS via this avenue high enough that we want to have a default value? (and hence have the check enabled by default)
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.
With this enabled by default you can also reject valid blocks so it's a dangerous feature if miss-used. I imagine that's why Lighthouse has disabled it by default
"safe-slots-to-import-optimistically": number; | ||
// this is defined as part of IBeaconPaths | ||
// "chain.persistInvalidSszObjectsDir": 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.
Why is this comment deleted?
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.
Because I was not sure of the value of keeping the property commented out...it felt like something that was marked for removal.
I have brought it back and updated it a bit to be more clear.
@@ -35,6 +36,9 @@ describe("gossip block validation", function () { | |||
chain.forkChoice = forkChoice; | |||
regen = chain.regen = sinon.createStubInstance(StateRegenerator); | |||
|
|||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access | |||
(chain as any).opts = {maxSkipSlots}; |
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.
You can cast to the full class, which should allow editing. Better than any
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.
Unfortunately on the full class ie BeaconChain
, opts
is a readonly value, so casting it to the full class will not allow editing
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.
Please keep trying other strategies before casting to any
, for example
((chain as Pick<BeaconChain, "opts">) as {opts: BeaconChain["opts"]}).opts = {maxSkipSlots}
Or what about just
chain.opts.maxSkipSlots = maxSkipSlots
Just keep iterating until you find the strongest chain of casting that will not compile if something changes
1aa7dd0
to
05ebc6f
Compare
@dapplion I responded to your recent comments...if you are fine by them...is it possible to help merge? |
b1e598a
to
309170d
Compare
348a895
to
94dc8e0
Compare
Motivation
Description
Closes #3988
Steps to test or reproduce