Repository navigation
feat: implement non-eip-7688 changes in alpha.12 #9606
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
Changes from 11 commits
236ff2d
c923cd8
9471f2f
e9f7925
764665b
5f20a23
155a433
4f17768
c7663ac
68cd17b
a241c05
c00a00b
754ccf5
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 |
|---|---|---|
|
|
@@ -83,29 +83,10 @@ export const defaultSkipOpts: SkipOpts = { | |
| // New test suite added in v1.7.0-alpha.8 (consensus-specs #5206); gloas PTC fork choice | ||
| // handling is not yet implemented in Lodestar. | ||
| /^gloas\/fork_choice\/on_payload_attestation_message\/.*$/, | ||
| // TODO GLOAS: Unskip in #9606 | ||
| /^gloas\/operations\/builder_deposit_request\/.*$/, | ||
| ], | ||
| skippedTests: [ | ||
| // TODO-GLOAS: re-enable after gloas light client is implemented | ||
| /\/gloas_fork$/, | ||
| // TODO GLOAS: Unskip in #9606 | ||
|
Member
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. it's great to see we removed a lot of skipped tests in this PR
Contributor
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. Thanks 🙏 — most of the gloas handlers that were stubbed through the earlier alphas are implemented now, so the skips could go. A few remain with TODOs for follow-up (the |
||
| /^gloas\/operations\/builder_deposit_request\/.*$/, | ||
| /\/fork_builder_deposit_followed_by_non_builder_credentials$/, | ||
| /\/fork_builder_deposit_uses_deposit_slot_epoch$/, | ||
| /\/fork_builder_deposit_version$/, | ||
| /\/fork_invalid_builder_deposit_followed_by_valid_builder_deposit$/, | ||
| /\/fork_invalid_validator_deposit_followed_by_builder_credentials$/, | ||
| /\/fork_mixed_pending_deposits$/, | ||
| /\/fork_multiple_builder_deposits$/, | ||
| /\/fork_multiple_deposits_same_builder$/, | ||
| /\/fork_single_builder_deposit$/, | ||
| /\/fork_valid_builder_deposit_followed_by_invalid_builder_deposit$/, | ||
| /\/deposit_requests_greater_than_electra_max$/, | ||
| /\/process_parent_execution_payload__new_builder_does_not_reuse_topped_up_builder_slot$/, | ||
| /\/process_builder_exit_request__success$/, | ||
| /\/process_parent_execution_payload__builder_exit_request$/, | ||
| /\/switch_to_compounding_with_pending_consolidations_at_limit$/, | ||
| ], | ||
| // TODO GLOAS: Investigate why networking tests are failing since alpha.5 | ||
| skippedRunners: ["networking"], | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -32,11 +32,13 @@ export function isBuilderWithdrawalCredential(withdrawalCredentials: Uint8Array) | |||
| } | ||||
|
|
||||
| export function getBuilderPaymentQuorumThreshold(state: CachedBeaconStateGloas): number { | ||||
| const quorum = | ||||
| Math.floor((state.epochCtx.totalActiveBalanceIncrements * EFFECTIVE_BALANCE_INCREMENT) / SLOTS_PER_EPOCH) * | ||||
| BUILDER_PAYMENT_THRESHOLD_NUMERATOR; | ||||
| // total active balance exceeds Number.MAX_SAFE_INTEGER at mainnet scale, keep the intermediate math in bigint | ||||
| const perSlotBalance = | ||||
|
Comment on lines
+34
to
+35
Member
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. is this true? how was this caught, seems like a new spec test?
Member
Author
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 so. Total active EB is like 34M ETH on mainnet, multiply by EFFECTIVE_BALANCE_INCREMENT = 34M * 10^9 = 3.4 * 10^16 Gwei. Which is greater than No spec test for this. Just caught this when reviewing with claude.
Member
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. @lodekeeper can you confirm this math, I assumed
Contributor
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. Confirmed — ensi321 is right, it does overflow, and the current bigint version (from The overflow is on the intermediate
On your assumption — that's the part that doesn't hold. The safe ceiling for a gwei value in a JS number is
The function itself is fine: all intermediate math stays in bigint and only the final result is cast back — and that result is small ( And yeah — no spec test would catch this as-is: it's silent precision loss, not a throw, so a unit test would need a state built at realistic mainnet-scale total balance to surface it.
Member
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. realized we also use
so this change is needed, that's a good catch
Contributor
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. Yeah — and it's worth pinning down why that's consistent, because the two Gwei representations are used deliberately here.
So the overflow was specifically the intermediate full-total reconstruction inside the threshold fn ( tl;dr the split is intentional — full-total balances → |
||||
| (BigInt(state.epochCtx.totalActiveBalanceIncrements) * BigInt(EFFECTIVE_BALANCE_INCREMENT)) / | ||||
| BigInt(SLOTS_PER_EPOCH); | ||||
| const quorum = perSlotBalance * BigInt(BUILDER_PAYMENT_THRESHOLD_NUMERATOR); | ||||
|
|
||||
| return Math.floor(quorum / BUILDER_PAYMENT_THRESHOLD_DENOMINATOR); | ||||
| return Number(quorum / BigInt(BUILDER_PAYMENT_THRESHOLD_DENOMINATOR)); | ||||
| } | ||||
|
|
||||
| function hasBuilderIndexFlag(index: number): boolean { | ||||
|
|
||||
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 updates the unaggregated attestation path to require
forkChoice.hasPayloadHexUnsafe, but the aggregate path still useschain.seenPayloadEnvelopeinpackages/beacon-node/src/chain/validation/aggregateAndProof.ts:99. In Gloas, anindex == 1aggregate submitted throughpublishAggregateAndProofsV2can therefore be accepted and published while the envelope is only inseenPayloadEnvelopeInputCacheand not fully imported with data, even though the alpha.12 gossip rule requiresis_payload_verifiedforbeacon_aggregate_and_prooftoo. Please apply the same fork-choice payload check there.Useful? React with 👍 / 👎.
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 this is valid
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.
Addressed as of
c00a00bc8c("fix: require imported payload for index==1 aggregate gossip"): theindex == 1aggregate path inaggregateAndProof.tsnow gates on!chain.forkChoice.hasPayloadHexUnsafe(toRootHex(attData.beaconBlockRoot))→ IGNOREEXECUTION_PAYLOAD_NOT_SEEN, structurally identical to the unaggregated path inattestation.ts:330. NoseenPayloadEnvelopereference remains in the file, sopublishAggregateAndProofsV2now enforces the sameis_payload_verifiedgossip rule. Good catch by the bot.