forked from Consensys/teku
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Increase max attestation inclusion slot (beacon chain changes)
- Loading branch information
1 parent
0b5ef8a
commit 88117a0
Showing
17 changed files
with
196 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...a/tech/pegasys/teku/spec/logic/common/operations/validation/AttestationDataValidator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright ConsenSys Software Inc., 2023 | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
|
||
package tech.pegasys.teku.spec.logic.common.operations.validation; | ||
|
||
import tech.pegasys.teku.spec.datastructures.operations.AttestationData; | ||
|
||
public interface AttestationDataValidator | ||
extends OperationStateTransitionValidator<AttestationData> { | ||
|
||
enum AttestationInvalidReason implements OperationInvalidReason { | ||
COMMITTEE_INDEX_TOO_HIGH("CommitteeIndex too high"), | ||
NOT_FROM_CURRENT_OR_PREVIOUS_EPOCH("Attestation not from current or previous epoch"), | ||
SLOT_NOT_IN_EPOCH("Attestation slot not in specified epoch"), | ||
SUBMITTED_TOO_QUICKLY("Attestation submitted too quickly"), | ||
SUBMITTED_TOO_LATE("Attestation submitted too late"), | ||
INCORRECT_CURRENT_JUSTIFIED_CHECKPOINT( | ||
"Attestation source does not match current justified checkpoint"), | ||
INCORRECT_PREVIOUS_JUSTIFIED_CHECKPOINT( | ||
"Attestation source does not match previous justified checkpoint"); | ||
|
||
private final String description; | ||
|
||
AttestationInvalidReason(final String description) { | ||
this.description = description; | ||
} | ||
|
||
@Override | ||
public String describe() { | ||
return description; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...n/java/tech/pegasys/teku/spec/logic/versions/deneb/helpers/BeaconStateAccessorsDeneb.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright ConsenSys Software Inc., 2023 | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
|
||
package tech.pegasys.teku.spec.logic.versions.deneb.helpers; | ||
|
||
import tech.pegasys.teku.infrastructure.unsigned.UInt64; | ||
import tech.pegasys.teku.spec.config.SpecConfigDeneb; | ||
import tech.pegasys.teku.spec.logic.common.helpers.Predicates; | ||
import tech.pegasys.teku.spec.logic.versions.altair.helpers.BeaconStateAccessorsAltair; | ||
|
||
public class BeaconStateAccessorsDeneb extends BeaconStateAccessorsAltair { | ||
|
||
public BeaconStateAccessorsDeneb( | ||
final SpecConfigDeneb config, | ||
final Predicates predicates, | ||
final MiscHelpersDeneb miscHelpers) { | ||
super(config, predicates, miscHelpers); | ||
} | ||
|
||
/** | ||
* <a | ||
* href="https://github.com/ethereum/consensus-specs/blob/dev/specs/deneb/beacon-chain.md#modified-get_attestation_participation_flag_indices">Modified | ||
* get_attestation_participation_flag_indices</a> | ||
*/ | ||
@Override | ||
protected boolean shouldSetTargetTimelinessFlag( | ||
final boolean isMatchingTarget, final UInt64 inclusionDelay) { | ||
return isMatchingTarget; | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
...s/teku/spec/logic/versions/deneb/operations/validation/AttestationDataValidatorDeneb.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright ConsenSys Software Inc., 2023 | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
|
||
package tech.pegasys.teku.spec.logic.versions.deneb.operations.validation; | ||
|
||
import java.util.Optional; | ||
import tech.pegasys.teku.spec.config.SpecConfig; | ||
import tech.pegasys.teku.spec.datastructures.operations.AttestationData; | ||
import tech.pegasys.teku.spec.datastructures.state.beaconstate.BeaconState; | ||
import tech.pegasys.teku.spec.logic.common.helpers.BeaconStateAccessors; | ||
import tech.pegasys.teku.spec.logic.common.helpers.MiscHelpers; | ||
import tech.pegasys.teku.spec.logic.common.operations.validation.OperationInvalidReason; | ||
import tech.pegasys.teku.spec.logic.versions.phase0.operations.validation.AttestationDataValidatorPhase0; | ||
|
||
public class AttestationDataValidatorDeneb extends AttestationDataValidatorPhase0 { | ||
|
||
public AttestationDataValidatorDeneb( | ||
final SpecConfig specConfig, | ||
final MiscHelpers miscHelpers, | ||
final BeaconStateAccessors beaconStateAccessors) { | ||
super(specConfig, miscHelpers, beaconStateAccessors); | ||
} | ||
|
||
/** | ||
* <a | ||
* href="https://github.com/ethereum/consensus-specs/blob/dev/specs/deneb/beacon-chain.md#modified-process_attestation">Modified | ||
* process_attestation</a> | ||
*/ | ||
@Override | ||
protected Optional<OperationInvalidReason> isSubmittedTooLate( | ||
final BeaconState state, final AttestationData data) { | ||
return Optional.empty(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.