Skip to content

Commit

Permalink
Merge branch 'master' into create-filesystem-dataarchive
Browse files Browse the repository at this point in the history
  • Loading branch information
david-ry4n authored Oct 10, 2024
2 parents 5e77c1b + e38dcce commit bf7f0a2
Show file tree
Hide file tree
Showing 46 changed files with 398 additions and 1,435 deletions.
2 changes: 0 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,3 @@
### Additions and Improvements

### Bug Fixes
- Fixed the proposer configuration file loading error at startup

5 changes: 5 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,11 @@ subprojects {
propertyTestRuntimeOnly.extendsFrom testRuntimeOnly
referenceTestRuntimeOnly.extendsFrom testRuntimeOnly

// exclude until Besu dependencies start using io.consensys.protocols:jc-kzg-4844
implementation {
exclude(group: "tech.pegasys", module: "jc-kzg-4844")
}

// Details at https://github.com/Hakky54/log-captor#using-log-captor-alongside-with-other-logging-libraries
testImplementation {
exclude(group: "org.apache.logging.log4j", module: "log4j-slf4j-impl")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,27 @@

package tech.pegasys.teku.api;

import tech.pegasys.teku.api.schema.BLSSignature;
import tech.pegasys.teku.api.schema.BeaconBlock;
import tech.pegasys.teku.api.schema.BeaconBlockBody;
import tech.pegasys.teku.api.schema.BeaconState;
import tech.pegasys.teku.api.schema.SignedBeaconBlock;
import tech.pegasys.teku.api.schema.altair.BeaconBlockAltair;
import tech.pegasys.teku.api.schema.altair.BeaconBlockBodyAltair;
import tech.pegasys.teku.api.schema.altair.BeaconStateAltair;
import tech.pegasys.teku.api.schema.bellatrix.BeaconBlockBellatrix;
import tech.pegasys.teku.api.schema.bellatrix.BeaconBlockBodyBellatrix;
import tech.pegasys.teku.api.schema.bellatrix.BeaconStateBellatrix;
import tech.pegasys.teku.api.schema.bellatrix.BlindedBeaconBlockBodyBellatrix;
import tech.pegasys.teku.api.schema.bellatrix.BlindedBlockBellatrix;
import tech.pegasys.teku.api.schema.capella.BeaconBlockBodyCapella;
import tech.pegasys.teku.api.schema.capella.BeaconBlockCapella;
import tech.pegasys.teku.api.schema.capella.BeaconStateCapella;
import tech.pegasys.teku.api.schema.capella.BlindedBeaconBlockBodyCapella;
import tech.pegasys.teku.api.schema.capella.BlindedBlockCapella;
import tech.pegasys.teku.api.schema.deneb.BeaconBlockBodyDeneb;
import tech.pegasys.teku.api.schema.deneb.BeaconBlockDeneb;
import tech.pegasys.teku.api.schema.deneb.BeaconStateDeneb;
import tech.pegasys.teku.api.schema.deneb.BlindedBeaconBlockBodyDeneb;
import tech.pegasys.teku.api.schema.deneb.BlindedBlockDeneb;
import tech.pegasys.teku.api.schema.electra.BeaconBlockBodyElectra;
import tech.pegasys.teku.api.schema.electra.BeaconBlockElectra;
import tech.pegasys.teku.api.schema.electra.BeaconStateElectra;
import tech.pegasys.teku.api.schema.electra.BlindedBeaconBlockBodyElectra;
import tech.pegasys.teku.api.schema.electra.BlindedBlockElectra;
import tech.pegasys.teku.api.schema.phase0.BeaconBlockPhase0;
import tech.pegasys.teku.api.schema.phase0.BeaconStatePhase0;
import tech.pegasys.teku.infrastructure.unsigned.UInt64;
import tech.pegasys.teku.spec.Spec;
import tech.pegasys.teku.spec.SpecMilestone;

Expand All @@ -59,21 +49,6 @@ public SchemaObjectProvider(final Spec spec) {
this.spec = spec;
}

public SignedBeaconBlock getSignedBeaconBlock(
final tech.pegasys.teku.spec.datastructures.blocks.SignedBeaconBlock internalBlock) {

return new SignedBeaconBlock(
getBeaconBlock(internalBlock.getMessage()), new BLSSignature(internalBlock.getSignature()));
}

public SignedBeaconBlock getSignedBlindedBeaconBlock(
final tech.pegasys.teku.spec.datastructures.blocks.SignedBeaconBlock internalBlock) {

return new SignedBeaconBlock(
getBlindedBlock(internalBlock.getMessage()),
new BLSSignature(internalBlock.getSignature()));
}

public BeaconBlock getBeaconBlock(
final tech.pegasys.teku.spec.datastructures.blocks.BeaconBlock block) {
return getBeaconBlock(block, spec.atSlot(block.getSlot()).getMilestone());
Expand Down Expand Up @@ -244,17 +219,4 @@ private BlindedBeaconBlockBodyElectra getBlindedBlockBodyElectra(
tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.electra
.BlindedBeaconBlockBodyElectra.required(body));
}

public BeaconState getBeaconState(
final tech.pegasys.teku.spec.datastructures.state.beaconstate.BeaconState state) {
final UInt64 slot = state.getSlot();
return switch (spec.atSlot(slot).getMilestone()) {
case PHASE0 -> new BeaconStatePhase0(state);
case ALTAIR -> new BeaconStateAltair(state);
case BELLATRIX -> new BeaconStateBellatrix(state);
case CAPELLA -> new BeaconStateCapella(state);
case DENEB -> new BeaconStateDeneb(state);
case ELECTRA -> new BeaconStateElectra(state);
};
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ public BeaconBlockBodyElectra(
deposits,
voluntaryExits,
syncAggregate);
checkNotNull(executionPayload, "Execution Payload is required for Electra blocks");
checkNotNull(executionPayload, "ExecutionPayload is required for Electra blocks");
this.executionPayload = executionPayload;
checkNotNull(blsToExecutionChanges, "BlsToExecutionChanges is required for Electra blocks");
this.blsToExecutionChanges = blsToExecutionChanges;
checkNotNull(blobKZGCommitments, "blobKZGCommitments is required for Electra blocks");
checkNotNull(blobKZGCommitments, "BlobKZGCommitments is required for Electra blocks");
this.blobKZGCommitments = blobKZGCommitments;
checkNotNull(executionRequests, "Execution Requests is required for Electra blocks");
checkNotNull(executionRequests, "ExecutionRequests is required for Electra blocks");
this.executionRequests = executionRequests;
}

Expand All @@ -94,33 +94,22 @@ public BeaconBlockBodyElectra(
.BeaconBlockBodyElectra
message) {
super(message);
checkNotNull(message.getExecutionPayload(), "Execution Payload is required for Electra blocks");
checkNotNull(message.getExecutionPayload(), "ExecutionPayload is required for Electra blocks");
this.executionPayload = new ExecutionPayloadDeneb(message.getExecutionPayload());
checkNotNull(
message.getBlsToExecutionChanges(),
"BlsToExecutionChanges are required for Electra blocks");
message.getBlsToExecutionChanges(), "BlsToExecutionChanges is required for Electra blocks");
this.blsToExecutionChanges =
message.getBlsToExecutionChanges().stream().map(SignedBlsToExecutionChange::new).toList();
checkNotNull(
message.getBlobKzgCommitments(), "BlobKzgCommitments are required for Electra blocks");
message.getBlobKzgCommitments(), "BlobKzgCommitments is required for Electra blocks");
this.blobKZGCommitments =
message.getBlobKzgCommitments().stream()
.map(SszKZGCommitment::getKZGCommitment)
.map(KZGCommitment::new)
.toList();

final List<DepositRequest> depositRequests =
message.getExecutionRequests().getDeposits().stream().map(DepositRequest::new).toList();
final List<WithdrawalRequest> withdrawalRequests =
message.getExecutionRequests().getWithdrawals().stream()
.map(WithdrawalRequest::new)
.toList();
final List<ConsolidationRequest> consolidationRequests =
message.getExecutionRequests().getConsolidations().stream()
.map(ConsolidationRequest::new)
.toList();
this.executionRequests =
new ExecutionRequests(depositRequests, withdrawalRequests, consolidationRequests);
checkNotNull(
message.getExecutionRequests(), "ExecutionRequests is required for Electra blocks");
this.executionRequests = new ExecutionRequests(message.getExecutionRequests());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ public BlindedBeaconBlockBodyElectra(
voluntaryExits,
syncAggregate);
checkNotNull(
executionPayloadHeader, "Execution Payload Header is required for Electra blinded blocks");
executionPayloadHeader, "ExecutionPayloadHeader is required for Electra blinded blocks");
this.executionPayloadHeader = executionPayloadHeader;
checkNotNull(
blsToExecutionChanges, "blsToExecutionChanges is required for Electra blinded blocks");
blsToExecutionChanges, "BlsToExecutionChanges is required for Electra blinded blocks");
this.blsToExecutionChanges = blsToExecutionChanges;
checkNotNull(blobKZGCommitments, "blobKZGCommitments is required for Electra blinded blocks");
checkNotNull(blobKZGCommitments, "BlobKZGCommitments is required for Electra blinded blocks");
this.blobKZGCommitments = blobKZGCommitments;
checkNotNull(
executionRequestsRoot, "execution_requests_root is required for Electra blinded blocks");
executionRequestsRoot, "ExecutionRequestsRoot is required for Electra blinded blocks");
this.executionRequestsRoot = executionRequestsRoot;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/**
* @deprecated As of release 2024.09.00, api.schema is not maintained any longer.
*/
@Deprecated
package tech.pegasys.teku.api.schema;

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit bf7f0a2

Please sign in to comment.