Skip to content

Commit c54f872

Browse files
authored
stop testing get_next_slot_expected_withdrawals() mechanism on Deneb (#7200)
1 parent 6b6c22a commit c54f872

File tree

8 files changed

+10
-214
lines changed

8 files changed

+10
-214
lines changed

AllTests-mainnet.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,6 @@ AllTests-mainnet
776776
```
777777
## Nimbus remote signer/signing test (verifying-web3signer)
778778
```diff
779-
+ Signing BeaconBlock (getBlockSignature(deneb)) OK
780779
+ Signing BeaconBlock (getBlockSignature(electra)) OK
781780
+ Waiting for signing node (/upcheck) test OK
782781
```
@@ -785,7 +784,6 @@ AllTests-mainnet
785784
+ Connection timeout test OK
786785
+ Public keys enumeration (/api/v1/eth2/publicKeys) test OK
787786
+ Public keys reload (/reload) test OK
788-
+ Signing BeaconBlock (getBlockSignature(deneb)) OK
789787
+ Signing BeaconBlock (getBlockSignature(electra)) OK
790788
+ Signing SC contribution and proof (getContributionAndProofSignature()) OK
791789
+ Signing SC message (getSyncCommitteeMessage()) OK

beacon_chain/nimbus_signing_node.nim

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,8 @@ proc installApiHandlers*(node: SigningNodeRef) =
238238

239239
let (feeRecipientIndex, blockHeader) =
240240
case request.beaconBlockHeader.kind
241-
of ConsensusFork.Phase0 .. ConsensusFork.Bellatrix:
242-
# `phase0` and `altair` blocks do not have `fee_recipient`, so
243-
# we return an error.
241+
of ConsensusFork.Phase0 .. ConsensusFork.Capella:
244242
return errorResponse(Http400, BlockIncorrectFork)
245-
of ConsensusFork.Capella:
246-
(GeneralizedIndex(401), request.beaconBlockHeader.data)
247243
of ConsensusFork.Deneb:
248244
(GeneralizedIndex(801), request.beaconBlockHeader.data)
249245
of ConsensusFork.Electra:

beacon_chain/spec/state_transition_epoch.nim

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,8 +1583,7 @@ proc process_epoch*(
15831583
ok()
15841584

15851585
proc get_validator_balance_after_epoch*(
1586-
cfg: RuntimeConfig, state: deneb.BeaconState | electra.BeaconState |
1587-
fulu.BeaconState,
1586+
cfg: RuntimeConfig, state: electra.BeaconState | fulu.BeaconState,
15881587
cache: var StateCache, info: var altair.EpochInfo,
15891588
index: ValidatorIndex): Gwei =
15901589
# Run a subset of process_epoch() which affects an individual validator,
@@ -1669,14 +1668,6 @@ proc get_validator_balance_after_epoch*(
16691668

16701669
post_epoch_balance
16711670

1672-
proc get_next_slot_expected_withdrawals*(
1673-
cfg: RuntimeConfig, state: deneb.BeaconState, cache: var StateCache,
1674-
info: var altair.EpochInfo): seq[Withdrawal] =
1675-
get_expected_withdrawals_aux(state, (state.slot + 1).epoch) do:
1676-
# validator_index is defined by an injected symbol within the template
1677-
get_validator_balance_after_epoch(
1678-
cfg, state, cache, info, validator_index.ValidatorIndex)
1679-
16801671
proc get_next_slot_expected_withdrawals*(
16811672
cfg: RuntimeConfig, state: electra.BeaconState, cache: var StateCache,
16821673
info: var altair.EpochInfo): seq[Withdrawal] =

beacon_chain/validators/validator_pool.nim

Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -632,36 +632,8 @@ proc getBlockSignature*(v: AttachedValidator, fork: Fork,
632632
proofs)
633633
elif blck is ForkedMaybeBlindedBeaconBlock:
634634
withForkyMaybeBlindedBlck(blck):
635-
when consensusFork < ConsensusFork.Deneb:
635+
when consensusFork < ConsensusFork.Electra:
636636
return SignatureResult.err("Invalid beacon block fork")
637-
elif consensusFork == ConsensusFork.Deneb:
638-
when isBlinded:
639-
case v.data.remoteType
640-
of RemoteSignerType.Web3Signer:
641-
Web3SignerRequest.init(fork, genesis_validators_root,
642-
Web3SignerForkedBeaconBlock(kind: ConsensusFork.Deneb,
643-
data: forkyMaybeBlindedBlck.toBeaconBlockHeader))
644-
of RemoteSignerType.VerifyingWeb3Signer:
645-
let proofs =
646-
blockPropertiesProofs(forkyMaybeBlindedBlck.body,
647-
denebIndex)
648-
Web3SignerRequest.init(fork, genesis_validators_root,
649-
Web3SignerForkedBeaconBlock(kind: ConsensusFork.Deneb,
650-
data: forkyMaybeBlindedBlck.toBeaconBlockHeader), proofs)
651-
else:
652-
case v.data.remoteType
653-
of RemoteSignerType.Web3Signer:
654-
Web3SignerRequest.init(fork, genesis_validators_root,
655-
Web3SignerForkedBeaconBlock(kind: ConsensusFork.Deneb,
656-
data: forkyMaybeBlindedBlck.`block`.toBeaconBlockHeader))
657-
of RemoteSignerType.VerifyingWeb3Signer:
658-
let proofs =
659-
blockPropertiesProofs(forkyMaybeBlindedBlck.`block`.body,
660-
denebIndex)
661-
Web3SignerRequest.init(fork, genesis_validators_root,
662-
Web3SignerForkedBeaconBlock(kind: ConsensusFork.Deneb,
663-
data: forkyMaybeBlindedBlck.`block`.toBeaconBlockHeader),
664-
proofs)
665637
elif consensusFork == ConsensusFork.Electra:
666638
when isBlinded:
667639
case v.data.remoteType
@@ -720,21 +692,8 @@ proc getBlockSignature*(v: AttachedValidator, fork: Fork,
720692
proofs)
721693
else:
722694
case blck.kind
723-
of ConsensusFork.Phase0 .. ConsensusFork.Capella:
695+
of ConsensusFork.Phase0 .. ConsensusFork.Deneb:
724696
return SignatureResult.err("Invalid beacon block fork")
725-
of ConsensusFork.Deneb:
726-
case v.data.remoteType
727-
of RemoteSignerType.Web3Signer:
728-
Web3SignerRequest.init(fork, genesis_validators_root,
729-
Web3SignerForkedBeaconBlock(kind: ConsensusFork.Deneb,
730-
data: blck.denebData.toBeaconBlockHeader))
731-
of RemoteSignerType.VerifyingWeb3Signer:
732-
let proofs = blockPropertiesProofs(
733-
blck.denebData.body, denebIndex)
734-
Web3SignerRequest.init(fork, genesis_validators_root,
735-
Web3SignerForkedBeaconBlock(kind: ConsensusFork.Deneb,
736-
data: blck.denebData.toBeaconBlockHeader),
737-
proofs)
738697
of ConsensusFork.Electra:
739698
case v.data.remoteType
740699
of RemoteSignerType.Web3Signer:

tests/consensus_spec/deneb/test_fixture_state_transition_epoch.nim

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# beacon_chain
2-
# Copyright (c) 2022-2024 Status Research & Development GmbH
2+
# Copyright (c) 2022-2025 Status Research & Development GmbH
33
# Licensed and distributed under either of
44
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
55
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
@@ -23,7 +23,6 @@ import
2323
from std/sequtils import mapIt, toSeq
2424
from std/strutils import rsplit
2525
from ../../../beacon_chain/spec/datatypes/deneb import BeaconState
26-
from ../../teststateutil import checkPerValidatorBalanceCalc
2726

2827
const
2928
RootDir = SszTestsDir/const_preset/"deneb"/"epoch_processing"
@@ -75,15 +74,13 @@ template runSuite(
7574
# ---------------------------------------------------------------
7675
runSuite(JustificationFinalizationDir, "Justification & Finalization"):
7776
let info = altair.EpochInfo.init(state)
78-
check checkPerValidatorBalanceCalc(state)
7977
process_justification_and_finalization(state, info.balances)
8078
Result[void, cstring].ok()
8179

8280
# Inactivity updates
8381
# ---------------------------------------------------------------
8482
runSuite(InactivityDir, "Inactivity"):
8583
let info = altair.EpochInfo.init(state)
86-
check checkPerValidatorBalanceCalc(state)
8784
process_inactivity_updates(cfg, state, info)
8885
Result[void, cstring].ok()
8986

tests/consensus_spec/test_fixture_sanity_blocks.nim

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ from ../../beacon_chain/spec/presets import
2121
from ./fixtures_utils import
2222
SSZ, SszTestsDir, hash_tree_root, loadBlock, parseTest,
2323
readSszBytes, toSszType
24-
from ../teststateutil import checkPerValidatorBalanceCalc
2524

2625
proc runTest(
2726
consensusFork: static ConsensusFork,
@@ -54,15 +53,6 @@ proc runTest(
5453
discard state_transition(
5554
defaultRuntimeConfig, fhPreState[], blck, cache, info, flags = {},
5655
noRollback).expect("should apply block")
57-
withState(fhPreState[]):
58-
when consensusFork == ConsensusFork.Deneb:
59-
if unitTestName != "randomized_14":
60-
# TODO this test as of v1.5.0-beta.2 breaks, but also probably
61-
# just remove Deneb-only infrastructure of this sort, since it
62-
# doesn't readily adapt to Electra regardless. For now keep to
63-
# point to a potentially fixable/unexpected test case which is
64-
# involves code not run outside the test suite to begin with.
65-
check checkPerValidatorBalanceCalc(forkyState.data)
6656
else:
6757
let res = state_transition(
6858
defaultRuntimeConfig, fhPreState[], blck, cache, info, flags = {},

0 commit comments

Comments
 (0)