Skip to content

Commit

Permalink
Merge branch 'master' into update-withdrawal-request-address
Browse files Browse the repository at this point in the history
  • Loading branch information
lucassaldanha authored Dec 9, 2024
2 parents 8c8e9cd + 30d6dab commit b0f8f68
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
### Bug Fixes
- Added a startup script for unix systems to ensure that when jemalloc is installed the script sets the LD_PRELOAD environment variable to the use the jemalloc library
- Set `is_syncing` to `false` instead of `true` for the `/eth/v1/node/syncing` API endpoint when the head is optimistic and the sync distance is 0
- Fix libp2p direct peers handling
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.ImmutableMap;
import java.util.List;
import java.util.Optional;
import tech.pegasys.teku.ethtests.finder.TestDefinition;
import tech.pegasys.teku.infrastructure.ssz.SszData;
Expand Down Expand Up @@ -68,9 +67,6 @@ public class OperationsTestExecutor<T extends SszData> implements TestExecutor {

public static final String EXPECTED_STATE_FILE = "post.ssz_snappy";

// TODO remove https://github.com/Consensys/teku/issues/8892
private static final List<String> IGNORED_TEST = List.of("invalid_nonset_bits_for_one_committee");

private enum Operation {
ATTESTER_SLASHING,
PROPOSER_SLASHING,
Expand Down Expand Up @@ -148,11 +144,6 @@ public OperationsTestExecutor(final String dataFileName, final Operation operati

@Override
public void runTest(final TestDefinition testDefinition) throws Exception {
// TODO remove https://github.com/Consensys/teku/issues/8892
if (IGNORED_TEST.contains(testDefinition.getTestName())) {
return;
}

final BeaconState preState = loadStateFromSsz(testDefinition, "pre.ssz_snappy");

final DefaultOperationProcessor standardProcessor =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.util.List;
import java.util.Optional;
import java.util.function.Supplier;
import java.util.stream.IntStream;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.tuweni.bytes.Bytes32;
Expand Down Expand Up @@ -725,16 +726,25 @@ private Optional<OperationInvalidReason> checkCommittees(
final BeaconState state,
final UInt64 slot,
final SszBitlist aggregationBits) {
int participantsCount = 0;
int committeeOffset = 0;
for (final UInt64 committeeIndex : committeeIndices) {
if (committeeIndex.isGreaterThanOrEqualTo(committeeCountPerSlot)) {
return Optional.of(AttestationInvalidReason.COMMITTEE_INDEX_TOO_HIGH);
}
final IntList committee =
beaconStateAccessorsElectra.getBeaconCommittee(state, slot, committeeIndex);
participantsCount += committee.size();
final int currentCommitteeOffset = committeeOffset;
final boolean committeeHasAtLeastOneAttester =
IntStream.range(0, committee.size())
.anyMatch(
committeeParticipantIndex ->
aggregationBits.isSet(currentCommitteeOffset + committeeParticipantIndex));
if (!committeeHasAtLeastOneAttester) {
return Optional.of(AttestationInvalidReason.PARTICIPANTS_COUNT_MISMATCH);
}
committeeOffset += committee.size();
}
if (participantsCount != aggregationBits.size()) {
if (committeeOffset != aggregationBits.size()) {
return Optional.of(AttestationInvalidReason.PARTICIPANTS_COUNT_MISMATCH);
}
return Optional.empty();
Expand Down
2 changes: 1 addition & 1 deletion gradle/versions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dependencyManagement {
entry 'javalin-rendering'
}

dependency 'io.libp2p:jvm-libp2p:1.2.1-RELEASE'
dependency 'io.libp2p:jvm-libp2p:1.2.2-RELEASE'
dependency 'tech.pegasys:jblst:0.3.12'
dependency 'io.consensys.protocols:jc-kzg-4844:2.0.0'

Expand Down

0 comments on commit b0f8f68

Please sign in to comment.