-
-
Notifications
You must be signed in to change notification settings - Fork 317
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
feat: check gas limit in header received from builder #7336
base: unstable
Are you sure you want to change the base?
Conversation
587034f
to
c0308f9
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## unstable #7336 +/- ##
=========================================
Coverage 48.76% 48.76%
=========================================
Files 601 601
Lines 40243 40243
Branches 2066 2067 +1
=========================================
+ Hits 19625 19626 +1
+ Misses 20580 20579 -1
Partials 38 38 |
Performance Report✔️ no performance regression detected Full benchmark results
|
c0308f9
to
d317aef
Compare
gasLimit: number; | ||
}; | ||
|
||
export class ValidatorRegistrationCache { |
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.
might be able to combine this with BeaconProposerCache
in the future but this requires apis to be consolidated first as proposed in ethereum/beacon-APIs#435
packages/beacon-node/src/chain/produceBlock/produceBlockBody.ts
Outdated
Show resolved
Hide resolved
No issues so far running this branch on Holesky, it looks like builders / relays properly set the expected gas limit |
Motivation
As per spec the builder must adhere to the preferred gas limit of the validator
but currently we are not validating this anywhere and rely on honest builder behavior which is not great considering there are only two builder that produce most of the blocks.
Description
This PR adds a check the to builder flow that compares the expected gas limit against the target gas limit (ie. preferred gas limit of validator) and rejects the builder block in case there is a mismatch which will trigger the fallback to local block.
The expected gas limit is calculated based on this spec
I haven't found where this is defined but it's based on what other clients implement (eg. prysmaticlabs/prysm#14707 and Consensys/teku#8909) and makes sense considering gas limit checks in EIP-1559.