-
-
Notifications
You must be signed in to change notification settings - Fork 311
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
fix: handle skip_randao_verification query param as per spec #6576
Changes from all commits
df9e7de
3e1ee02
f1a5e44
e765907
31a699e
df95b69
3266f45
6fde9d9
1418586
f8f7898
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -486,7 +486,7 @@ export type ReqTypes = { | |
query: { | ||
randao_reveal: string; | ||
graffiti: string; | ||
skip_randao_verification?: boolean; | ||
skip_randao_verification?: string; | ||
nazarhussain marked this conversation as resolved.
Show resolved
Hide resolved
|
||
fee_recipient?: string; | ||
builder_selection?: string; | ||
builder_boost_factor?: string; | ||
|
@@ -556,7 +556,7 @@ export function getReqSerializers(): ReqSerializers<Api, ReqTypes> { | |
randao_reveal: toHexString(randaoReveal), | ||
graffiti: toGraffitiHex(graffiti), | ||
fee_recipient: opts?.feeRecipient, | ||
skip_randao_verification: skipRandaoVerification, | ||
nazarhussain marked this conversation as resolved.
Show resolved
Hide resolved
|
||
...(skipRandaoVerification && {skip_randao_verification: ""}), | ||
builder_selection: opts?.builderSelection, | ||
builder_boost_factor: opts?.builderBoostFactor?.toString(), | ||
strict_fee_recipient_check: opts?.strictFeeRecipientCheck, | ||
|
@@ -567,7 +567,7 @@ export function getReqSerializers(): ReqSerializers<Api, ReqTypes> { | |
params.slot, | ||
fromHexString(query.randao_reveal), | ||
fromGraffitiHex(query.graffiti), | ||
query.skip_randao_verification, | ||
parseSkipRandaoVerification(query.skip_randao_verification), | ||
{ | ||
feeRecipient: query.fee_recipient, | ||
builderSelection: query.builder_selection as BuilderSelection, | ||
|
@@ -582,7 +582,7 @@ export function getReqSerializers(): ReqSerializers<Api, ReqTypes> { | |
randao_reveal: Schema.StringRequired, | ||
graffiti: Schema.String, | ||
fee_recipient: Schema.String, | ||
skip_randao_verification: Schema.Boolean, | ||
skip_randao_verification: Schema.String, | ||
builder_selection: Schema.String, | ||
builder_boost_factor: Schema.String, | ||
strict_fee_recipient_check: Schema.Boolean, | ||
|
@@ -795,3 +795,7 @@ export function getReturnTypes(): ReturnTypes<Api> { | |
function parseBuilderBoostFactor(builderBoostFactorInput?: string | number | bigint): bigint | undefined { | ||
return builderBoostFactorInput !== undefined ? BigInt(builderBoostFactorInput) : undefined; | ||
} | ||
|
||
function parseSkipRandaoVerification(skipRandaoVerification?: string): boolean { | ||
return skipRandaoVerification !== undefined && skipRandaoVerification === ""; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I think checking the value doesn't even make sense as the spec states it does not take a value, might be best to just checking if the flag exists There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My understanding of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From this Lighthouse implementation and Nimbus it's also clear they check for the empty string value. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Hmm yeah might be, or potentially the difference between setting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,13 +9,15 @@ import {connectAllNodes, waitForSlot} from "../utils/simulation/utils/network.js | |
const altairForkEpoch = 2; | ||
const bellatrixForkEpoch = 4; | ||
const capellaForkEpoch = 6; | ||
const runTillEpoch = 8; | ||
const denebForkEpoch = 8; | ||
const runTillEpoch = 10; | ||
const syncWaitEpoch = 2; | ||
|
||
const {estimatedTimeoutMs, forkConfig} = defineSimTestConfig({ | ||
ALTAIR_FORK_EPOCH: altairForkEpoch, | ||
BELLATRIX_FORK_EPOCH: bellatrixForkEpoch, | ||
CAPELLA_FORK_EPOCH: capellaForkEpoch, | ||
DENEB_FORK_EPOCH: denebForkEpoch, | ||
runTillEpoch: runTillEpoch + syncWaitEpoch, | ||
initialNodes: 2, | ||
}); | ||
|
@@ -41,18 +43,11 @@ const env = await SimulationEnvironment.initWithDefaults( | |
keysCount: 32, | ||
remote: true, | ||
beacon: BeaconClient.Lighthouse, | ||
// for cross client make sure lodestar doesn't use v3 for now untill lighthouse supports | ||
validator: { | ||
type: ValidatorClient.Lodestar, | ||
options: { | ||
clientOptions: { | ||
useProduceBlockV3: false, | ||
// this should cause usage of produceBlockV2 | ||
// | ||
// but if blinded production is enabled in lighthouse beacon then this should cause | ||
// usage of produce blinded block which should return execution block in blinded format | ||
// but only enable that after testing lighthouse beacon | ||
"builder.selection": "executiononly", | ||
useProduceBlockV3: true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we even have to set this explicitly, or do we want to test as it works in production, i.e. pre deneb use v2 and post deneb v3? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't believe we need to explicitly state this anymore now that we're post Deneb and use it by default. Everything on our side should've flipped to v3 automatically at Deneb unless explicitly stated false. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes but sim tests go through all forks from phase0, just wondering if it makes more sense to test this more closely to production behavior were this only switches to v3 post deneb. On the other hand, there is no public network I know of that is pre deneb anymore, so it just matters for private / testnets or maybe emphemery which does not start genesis at deneb right now iirc |
||
}, | ||
}, | ||
}, | ||
|
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.
Nimbus also treated this attribute as string.
https://github.com/status-im/nimbus-eth2/blob/fc9c72f0ebc2013858f6b28c1940838c97a2f814/beacon_chain/rpc/rest_validator_api.nim#L566